bodhi.js
bodhi.js copied to clipboard
improve orphan tx hash calculation
currently we use keccak256([...hexToU8a(blockHash), ...nToU8a(index)]);
, however,@polkadot/api
slightly changed how nToU8a
works, which broke the hash after upgrading to @polkadot/api@9
I think we can just use keccak256(blockHash + index)
which removes dependency for nToU8a
, and the result is still deterministic & unique
a reproduce can be found here
maybe just move out the hash calculation part to bodhi, so it will never change