neodix42 / MyLocalTon

Personal local TON blockchain
GNU General Public License v3.0
105 stars 17 forks source link

Wallet error - integer does not fit into cell #7

Closed hbrodin closed 1 year ago

hbrodin commented 1 year ago

If for some reason the lite-client call to get seqno fails a -1 is returned.

https://github.com/neodiX42/MyLocalTon/blob/996edcebc709f263612cb77268004d781ed5b7f6/src/main/java/org/ton/executors/liteclient/LiteClient.java#L83-L89

That -1 is propagated to invocation of the smartcont/wallet.fif contract, e.g.

fift -Ilib:smartcont -s smartcont/wallet.fif /home/user/myLocalTon/genesis/bin/zerostate/main-wallet 0QAlmxoIcjxUmjgMZtCMAXXFvj_-Uf4YHFQnOk6o0WG2H18C -1 778 wallets/a3e843e0-7eaf-4017-acfe-ced6d0bac9b6

which doesn't seem to be able to handle it. When invoked you get the following error message:

Error interpreting file `smartcont/wallet.fif`: wallet.fif:70:  u,:integer does not fit into cell

Please consider not invoking the wallet contract on a negative seqno, or handle the lite-client error explicitly instead of returning -1 to prevent this issue.

neodix42 commented 1 year ago

Thanks for reporting! Fixed with the latest release now.