Skip to content

Commit

Permalink
jrpc2: add test for tx.Value
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandotsmith committed Oct 11, 2023
1 parent 05c8b6e commit dae03b9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions jrpc2/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,18 @@ func TestLatest(t *testing.T) {
diff.Test(t, t.Errorf, len(b.Txs), 94)
diff.Test(t, t.Errorf, len(b.Receipts), 94)

tx := blocks[0].Txs[0]
diff.Test(t, t.Errorf, fmt.Sprintf("%.4x", tx.Hash()), "16e19967")
diff.Test(t, t.Errorf, fmt.Sprintf("%.4x", tx.To), "fd14567e")
tx0 := blocks[0].Txs[0]
diff.Test(t, t.Errorf, fmt.Sprintf("%.4x", tx0.Hash()), "16e19967")
diff.Test(t, t.Errorf, fmt.Sprintf("%.4x", tx0.To), "fd14567e")
diff.Test(t, t.Errorf, fmt.Sprintf("%s", tx0.Value.Dec()), "0")

signer, err := tx.Signer()
signer, err := tx0.Signer()
diff.Test(t, t.Errorf, nil, err)
diff.Test(t, t.Errorf, fmt.Sprintf("%.4x", signer), "16d5783a")

tx3 := blocks[0].Txs[3]
diff.Test(t, t.Errorf, fmt.Sprintf("%s", tx3.Value.Dec()), "69970000000000014")

r := blocks[0].Receipts[0]
diff.Test(t, t.Errorf, len(r.Logs), 1)

Expand Down

0 comments on commit dae03b9

Please sign in to comment.