hermez-node/eth/rollup_test.go
eth/rollup_test.goRaw
1package eth
2
3import (
4 "testing"
5
6 "github.com/ethereum/go-ethereum/accounts/keystore"
7 "github.com/ethereum/go-ethereum/crypto"
8 "github.com/ethereum/go-ethereum/ethclient"
9 "github.com/stretchr/testify/require"
10)
11
12var rollupClient *RollupClient
13
14func TestNewRollupClient(t *testing.T) {
15 key, err := crypto.HexToECDSA(governancePrivateKey)
16 require.Nil(t, err)
17 ks := keystore.NewKeyStore(pathKs, keystore.StandardScryptN, keystore.StandardScryptP)
18 account, err := ks.ImportECDSA(key, password)
19 ks.Unlock(account, password)
20 // Init eth client
21 ethClient, err := ethclient.Dial(ehtClientDialURL)
22 require.Nil(t, err)
23 ethereumClient := NewEthereumClient(ethClient, &account, ks, nil)
24 if integration != "" {
25 rollupClient = NewRollupClient(ethereumClient, HERMEZROLLUP)
26 }
27}
28
29func TestRollupConstants(t *testing.T) {
30 if rollupClient != nil {
31 _, err := rollupClient.RollupConstants()
32 require.Nil(t, err)
33 }
34}