Skip to content

Commit

Permalink
add raw_body
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-tron committed Jun 10, 2023
1 parent 0376ec8 commit b888642
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 20 deletions.
5 changes: 5 additions & 0 deletions api/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1768,6 +1768,11 @@
"example": "0xdeadbeaf",
"type": "string"
},
"raw_body": {
"description": "hex-encoded BoC with raw message body",
"example": "B5EE9C7201010101001100001D00048656C6C6F2C20776F726C64218",
"type": "string"
},
"source": {
"$ref": "#/components/schemas/AccountAddress"
},
Expand Down
4 changes: 4 additions & 0 deletions api/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1857,6 +1857,10 @@ components:
example: "0xdeadbeaf"
init:
$ref: '#/components/schemas/StateInit'
raw_body:
type: string
description: hex-encoded BoC with raw message body
example: "B5EE9C7201010101001100001D00048656C6C6F2C20776F726C64218"
decoded_op_name:
type: string
example: "nft_transfer"
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/blockchain_converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ func convertMessage(m core.Message, book addressBook) oas.Message {
ImportFee: m.ImportFee,
CreatedAt: int64(m.CreatedAt),
}
if len(m.Body) != 0 {
msg.RawBody.SetTo(hex.EncodeToString(m.Body))
}
if m.OpCode != nil {
msg.OpCode = oas.NewOptString("0x" + hex.EncodeToString(binary.BigEndian.AppendUint32(nil, *m.OpCode)))
}
Expand Down
27 changes: 22 additions & 5 deletions pkg/oas/oas_json_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 27 additions & 15 deletions pkg/oas/oas_schemas_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b888642

Please sign in to comment.