We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I try to decode a raw tx and then retrive its transaction id or singer, I just got null. After that I found it's caused by rlp decode.
let clauses = [{ to: '0x7567d83b7b8d80addcb281a71d54fc7b3364ffed', value: 0, data: '0x' }] let body = { chainTag: 0x9a, blockRef: '0x0000000000000000', expiration: 32, clauses: clauses, gasPriceCoef: 0, gas: 21000, dependsOn: null, nonce: 12345678 } let tx = new Transaction(body) let signingHash = cry.blake2b256(tx.encode()) tx.signature = cry.secp256k1.sign(signingHash, /* private key here */) let raw = tx.encode() let decoded = Transaction.decode(raw)
Decoded Transactin:
{ "body": { "chainTag": 154, "blockRef": "0x0000000000000000", "expiration": 32, "clauses": [ { "to": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed", "value": "0xNaN", // wrong "data": "0x" } ], "gasPriceCoef": "0xNaN", // wrong "gas": 21000, "dependsOn": null, "nonce": 12345678, "reserved": [] }, "signature": / * sig buffer */ } }
update rlp.ts file:
rlp.ts
#89 const bn = new BigNumber('0x' + buf.toString('hex'))
to:
#89 const bn = new BigNumber(buf.toString('hex'), 16)
The text was updated successfully, but these errors were encountered:
a09b010
No branches or pull requests
Description
When I try to decode a raw tx and then retrive its transaction id or singer, I just got null. After that I found it's caused by rlp decode.
Actual behavior
Decoded Transactin:
Suggestion
update
rlp.ts
file:#89 const bn = new BigNumber('0x' + buf.toString('hex'))
to:
#89 const bn = new BigNumber(buf.toString('hex'), 16)
The text was updated successfully, but these errors were encountered: