ton-core / ton

Most popular TON Typescript Library
MIT License
69 stars 56 forks source link

Bug with parsing tuple of cells returned from get-method #31

Open Keshoid opened 8 months ago

Keshoid commented 8 months ago

Line with bug: https://github.com/ton-org/ton/blob/master/src/client/TonClient.ts#L346 Fix: add .bytes to be Cell.fromBase64(s.cell.bytes). I have a getter which looks like this:

[cell, cell] get_foo() method_id {...}

And it always fails with error stack:

TypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Object
    at Function.from (node:buffer:324:9)
    at Function.fromBase64 (/node_modules/@ton/core/dist/boc/Cell.js:41:42)
    at parseStackEntry (/node_modules/@ton/ton/dist/client/TonClient.js:277:54)
    at Array.map (<anonymous>)
    at parseStackItem (/node_modules/@ton/ton/dist/client/TonClient.js:313:34)
    at parseStack (/node_modules/@ton/ton/dist/client/TonClient.js:323:20)
    at TonClient.runMethod (/node_modules/@ton/ton/dist/client/TonClient.js:44:49)