toncenter / pytonlib

Python SDK for TON via tonlib
GNU General Public License v3.0
80 stars 21 forks source link

Wrong result raw_run_method with stack #4

Closed XaBbl4 closed 2 years ago

XaBbl4 commented 2 years ago

OS: Windows TON: Mainnet

Code for repeat:

nft_collection_addr = 'UQDcHiIVfXE6G_fxFmiQ1lloSyfW-tL0JnkUQN7W4vHFuBMp'
data = await client.raw_run_method(nft_collection_addr, 'get_nft_address_by_index', [ ["num", 0] ])

cell_boc = codecs.decode(codecs.encode(data['stack'][0][1]['bytes'], 'utf8'), 'base64')
cell = deserialize_boc(cell_boc)
_, nft_address, _ = deser_addr(cell.data.data)

Current result:

{'gas_used': 4096, 'stack': [['cell', {'bytes': 'te6cckEBAQEAJAAAQ4ARAazkjXsQZdv4YQ5qFu5Wad8E4IVXWYzjzPZ5jribSvB5dK92', 'object': {'data': {'b64': 'gBEBrOSNexBl2/hhDmoW7lZp3wTghVdZjOPM9nmOuJtK4A==', 'len': 267}, 'refs': []}}]], 'exit_code': 0, '@extra': '1651921630.189564:0:0.3482788107200301'}
EQCIDWcka9iDLt_DCHNQt3KzTvgnBCq6zGceZ7PMdcTaV7mQ

Result from toncenter-api or after replace libtonjson with patch:

{'gas_used': 4096, 'stack': [['cell', {'bytes': 'te6cckEBAQEAJAAAQ4AUb4R1+a0Olh3AX6koVR/jm6A+BryCGVmCjqxKJ2RLg7B4DNQQ', 'object': {'data': {'b64': 'gBRvhHX5rQ6WHcBfqShVH+OboD4GvIIZWYKOrEonZEuDoA==', 'len': 267}, 'refs': []}}]], 'exit_code': 0, '@extra': '1651921729.476573:0:0.7025834503130749'}
EQCjfCOvzWh0sO4C_UlCqP8c3QHwNeQQyswUdWJROyJcHTfa