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:
arnaucube
2020-12-23 18:11:53 +01:00
parent e787651ba3
commit 8615a462ab
11 changed files with 95 additions and 36 deletions

View File

@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert"
)
func getConfigTest() Config {
func getConfigTest(chainID uint16) Config {
var config Config
var rollupPublicConstants common.RollupConstants
@@ -40,6 +40,9 @@ func getConfigTest() Config {
config.AuctionConstants = auctionConstants
config.WDelayerConstants = wdelayerConstants
config.ChainID = chainID
config.HermezAddress = ethCommon.HexToAddress("0xc344E203a046Da13b0B4467EB7B3629D0C99F6E6")
return config
}