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.

24 lines
690 B

  1. package eth
  2. import (
  3. "os"
  4. "testing"
  5. ethCommon "github.com/ethereum/go-ethereum/common"
  6. "github.com/ethereum/go-ethereum/ethclient"
  7. "github.com/stretchr/testify/assert"
  8. "github.com/stretchr/testify/require"
  9. )
  10. func TestEthERC20(t *testing.T) {
  11. address := ethCommon.HexToAddress("0x44021007485550008e0f9f1f7b506c7d970ad8ce")
  12. ethClient, err := ethclient.Dial(os.Getenv("ETHCLIENT_DIAL_URL"))
  13. require.Nil(t, err)
  14. client := NewEthereumClient(ethClient, accountAux, ks, nil)
  15. consts, err := client.EthERC20Consts(address)
  16. require.Nil(t, err)
  17. assert.Equal(t, "Golem Network Token", consts.Name)
  18. assert.Equal(t, "GNT", consts.Symbol)
  19. assert.Equal(t, uint64(18), consts.Decimals)
  20. }