-
Notifications
You must be signed in to change notification settings - Fork 25
/
tonpay_test.go
265 lines (237 loc) · 42.3 KB
/
tonpay_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
package known_test
import (
"encoding/json"
"os"
"reflect"
"testing"
"github.com/stretchr/testify/require"
"github.com/xssnick/tonutils-go/address"
"github.com/xssnick/tonutils-go/tvm/cell"
"github.com/tonindexer/anton/abi"
"github.com/tonindexer/anton/addr"
)
func TestOperationDesc_TonpayStore(t *testing.T) {
var (
interfaces []*abi.InterfaceDesc
i *abi.InterfaceDesc
)
j, err := os.ReadFile("tonpay.json")
require.Nil(t, err)
err = json.Unmarshal(j, &interfaces)
require.Nil(t, err)
for _, i = range interfaces {
if i.Name == "tonpay_store" {
err := abi.RegisterDefinitions(i.Definitions)
require.Nil(t, err)
break
}
}
var testCases = []*struct {
name string
boc string
expected string
}{
{
// tx hash bOdb2kON0C3THIjtMSq2lFyV1hV2AJj6v/OT7aEWZc4=
name: "tonpay_issue_invoice",
boc: `te6cckEBBQEAdgAEa0tOcLAAAAAAAAAAAMAAAAAO5rKACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQQDAgEAAAAIAAAAAAAYAAAAAHRzeWFoc2JiAEOACqgkTogi/ogp4FlGjfhGScVWc2oEeEJsrI2qei/kE0rwOKnC1A==`,
expected: `{"query_id":0,"has_customer":-1,"customer_address":"NONE","invoice_id":"\ufffd\n\ufffd$N\ufffd\"\ufffd\ufffd)\ufffdYF\ufffd\ufffdFI\ufffdVsj\u0004xBl\ufffd\ufffd\ufffdz/\ufffd\u0013J\ufffd","metadata":"\u0000\u0000\u0000\u0000tsyahsbb","amount":4000000000,"accepts_jetton":-2,"jetton_master_address":"NONE","jetton_wallet_code":"te6cckEBAQEABgAACAAAAADjAK8P"}`,
}, {
// tx hash 497ABFD5F35FB195883854D94BCAFDD15378AD1F995E43B12DF15F2F54672558
name: "tonpay_issue_invoice",
boc: `te6ccuECFQEAA4wAAHgAwADeAOoBBAEOARgBOAFCAUwCCAIeAigCsAOsA7YESAVCBiIGkgcYBGtLTnCwAAAAAAAAAAAAAAAAAABhqDgB6XupAfmvOo+3XtwG+iRSIr/WXPWB4jPCwderoGNXvl0BAgMEAEOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABoAAAAAdGVzdGNyYXNoAAgAAAAAART/APSkE/S88sgLBQIBYgYHAgLMCAkAG6D2BdqJofQB9IH0gahhAgEgCgsCASAMDQC30QY4B5IADoaYGAuNhKia+B+AZwfSB9IBj9ABi465D9ABj9ABgBaY/BCAfFP1KpEF1KmJos+ATwQQgLxqKMqRBdSxiZoBn4BXAawQgsr4PeXUms+AXwL4JCB/l4QAEWvpEMHC68uFNgIBIA4PAIPUAQa5D2omh9AH0gfSBqGAJpj8EIC8aijKkQXUEIPe7L7wndCVj5cWLpn5j9ABgJ0CgR5CgCfQEsZ4sA54tmZPaqQB9VA9M/+gD6QCHwBu1E0PoA+kD6QNQwUTahUirHBfLiwSjC//LiwlQ0QnBUIBNUFAPIUAT6AljPFgHPFszJIsjLARL0APQAywDJIPkAcHTIywLKB8v/ydAE+kD0BDH6AHeAGMjLBVAIzxZw+gIXy2sTzIIQF41FGcjLHxmBACASAREgCOyz9QB/oCIs8WUAbPFiX6AlADzxbJUAXMB6oAE6CCCJiWgKoAggiYloCgoBS88uLFBMmAQPsAECPIUAT6AljPFgHPFszJ7VQC8TtRND6APpA+kDUMAfTP/oAUVGgBfpA+kBTWscFVHNscFQgE1QUA8hQBPoCWM8WAc8WzMkiyMsBEvQA9ADLAMn5AHB0yMsCygfL/8nQUAzHBRux8uLDCfoAggiYloCCCJiWgKAaoSGVEEk4XwTjDSXXCwHDACTCALCATFADbO1E0PoA+kD6QNQwB9M/+gD6QDBRUaFSSccF8uLBJ8L/8uLCggiYloCqABagFrzy4sOCEHvdl97Iyx8Vyz9QA/oCIs8WAc8WyXGAEMjLBSTPFnD6AstqzMmAQPsAQBPIUAT6AljPFgHPFszJ7VSAAbFIZoBihghBzYtCcyMsfUkDLP1AD+gIBzxZQB88WyXGAGMjLBSXPFlAH+gIWy2oVzMlx+wAQNACCjiqCCJiWgHL7AoIQ1TJ223CAEMjLBVAIzxZQBfoCFstqE8sfE8s/yXL7AFiSbDPiVQLIUAT6AljPFgHPFszJ7VS7ZIAO`,
expected: `{"query_id":0,"has_customer":0,"customer_address":"NONE","invoice_id":"\ufffd\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","metadata":"\u0000\u0000\u0000\u0000testcrash","amount":400003,"accepts_jetton":-2,"jetton_master_address":"NONE","jetton_wallet_code":"te6cckEBAQEABgAACAAAAADjAK8P"}`,
}, {
// msg hash fddW6FrzbcqUwWCkgTpe/IASFTIJa9T2rZfd8ttA/AY=
name: "tonpay_request_purchase",
boc: `te6cckEBAwEAMQACKDa3lbUAAAAAAAAAAAAAAAApuScAAgEACAAAAAAAIgAAAAAxNjg1MjI2NTc3NjYxh6Sd4g==`,
expected: `{"query_id":0,"invoice_id":"\u0000\u0000\u0000\u00001685226577661","metadata":"\u0000\u0000\u0000\u0000","amount":700000000}`,
}, {
// msg hash 0IINk12EisSBj+fkxh+RKbbT9m6Fb7qoHIVhEWin0GA=
name: "tonpay_edit_store",
boc: `te6cckEBBQEA4wAEHKCyth0AAAAAAAAAABa6BAMCAQBSAAAAAGh0dHBzOi8vZW5veGZyNGJ1b2JoLngucGlwZWRyZWFtLm5ldC8AogAAAAB0b25zdG9yYWdlOi8vRTY2MDIzRDdFMzBDN0RERDREOTdFNEUwODU5Q0ZBRTRDNTVGRkNFQzhGNTVGRTQ1QjZFOUU2MEVGQjM3Rjg2QgBqAAAAAFN1cGVyIHN0b3JlIHRoYXQgc2VsbHMgZGlmZmVyZW50IHRoaW5ncyB0byBwZW9wbGUAMAAAAABUb25wYXkgVGVzdGluZyBTdG9yZZ+uAFU=`,
expected: `{"query_id":0,"new_name":"\u0000\u0000\u0000\u0000Tonpay Testing Store","new_description":"\u0000\u0000\u0000\u0000Super store that sells different things to people","new_image":"\u0000\u0000\u0000\u0000tonstorage://E66023D7E30C7DDD4D97E4E0859CFAE4C55FFCEC8F55FE45B6E9E60EFB37F86B","new_webhook":"\u0000\u0000\u0000\u0000https://enoxfr4buobh.x.pipedream.net/","new_mcc_code":5818}`,
},
// {
// // msg hash 0IINk12EisSBj+fkxh+RKbbT9m6Fb7qoHIVhEWin0GA=
// name: "tonpay_upgrade_code_full",
// boc: `te6cckECXgEAEQMAAxm0O7tSAAAAAAAAAAAgAwIBAAABFP8A9KQT9LzyyAsEART/APSkE/S88sgLFgIBYg0FAgEgCQYCASAHPQIBIAgRADm2fz2omh9IH0gfSBpAOpqammf6QDpAOoYeAOvhkAIBIAotAgFIDAsAPbAQe1E0PpA+kD6QNIB1NTU0z/SAdIB1DDwBxBcXwyAAO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KfqXIyx8Vyz9QCPoCUAbPFlAEzxb0AFAE+gIBzxbJcYAQyMsFUATPFlj6AhLLaszJgwb7AAC8MO1E0PpA+kD6QNIB1NTU0z/SAdIB1DDwB18DUFZfBSGzloIA8AHy8N4gloIA8AXy8N5RY8cFs5WBDwDy8N4E0gHU1NTTP9IB+kDUMBCsEJsQihB5EGgQVxBGEDXwCQCCW+1E0PpA+kD6QNIB1NTU0z/SAdIB1DDwBwOSXw3gUcrHBbOVgQ8A8vDeEKsQmhCJEHgQZxBWEEUQNBAjf0Ez8AkCAUggHwA9sBB7UTQ+kD6QPpA0gHU1NTTP9IB0gHUMPAHEFxfDIAA7sNE7UTQ+kD6QPpA0gHU1NTTP9IB0gHUMPAHHF8MgAE+yBZGUAgOeLZmTkKAXniygE54soA+eLCuUAieZmZmWf5QDlAOZk9qpAgEgKSMCASAnJAIBICYlAD2xdTtRND6QPpA+kDSAdTU1NM/0gHSAdQw8AcQbF8MgAD2xMztRND6QPpA+kDSAdTU1NM/0gHSAdQw8AcQfF8MgAgEgKDAAPbKnO1E0PpA+kD6QNIB1NTU0z/SAdIB1DDwBxCMXwyACASAvKgIBSC4rAgFYLSwANaW12omh9IH0gfSBpAOpqammf6QDpAOoYeAO9QA3peHaiaH0gfSB9IGkA6mpqaZ/pAOkA6hh4A7ZgwAHrsI9QAA5tn89qJofSB9IH0gaQDqamppn+kA6QDqGHgDr4ZACASAyMQA9rtR2omh9IH0gfSBpAOpqammf6QDpAOoYeAOIXi+GQAA9rcb2omh9IH0gfSBpAOpqammf6QDpAOoYeAOIFi+GQBYtabU=","has_new_data":0,"new_store_data":"te6cckEBAQEAAgAAAEysuc0="}`,
// },
// {
// // msg hash 9z9qbu4I8FSbEmLNwmnbquuFwcYecuOdvElRpujbglE=
// name: "tonpay_upgrade_code_invoice",
// boc: `te6cckECIAEAA7QAARi18UJPAAAAAAAAAAABART/APSkE/S88sgLAgIBYhUDAgEgDwQCASAKBQIBIAcGADW0mZ2omh9IH0gfSBpA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EHtRND6QPpA+kDSAdTU0z/SAdIBMBAoXwiAIBIBgVAgFIFxYAL69tdqJofSB9IH0gaQDqammf6QDpAJg6wAAHrsI6wAAxtn89qJofSB9IH0gaQDqammf6QDpAJgvhEAIBIBsaADW0mZ2omh9IH0gfSBpAOpqaZ/pAOkAmAgcL4RACASAdHAA1s2o7UTQ+kD6QPpA0gHU1NM/0gHSATAQeF8IgADWypztRND6QPpA+kDSAdTU0z/SAdIBMBBIXwiAAiDDtRND6QPpA+kDSAdTU0z/SAdIBMGxCILOWggDwAfLw3iGWggDwBfLw3lFjxwWzlYEPAPLw3gTSAdTU0z8wEGhVFfAC/f/Z/Q=="}`,
// },
}
for _, test := range testCases {
j := loadOperation(t, i, test.name, test.boc)
require.Equal(t, test.expected, j)
}
}
func TestGetMethodDesc_TonpayStore(t *testing.T) {
var (
interfaces []*abi.InterfaceDesc
i *abi.InterfaceDesc
)
j, err := os.ReadFile("tonpay.json")
require.Nil(t, err)
err = json.Unmarshal(j, &interfaces)
require.Nil(t, err)
for _, i = range interfaces {
if i.Name == "tonpay_store" {
err := abi.RegisterDefinitions(i.Definitions)
require.Nil(t, err)
break
}
}
var testCases = []*struct {
name string
addr *address.Address
code string
data string
expected []any
}{
{
name: "get_store_data",
addr: addr.MustFromBase64("EQCtRWrkfxovf-H02xc5CjHpC4t3VnxAIrCg6LJaaYflj4RY").MustToTonutils(),
code: `te6cckECJQEABaoAART/APSkE/S88sgLAQIBYgIDAgLNBAUCASATFATz0ZkWOASS+B8GhpgYC42EkvgfB9IBgBaY/pn5iQwQglpzhYXXGBEMEIG1vK2t1xgRkQQQhQWVsO3UcZmHaiaH0gampqAOhqahgBaYfpAOoYCBooKy+CqKFjgtnKwIeAeXhvAWpqampph5gqivgCcBBBCHzfyxvdcYEQQGBwgJAgEgDxABxGwh7UTQ+kDU1NQB0NTUMALTD9IB1DAQNFBWXwWzk/LA8N5TMccFs5WBDwDy8N4C0gHU1NTTPzAQV40IYAe2GfiNXKAcfsRWzP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SV8JgADexdTtRND6QPpA+kDSAdTU1NM/0gHSATAQOV8JgChgrfw==`,
expected: []any{
address.MustParseAddr("EQAiybdndsGkvXphCXWLDu76jwETEKP3aTM2PBjJ7nQ_TkjB"),
"\x00\x00\x00\x00TON Byte",
"\x00\x00\x00\x00TON Storage provider",
"\x00\x00\x00\x00https://tonbyte.com/gateway/9281AE841E48C9A9B27261940C0553C83F8792E37A97519913AFF3D3F1312FBE",
"\x00\x00\x00\x00",
uint16(0x1ccc),
int8(-1),
&cell.Cell{},
uint64(0xb),
},
}, {
name: "get_store_data",
addr: addr.MustFromBase64("EQD4CTLrsCUn2CFQlIhJtRZl7qJnIc76VW3TbDzVAh3ish-j").MustToTonutils(),
code: `te6cckECKQEAB8QAART/APSkE/S88sgLAQIBYgIDAgLMBAUCASAXGATz2ZkWOASS+B8GhpgYC42EkvgfB9IBgBaY/pn5FBCDmxaE5dcYEYkMEIJac4WF1xgRDBCBtbytrdcYEZEEEIUFlbDt1HGZh2omh9IGpqagDoamoYAWmH6QDqGAgaKCsvgqihY4LZysCHgHl4bwFqampqaYeYKor4BPAQQGBwgJAgFIExQB4mwS+gD6QNMAAcABk9Qw0N7THwGCEDa3lbW9jkgwM3DIywDJ0FQUA1AzcXBtghAPin6lyMsfFcs/UAj6AlAGzxZQBM8W9ABQBPoCAc8WyXGAEMjLBVAEzxZY+gISy2rMyYBA+wDg1PpA1NTTPzD4KFNFCgHObCHtRND6QNTU1AHQ1NQwAtMP0gHUMBA0UFZfBbOT8sDw3lMxxwWzlYEPAPLw3gLSAdTU1NM/0gH6QNQwEIqNCGAHthn4jVygHH7EVsz/K8Mhd8jdT//l8zxhR4XN39akH0QKVQh/AQ8B/jHtRND6QNTU1AHQ1NQwAtMP0gHUMBA0UFZfBbOT8sDw3gLU1NM/MCCCCvrwgKAWuZPywPHejQhgB7YZ+I1coBx+xFbM/yvDIXfI3U//5fM8YUeFzd/WpB9EcMiNCGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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2u1HaiaH0gfSB9IGkA6mpqaZ/pAOkA6hh4A4heL4ZAAD2xMztRND6QPpA+kDSAdTU1NM/0gHSAdQw8AcQfF8MgAD2xdTtRND6QPpA+kDSAdTU1NM/0gHSAdQw8AcQbF8Mg7AXQqA==`,
expected: []any{
address.MustParseAddr("EQBVQSJ0QRf0QU8CyjRvwjJOKrObUCPCE2VkbVPRfyCaV1NY"),
"\x00\x00\x00\x00Durger King 2.0",
"\x00\x00\x00\x00The best burgers at your fingertips",
"\x00\x00\x00\x00https://tonbyte.com/gateway/FF6F4B1BC014F028CCA11E782C0DE5E970960FE0AFBA828F12428204D81EC547",
"\x00\x00\x00\x00",
uint16(0x16b6),
int8(-1),
&cell.Cell{},
uint64(0xc),
},
},
// {
// name: "get_store_version",
// addr: addr.MustFromBase64("EQCtRWrkfxovf-H02xc5CjHpC4t3VnxAIrCg6LJaaYflj4RY").MustToTonutils(),
// code: `te6cckECJQEABaoAART/APSkE/S88sgLAQIBYgIDAgLNBAUCASATFATz0ZkWOASS+B8GhpgYC42EkvgfB9IBgBaY/pn5iQwQglpzhYXXGBEMEIG1vK2t1xgRkQQQhQWVsO3UcZmHaiaH0gampqAOhqahgBaYfpAOoYCBooKy+CqKFjgtnKwIeAeXhvAWpqampph5gqivgCcBBBCHzfyxvdcYEQQGBwgJAgEgDxABxGwh7UTQ+kDU1NQB0NTUMALTD9IB1DAQNFBWXwWzk/LA8N5TMccFs5WBDwDy8N4C0gHU1NTTPzAQV40IYAe2GfiNXKAcfsRWzP8rwyF3yN1P/+XzPGFHhc3f1qQfRAdVBX8BCgH+Me1E0PpA1NTUAdDU1DAC0w/SAdQwEDRQVl8Fs5PywPDeAtTU0z8wIIIK+vCAoBa5k/LA8d6NCGAHthn4jVygHH7EVsz/K8Mhd8jdT//l8zxhR4XN39akH0RwyI0IYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAsAVFvtRND6QNTU1AHQ1NQwAtMP0gHUMBA0MVF2xwWz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UTQ+kD6QPpA0gHU1NTTP9IB0gEws5JfCuBRl8cFs5WBDwDy8N5VB3DwAgDejitb7UTQ+kD6QPpA0gHU1NTTP9IB0gEwkl8K4FGXxwWzlYEPAPLw3lUHf/AC4IIQYb3fi7qOMu1E0PpA+kD6QNIB1NTU0z/SAdIBMBB5XwkSxwWzlYEPAPLw3tTSAQGU1DDtVJEw4vsE4FuED/LwANqRcJKDBuL7AFOLxwWWNDQH+kAwmzkEkgLQkjIo4hAn4lNpxwWSOSiRCeJTg7yOJXAggBDIywVQA88WUaWhGvoCy2oYyx+LZjaGFuZ2WM8WyYMG+wCSMDfif8hQCc8WySgQaRBYEEdQBQRDE/ACAgEgExQCASAbHAA3uQQe1E0PpA+kD6QNIB1NTU0z/SAdIBMBApXwmAIBIBUWAgEgFxgCASAZGgA3s9L7UTQ+kD6QPpA0gHU1NTTP9IB0gEwEHlfCYAA1soG7UTQ+kD6QPpA0gHU1NTTP9IB0gEwGV8JgADOxJntRND6QPpA+kDSAdTU1NM/0gHSATBskYAA3s7Q7UTQ+kD6QPpA0gHU1NTTP9IB0gEwEGlfCYAIBIB0eAgEgISIAM7Z/PaiaH0gfSB9IGkA6mpqaZ/pAOkAmC+EwAgFIHyAAB67CPMAAMa9tdqJofSB9IH0gaQDqamppn+kA6QCYPMACASAjJAIBICUmADeypztRND6QPpA+kDSAdTU1NM/0gHSATAQWV8JgADezajtRND6QPpA+kDSAdTU1NM/0gHSATAQiV8JgADexMztRND6QPpA+kDSAdTU1NM/0gHSATAQSV8JgADexdTtRND6QPpA+kDSAdTU1NM/0gHSATAQOV8JgChgrfw==`,
// expected: []any{
// uint64(0xb),
// },
// },
}
for _, test := range testCases {
ret := execGetMethod(t, i, test.addr, test.name, test.code, test.data)
for it := range ret {
if reflect.TypeOf(test.expected[it]) == reflect.TypeOf(&cell.Cell{}) {
continue
}
require.Equal(t, test.expected[it], ret[it])
}
}
}
func TestOperationDesc_TonpayInvoice(t *testing.T) {
var (
interfaces []*abi.InterfaceDesc
i *abi.InterfaceDesc
)
j, err := os.ReadFile("tonpay.json")
require.Nil(t, err)
err = json.Unmarshal(j, &interfaces)
require.Nil(t, err)
for _, i = range interfaces {
if i.Name == "tonpay_invoice" {
err := abi.RegisterDefinitions(i.Definitions)
require.Nil(t, err)
break
}
}
var testCases = []*struct {
name string
boc string
expected string
}{
{
// msg hash IuHB6faRsv3skEVD7B7XAyW8QDSoJQggNDzUL3aEkwE=
name: `tonpay_edit_invoice`,
boc: `te6cckECFQEAA5wABGtIxQTzAAAAAAAAAAAAAAAAstBeADgALInABpaveTnQLzJRypMpb8yBctLJ3x+XSBR8UR1oVV0EAgEDAAgAAAAAACIAAAAAMTY4NDE0NDc0MjU4NgEU/wD0pBP0vPLICwUAQ4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABACAWIHBgAboPYF2omh9AH0gfSBqGECAswSCAIBIAoJAIPUAQa5D2omh9AH0gfSBqGAJpj8EIC8aijKkQXUEIPe7L7wndCVj5cWLpn5j9ABgJ0CgR5CgCfQEsZ4sA54tmZPaqQCASAQCwIBIA0MANc7UTQ+gD6QPpA1DAH0z/6APpAMFFRoVJJxwXy4sEnwv/y4sIFggkxLQCgFrzy4sOCEHvdl97Iyx8Vyz9QA/oCIs8WAc8WyXGAGMjLBSTPFnD6AstqzMmAQPsAQBPIUAT6AljPFgHPFszJ7VSAC9ztRND6APpA+kDUMAjTP/oAUVGgBfpA+kBTW8cFVHNtcFQgE1QUA8hQBPoCWM8WAc8WzMkiyMsBEvQA9ADLAMn5AHB0yMsCygfL/8nQUA3HBRyx8uLDCvoAUaihggiYloBmtgihggiYloCgGKEnlxBJEDg3XwTjDSXXCwGAPDgB8wwAjwgCwjiGCENUydttwgBDIywVQCM8WUAT6AhbLahLLHxLLP8ly+wCTNWwh4gPIUAT6AljPFgHPFszJ7VQAcFJ5oBihghBzYtCcyMsfUjDLP1j6AlAHzxZQB88WyXGAEMjLBSTPFlAG+gIVy2oUzMlx+wAQJBAjAfFQPTP/oA+kAh8AHtRND6APpA+kDUMFE2oVIqxwXy4sEowv/y4sJUNEJwVCATVBQDyFAE+gJYzxYBzxbMySLIywES9AD0AMsAySD5AHB0yMsCygfL/8nQBPpA9AQx+gAg10nCAPLixHeAGMjLBVAIzxZw+gIXy2sTzIEQCeghAXjUUZyMsfGcs/UAf6AiLPFlAGzxYl+gJQA88WyVAFzCORcpFx4lAIqBOgggnJw4CgFLzy4sUEyYBA+wAQI8hQBPoCWM8WAc8WzMntVAIB1BQTABE+kQwcLry4U2AAwwgxwCSXwTgAdDTAwFxsJUTXwPwDOD6QPpAMfoAMXHXIfoAMfoAMHOptAAC0x+CEA+KfqVSILqVMTRZ8AngghAXjUUZUiC6ljFERAPwCuA1ghBZXwe8upNZ8AvgXwSED/LwgIzNCsg==`,
expected: `{"has_customer":0,"customer":"NONE","invoice_id":"\ufffd\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","metadata":"\u0000\u0000\u0000\u00001684144742586","amount":0,"accepts_jetton":0,"jetton_master_address":"NONE","jetton_wallet_code":"te6cckEBAQEABgAACAAAAADjAK8P"}`,
},
}
for _, test := range testCases {
j := loadOperation(t, i, test.name, test.boc)
require.Equal(t, test.expected, j)
}
}
func TestGetMethodDesc_TonpayInvoice(t *testing.T) {
var (
interfaces []*abi.InterfaceDesc
i *abi.InterfaceDesc
)
j, err := os.ReadFile("tonpay.json")
require.Nil(t, err)
err = json.Unmarshal(j, &interfaces)
require.Nil(t, err)
for _, i = range interfaces {
if i.Name == "tonpay_invoice" {
err := abi.RegisterDefinitions(i.Definitions)
require.Nil(t, err)
break
}
}
var testCases = []*struct {
name string
addr *address.Address
code string
data string
expected []any
}{
{
name: "get_invoice_data",
addr: addr.MustFromBase64("EQDGl_FudWD0b3Mp3X32GqxO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BRUaFSSccF8uLBJ8L/8uLCBYIJMS0AoBa88uLDghB73ZfeyMsfFcs/UAP6AiLPFgHPFslxgBjIywUkzxZw+gLLaszJgED7AEATyFAE+gJYzxYBzxbMye1UgAHBSeaAYoYIQc2LQnMjLH1Iwyz9Y+gJQB88WUAfPFslxgBDIywUkzxZQBvoCFctqFMzJcfsAECQQIwB8wwAjwgCwjiGCENUydttwgBDIywVQCM8WUAT6AhbLahLLHxLLP8ly+wCTNWwh4gPIUAT6AljPFgHPFszJ7VTD8jQS`,
expected: []any{
address.MustParseAddr("EQBHsHYE8p3iCrPva2XFmn0ZCwsV2BNS-GS5FmZ42ozMXW2x"),
address.MustParseAddr("EQBVQSJ0QRf0QU8CyjRvwjJOKrObUCPCE2VkbVPRfyCaV1NY"),
address.MustParseAddr("EQD2wz8Rq5QDj9iK2Z_leGQu-Rup__y-Z4wo8Lm7-tSD6Iz2"),
int8(-1),
address.MustParseAddr("EQBVQSJ0QRf0QU8CyjRvwjJOKrObUCPCE2VkbVPRfyCaV1NY"),
"\u0000\u0000\u0000\u0000asdtest",
"\u0000\u0000\u0000\u0000",
uint64(1000000000),
int8(-1),
int8(-1),
int8(-1),
address.MustParseAddr("EQAWROADS1e8nOgXmSjlSZS35kC5aWTvj8ukCj4ojrQqrr_a"),
&cell.Cell{},
uint64(10),
},
},
}
for _, test := range testCases {
ret := execGetMethod(t, i, test.addr, test.name, test.code, test.data)
for it := range ret {
if reflect.TypeOf(test.expected[it]) == reflect.TypeOf(&cell.Cell{}) {
continue
}
require.Equal(t, test.expected[it], ret[it])
}
}
}