forked from cerc-io/laconicd-deprecated
get account sequence in GetTransactionCount (#303)
* get account sequence if querying latest in GetTransactionCount * use ctx WithHeight in GetTransactionCount; remove nonce query from querier
This commit is contained in:
@@ -637,3 +637,21 @@ func TestBlockBloom_Hash(t *testing.T) {
|
||||
lb := hexToBigInt(t, block["logsBloom"].(string))
|
||||
require.NotEqual(t, big.NewInt(0), lb)
|
||||
}
|
||||
|
||||
func getNonce(t *testing.T) hexutil.Uint64 {
|
||||
from := getAddress(t)
|
||||
param := []interface{}{hexutil.Bytes(from), "latest"}
|
||||
rpcRes := call(t, "eth_getTransactionCount", param)
|
||||
|
||||
var nonce hexutil.Uint64
|
||||
err := json.Unmarshal(rpcRes.Result, &nonce)
|
||||
require.NoError(t, err)
|
||||
return nonce
|
||||
}
|
||||
|
||||
func TestEth_GetTransactionCount(t *testing.T) {
|
||||
prev := getNonce(t)
|
||||
sendTestTransaction(t)
|
||||
post := getNonce(t)
|
||||
require.Equal(t, prev, post-1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user