Skip to content

Commit ba27970

Browse files
committed
account: add test for ERC721Transfers()
1 parent 6cf657c commit ba27970

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

account_e2e_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
package etherscan
99

1010
import (
11+
"encoding/json"
12+
"fmt"
1113
"math/big"
1214
"testing"
1315
)
@@ -149,3 +151,21 @@ func TestClient_TokenBalance(t *testing.T) {
149151
t.Errorf("api.TokenBalance not working, got balance %s", balance.Int().String())
150152
}
151153
}
154+
155+
func TestClient_ERC721Transfers(t *testing.T) {
156+
const (
157+
wantLen = 351
158+
)
159+
160+
var a, b = 4708442, 9231168
161+
var contract, address = "0x06012c8cf97bead5deae237070f9587f8e7a266d", "0x6975be450864c02b4613023c2152ee0743572325"
162+
txs, err := api.ERC721Transfers(&contract, &address, &a, &b, 1, 500, true)
163+
noError(t, err, "api.ERC721Transfers")
164+
165+
j, _ := json.MarshalIndent(txs, "", " ")
166+
fmt.Printf("%s\n", j)
167+
168+
if len(txs) != wantLen {
169+
t.Errorf("got txs length %v, want %v", len(txs), wantLen)
170+
}
171+
}

0 commit comments

Comments
 (0)