mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 19:36:44 +01:00
update contracts
This commit is contained in:
34
eth/rollup_test.go
Normal file
34
eth/rollup_test.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package eth
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts/keystore"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/ethclient"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
var rollupClient *RollupClient
|
||||
|
||||
func TestNewRollupClient(t *testing.T) {
|
||||
key, err := crypto.HexToECDSA(governancePrivateKey)
|
||||
require.Nil(t, err)
|
||||
ks := keystore.NewKeyStore(pathKs, keystore.StandardScryptN, keystore.StandardScryptP)
|
||||
account, err := ks.ImportECDSA(key, password)
|
||||
ks.Unlock(account, password)
|
||||
// Init eth client
|
||||
ethClient, err := ethclient.Dial(ehtClientDialURL)
|
||||
require.Nil(t, err)
|
||||
ethereumClient := NewEthereumClient(ethClient, &account, ks, nil)
|
||||
if integration != "" {
|
||||
rollupClient = NewRollupClient(ethereumClient, HERMEZROLLUP)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRollupConstants(t *testing.T) {
|
||||
if rollupClient != nil {
|
||||
_, err := rollupClient.RollupConstants()
|
||||
require.Nil(t, err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user