Skip to content

Commit

Permalink
Fix GetNftApiInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksej-paschenko committed Feb 13, 2024
1 parent 53b200e commit e83ba3c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions abi/generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,18 @@ func TestGetMethods(t *testing.T) {
Sudoer: tlb.MsgAddress{SumType: "AddrNone"},
},
},
{
name: "GetNftApiInfo",
code: "b5ee9c7201022e0100042b000114ff00f4a413f4bcf2c80b0102016202030202cc0405020120202102012006070201481819020120080902012012130201200a0b020120101104df1b088831c02456f8007434c0c05c6c2456f83e900c3c004074c7f4cfc8a0824e8f29aea71b0c750c3434dff5350c3c02b808a0828f354b2ea3871b087e11148831c17e1244f1c144ac7cb819350c343534dff50c3c02f820841a4f4e54148c2eb8c088b000f8c088b001b8c088b001200c0d0e0f005b3b513434ffc07e1874c1c07e18b5007e18fe90007e1935007e1975007e19b4dfc07e19f5007e1a3e90007e1a746000503031f846d08210a8cb00ad708010c8cb055005cf1624fa0214cb6a13cb1fcb3f01cf16c98040fb00002a6c21f84412c705f2e064fa4030f864f844f869f00200326c21f8445220c705f84913c70512b1f2e064fa4030f869f00200ee8e1c6c21f8445220c705f84913c70512b1f2e064d401f865d430f866f002e022c0058e2b30f8445230c705f2e064708018c8cb055004cf1623fa0213cb6acb1fcb3f820afaf08070fb02c98306fb00e031018210aaf7a712ba8e16f8445220c705f84913c70512b1f2e064d430f868f002e05b840ff2f000493e123e11fe11be117e10fe10be107232fff2c1f33e1133c5b33332dff33e1273c5b27b55200013007232fff2fff27e402002012014150201201617001b0060083d039be87cb81975c2ffe000113232ffc0a0083d10e0004f1c24d4c06e638654c82b5c6c2614d03c0114013c00e5d4d03c01053c00f880e93a040d17c1006ea0002d007232cffe0a33c5b25c083232c044fd003d0032c032600201201a1b0201201c1d001b3e401c1d3232c0b281f2fff27420003b3e10c4bc01c83c021de0063232c15633c59c3e80b2daf3333260103ec02000353e11d48c2f3cb419be1048be403e1089440d007c01bcb8197c026001dd3e11fe10aba96fbcb419fe11d4882f3cb81a3e11e93e10aba83e109fc8dc24c8f08022ba1b08be11f0003e1044aeac238757c0dc1620083d039be86634dfcc74ffcc3e18650c3cb01a38be19fc00a3874d3e10a92baebcb81a009c7c013e106ebcb81a005c7c013e187e19fc00b8a01e01fe53378020f40e6fa18e3b3302d37ff84225a15220ac5207baf2e068f84225a1ae16a005d3ff3021ab0022a55280f00458f003542770f00501a55220f00423f003542260f0058e313022c3ff8e2822ab0023a55270f0045374f004f003542770f00523a55230f0045235f00414f003542260f0054500de4055e25120f00303a51f0004455302012022230201202a2b002db8b5d31f001f845d0d431d430d071c8cb0701cf16ccc98020120242502014826270015b4f47e003f087e00fe01100017ae9ff800fc24686983ea18400201202829000caa15f001f849001caad7f001f846d0d30fd30ffa40300201202c2d000db935af001f8478001bb60b7e003f08ba0fe03a861f0890000db50d9e003f0830",
data: "b5ee9c7201021a010004bf0004e75007caeef8f7bda5949e9aad7e0678ac123b035b10560b88f898512d7d6db5ba0a8013ed7c1c9b330fbd58253bb9b8a62b86a11b7e91c8afd1e49172514f89dbce65e000000000000000000000000000000050036cb80621d939ee3f329b44e8f878a3011a380289ae2b915fc4710b8076cb7422010203040114ff00f4a413f4bcf2c80b0502001718004b000500648013ed7c1c9b330fbd58253bb9b8a62b86a11b7e91c8afd1e49172514f89dbce65f00102011902016206070202ce080902012015160201200a0b020120131404b90c8871c02497c0f83434c0c05c6c2497c0f83e903e900c7e800c5c75c87e800c7e800c1cea6d003c00816cf8c081f4c7f4cfe08417f30f45148c2ea3a28c8412040dc409841140b820840bf2c9a8948c2eb8c0a0840701104a948c2ea00c0d0e0f00113e910c1c2ebcb8536000d25b6c22345232c705f2e19501fa40d4fa4025103554443601f00321c701c0008e4401fa00218e3a821005138d9170c85006cf1658cf161034413073708010c8cb055007cf165005fa0215cb6a12cb1fcb3f226eb39458cf17019132e201c901fb00925f04e2925f03e201f65136c705f2e191fa4021f001fa40d20031fa00820afaf0801ca121945315a0a1de22d70b01c300209206a19136e220c2fff2e192218e3e821005138d91c8500acf16500ccf1671244a145446b0708010c8cb055007cf165005fa0215cb6a12cb1fcb3f226eb39458cf17019132e201c901fb00105894102b385be2100080135f03333334347082108b77173504c8cbff58cf164430128040708010c8cb055007cf165005fa0215cb6a12cb1fcb3f226eb39458cf17019132e201c901fb00015e8e8a32104810371026104502e03136373782101a0b9d5116ba9e5131c705f2e19a01d4304400f003e05f06840ff2f0110082028e3527f0018210d53276db103845006d71708010c8cb055007cf165005fa0215cb6a12cb1fcb3f226eb39458cf17019132e201c901fb0093303335e25503f00301f65134c705f2e191fa4021f001fa40d20031fa00820afaf0801ca121945315a0a1de22d70b01c300209206a19136e220c2fff2e192218e3e8210511a4463c85008cf16500ccf1671244814544690708010c8cb055007cf165005fa0215cb6a12cb1fcb3f226eb39458cf17019132e201c901fb00103894102b365be2120082028e3527f0018210d53276db103848006d71708010c8cb055007cf165005fa0215cb6a12cb1fcb3f226eb39458cf17019132e201c901fb0093303630e25503f00300413b513434cffe900835d27080271fc07e90353e900c040d440d380c1c165b5b5b600025013232cfd400f3c58073c5b30073c5b27b5520000dbf03a78013628c000bbc7e7f801184006e0168747470733a2f2f732e67657467656d732e696f2f6e66742f622f632f3632626439333261376235663837393031663364386431392f009a68747470733a2f2f732e67657467656d732e696f2f6e66742f622f632f3632626439333261376235663837393031663364386431392f6d6574612e6a736f6e3f31363936363038373534343531009a68747470733a2f2f6170692e67657467656d732e696f2f636e66742f4551426f76436d584b36787973593361336e33456d764d71736e4d696e4e492d384d4738614b583577686849414950522f",
account: "0:68bc29972bac72b18ddade7dc49af32ab273229cd23ef0c1bc68a5f9c2184800",
method: GetNftApiInfo,
wantTypeHint: "GetNftApiInfoResult",
want: GetNftApiInfoResult{
Version: 1,
Uri: "https://api.getgems.io/cnft/EQBovCmXK6xysY3a3n3EmvMqsnMinNI-8MG8aKX5whhIAIPR/",
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion abi/get_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ func GetNftApiInfo(ctx context.Context, executor Executor, reqAccountID ton.Acco
}

func DecodeGetNftApiInfoResult(stack tlb.VmStack) (resultType string, resultAny any, err error) {
if len(stack) < 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") {
if len(stack) < 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkCell") {
return "", nil, fmt.Errorf("invalid stack format")
}
var result GetNftApiInfoResult
Expand Down
2 changes: 1 addition & 1 deletion abi/schemas/nfts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<get_method name="get_nft_api_info">
<output>
<int name="version">uint32</int>
<int name="uri">text</int>
<cell name="uri">text</cell>
</output>
</get_method>

Expand Down

0 comments on commit e83ba3c

Please sign in to comment.