mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
Update AccountCreationAuth & fix auth.HashToSign
- Fix AccountCreationAuth.HashToSign (was using `[]byte("0x...")`, which
uses the bytes of the string. Now uses the bytearray of the compressed
BJJ public key (compatible with js implementation))
- Update AccountCreationAuth to last specification (add to hash
parameters ChainID & HermezAddress)
- Add missing test to AccountCreationAuth
This commit is contained in:
@@ -611,8 +611,10 @@ func TestPurge(t *testing.T) {
|
||||
func TestAuth(t *testing.T) {
|
||||
test.WipeDB(l2DB.DB())
|
||||
const nAuths = 5
|
||||
chainID := uint16(0)
|
||||
hermezContractAddr := ethCommon.HexToAddress("0xc344E203a046Da13b0B4467EB7B3629D0C99F6E6")
|
||||
// Generate authorizations
|
||||
auths := test.GenAuths(nAuths)
|
||||
auths := test.GenAuths(nAuths, chainID, hermezContractAddr)
|
||||
for i := 0; i < len(auths); i++ {
|
||||
// Add to the DB
|
||||
err := l2DB.AddAccountCreationAuth(auths[i])
|
||||
|
||||
Reference in New Issue
Block a user