Skip to content

Commit

Permalink
Test: EthAccount abstraction: Nonce is updated correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
arajasek committed Dec 20, 2022
1 parent d55100b commit de62a7d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions itests/eth_account_abstraction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func TestEthAccountAbstraction(t *testing.T) {
embryoActor, err := client.StateGetActor(ctx, embryoAddress, types.EmptyTSK)
require.NoError(t, err)

require.Equal(t, uint64(0), embryoActor.Nonce)
require.True(t, builtin.IsEmbryoActor(embryoActor.Code))

// send a message from the embryo address
Expand Down Expand Up @@ -90,12 +91,14 @@ func TestEthAccountAbstraction(t *testing.T) {

require.False(t, builtin.IsEmbryoActor(eoaActor.Code))
require.True(t, builtin.IsEthAccountActor(eoaActor.Code))
require.Equal(t, uint64(1), eoaActor.Nonce)

// Send another message, it should succeed without any code CID changes

msgFromEmbryo = &types.Message{
From: embryoAddress,
To: embryoAddress,
From: embryoAddress,
To: embryoAddress,
Nonce: 1,
}

msgFromEmbryo, err = client.GasEstimateMessageGas(ctx, msgFromEmbryo, nil, types.EmptyTSK)
Expand All @@ -121,6 +124,7 @@ func TestEthAccountAbstraction(t *testing.T) {

eoaActor, err = client.StateGetActor(ctx, embryoAddress, types.EmptyTSK)
require.NoError(t, err)
require.Equal(t, uint64(2), eoaActor.Nonce)

require.False(t, builtin.IsEmbryoActor(eoaActor.Code))
require.True(t, builtin.IsEthAccountActor(eoaActor.Code))
Expand Down

0 comments on commit de62a7d

Please sign in to comment.