You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
918 B

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