Hi there! I'm trying to send a transaction using js ton library, but the transaction isn't going through. Manually trying to send the boc via tonapi.io resulted in the following error. What does "failed to unpack account state" mean? / Is there some documentation available with an explanation of each error message, so I don't have to bother you guys every time? Thank you!
Jan 21, 2023, 1:33 PM
What are you sending and where to? Are you able to share the code? Thanks
Jan 21, 2023, 1:34 PM
I'm sending 0.1 TON between two V4 wallets. The source wallet has a balance of ~0.8 TON. This is on testnet. Will share the code, one sec
This is the gist of it. I ensure that seqno is correctly assigned and never reused. `withdrawal.amountCoins = 100_000_000`. Have been able to send many withdrawals before, only ran into this after a small refactor, but nothing really changed in the withdrawal code.
I can also share the boc, if that helps
Here is a bit more context on how withdrawals are sent out
Jan 21, 2023, 1:50 PM
Is the old version working?
Jan 21, 2023, 1:52 PM
Just tried reverting and yes, it does work. I'll look through the diff and see if I can spot anything. Still interested to know what the error implies tho
I can't find any obvious changes which could've affected sending of withdrawals. The only changes were 1) the `sendWithdrawal()` function was moved into a separate class (it's identical as before), and 2) initialization code in `onApplicationBootstrap()` was moved into the new class as well, only the last line was changed (`this.onBootstrapListeners.forEach((v) => v());` - previously was `this.runCronJobs = true;`).
Code in the screenshots is the only code which could have affected this. The withdrawal database record was created by the broken code, so was the seqno. After reverting to the working code, the same database record was sent out successfully - same seqno and all. Private key is also the same - initialization code stayed the same (only moved to a new class) and so did the mnemonic in the config.
I'm also 100% using testnet - that's configured in the .env file which didn't change during the refactor.
Code in the screenshots is the only code which could have affected this. The withdrawal database record was created by the broken code, so was the seqno. After reverting to the working code, the same database record was sent out successfully - same seqno and all. Private key is also the same - initialization code stayed the same (only moved to a new class) and so did the mnemonic in the config.
I'm also 100% using testnet - that's configured in the .env file which didn't change during the refactor.
Jan 21, 2023, 2:25 PM
It’s redo fixes again from scratch (based on previous working version) :))
Jan 21, 2023, 2:26 PM
Same code in the working version 🤔
Yeah, I guess so. What about the error message tho? What does it imply? That might help me look for the issue in the right place
Jan 21, 2023, 2:30 PM
Try reverting the changes and apply them again bit by bit checking the results. The "binary search" strategy is a good one for such things.
Jan 21, 2023, 2:34 PM