Update TxID to use eth Keccak256

- Update TxID to use eth Keccak256
- Added more tests to L2Tx TxID calculation to check compatibility with
js version from https://github.com/hermeznetwork/hermezjs/pull/57
This commit is contained in:
arnaucube
2021-02-01 15:24:57 +01:00
parent f0886b3d2a
commit c1cd37913f
8 changed files with 111 additions and 45 deletions

View File

@@ -51,7 +51,7 @@ func TestAccountCreationAuthSignVerify(t *testing.T) {
func TestKeccak256JSComp(t *testing.T) {
// check keccak256 compatible with js version
h := ethCrypto.Keccak256Hash([]byte("test")).Bytes()
h := ethCrypto.Keccak256([]byte("test"))
assert.Equal(t, "9c22ff5f21f0b81b113e63f7db6da94fedef11b2119b4088b89664fb9a3cb658",
hex.EncodeToString(h))
}