github.com/lmittmann/w3@v0.20.0/module/eth/balance_test.go (about) 1 package eth_test 2 3 import ( 4 "math/big" 5 "testing" 6 7 "github.com/lmittmann/w3" 8 "github.com/lmittmann/w3/module/eth" 9 "github.com/lmittmann/w3/rpctest" 10 ) 11 12 func TestBalance(t *testing.T) { 13 rpctest.RunTestCases(t, []rpctest.TestCase[*big.Int]{ 14 { 15 Golden: "get_balance", 16 Call: eth.Balance(w3.A("0x000000000000000000000000000000000000c0Fe"), nil), 17 WantRet: w3.I("1 ether"), 18 }, 19 { 20 Golden: "get_balance__at_block", 21 Call: eth.Balance(w3.A("0x000000000000000000000000000000000000c0Fe"), big.NewInt(255)), 22 WantRet: w3.I("0.1 ether"), 23 }, 24 }) 25 }