-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transfer transaction in block 56507 fails to decode #1
Comments
@YordanPavlov I've published v1.3.1 and successfully decode your transaction
Result: {"msg":[{"inputs":[{"address":{"type":"Buffer","data":[86,147,138,160,144,127,165,242,195,200,7,208,193,58,68,34,183,209,89,91]},"coins":[{"denom":"BNB","amount":100000000}]}],"outputs":[{"address":{"type":"Buffer","data":[35,9,89,232,227,178,244,2,51,137,24,25,22,215,80,155,127,47,167,189]},"coins":[{"denom":"BNB","amount":100000000}]}],"msgType":"MsgSend"}],"signatures":[{"pub_key":{"type":"Buffer","data":[235,90,233,135,33,3,59,78,9,210,220,225,54,111,25,81,115,71,192,226,242,229,144,115,236,43,88,40,141,50,215,147,35,229,142,175,17,217]},"signature":{"type":"Buffer","data":[11,40,186,148,177,65,53,201,248,23,45,83,20,168,39,226,156,117,229,58,157,147,23,117,238,161,8,79,17,90,212,233,41,35,150,98,1,248,128,97,132,149,137,225,47,35,16,60,119,33,51,69,247,254,11,245,36,223,43,113,3,190,24,127]},"account_number":24,"sequence":4}],"memo":"signature","source":1,"data":"","msgType":"StdTx"} I've checked the input and output addresses are the same as the record on the dex explorer.
Still not sure why the original algorithm failed, You can start trying the new version and I'll spend some more time digging into this issue |
@antoncoding Do you know how to get transaction hash from your example result above as it seems missing from the result:
And what's the best way to convert from inputs Buffer data Thanks for your very useful lib |
@oom-tesla const bnbPrefixedAddress = txHexDecoder.encodeBnbAddress(data); |
Very appreciated! how about get transaction hash do you know how to get it? |
I didn't include the |
Hi @antoncoding I got this err when using encodeBnbAddress(data) TypeError: Exceeds length limit Any advise? |
Sorry for the late reply. Did you encode the buffer I've recently updated the repository (as a seperate npm library) and will automatically encode all the addresses. Take a look at the new decoder interface here: |
I'm closing this issue since the original problem is fixed and the address encoder is working properly in the new version. |
I have tried to decode the transactions in the first two blocks on the BNB chain. The first non empty block is 52353 which decodes correctly. The second non empty block is 56507, which also contains one Transfer transaction, it fails to decode with error:
throw new Error(
encountered fieldNum: ${fieldNum}, but we have already seen fnum: ${lastFieldNum})
I acquire both transaction hashes using an RPC request like so:
curl https://seed1.4leapbnb.com:443 -d @requestBlock.json
The RPC request looks like so:
I am then interested in this part of the response:
The JS code used to do the decoding looks like this:
The text was updated successfully, but these errors were encountered: