From 08ae1391adbfc6f13880e3c22020e45365c1abbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Wed, 11 Jan 2023 22:56:33 +0000 Subject: [PATCH] address review comments. --- chain/gen/genesis/genesis_eth.go | 2 +- chain/types/actor.go | 2 +- cli/chain.go | 2 -- cli/state.go | 2 +- itests/fevm_test.go | 14 ++------------ 5 files changed, 5 insertions(+), 17 deletions(-) diff --git a/chain/gen/genesis/genesis_eth.go b/chain/gen/genesis/genesis_eth.go index 916981c98..516c68223 100644 --- a/chain/gen/genesis/genesis_eth.go +++ b/chain/gen/genesis/genesis_eth.go @@ -56,7 +56,7 @@ func SetupEAM(_ context.Context, nst *state.StateTree, nv network.Version) error func MakeEthNullAddressActor(av actorstypes.Version, addr address.Address) (*types.Actor, error) { actcid, ok := actors.GetActorCodeID(av, manifest.EthAccountKey) if !ok { - return nil, xerrors.Errorf("failed to get account actor code ID for actors version %d", av) + return nil, xerrors.Errorf("failed to get EthAccount actor code ID for actors version %d", av) } act := &types.Actor{ diff --git a/chain/types/actor.go b/chain/types/actor.go index f3ce6c42d..8ba611617 100644 --- a/chain/types/actor.go +++ b/chain/types/actor.go @@ -26,7 +26,7 @@ type ActorV5 struct { Head cid.Cid Nonce uint64 Balance BigInt - // Deterministic Address: f1, f3, or f4 address. + // Deterministic Address. Address *address.Address } diff --git a/cli/chain.go b/cli/chain.go index 66e894f71..57316d22d 100644 --- a/cli/chain.go +++ b/cli/chain.go @@ -63,8 +63,6 @@ var ChainCmd = &cli.Command{ ChainEncodeCmd, ChainDisputeSetCmd, ChainPruneCmd, - EthDeployCmd, - EthInvokeCmd, }, } diff --git a/cli/state.go b/cli/state.go index 33561221b..9513098d3 100644 --- a/cli/state.go +++ b/cli/state.go @@ -776,7 +776,7 @@ var StateGetActorCmd = &cli.Command{ fmt.Printf("Nonce:\t\t%d\n", a.Nonce) fmt.Printf("Code:\t\t%s (%s)\n", a.Code, strtype) fmt.Printf("Head:\t\t%s\n", a.Head) - fmt.Printf("Deterministic address:\t\t%s\n", a.Address) + fmt.Printf("Delegated address:\t\t%s\n", a.Address) return nil }, diff --git a/itests/fevm_test.go b/itests/fevm_test.go index 3d454c976..02304ee33 100644 --- a/itests/fevm_test.go +++ b/itests/fevm_test.go @@ -12,11 +12,9 @@ import ( cbg "github.com/whyrusleeping/cbor-gen" "github.com/filecoin-project/go-address" - actorstypes "github.com/filecoin-project/go-state-types/actors" builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/go-state-types/manifest" - "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/itests/kit" ) @@ -105,19 +103,11 @@ func TestFEVMETH0(t *testing.T) { eth0id, err := address.NewIDAddress(1001) require.NoError(t, err) + client.AssertActorType(ctx, eth0id, manifest.EthAccountKey) + act, err := client.StateGetActor(ctx, eth0id, types.EmptyTSK) require.NoError(t, err) - nv, err := client.StateNetworkVersion(ctx, types.EmptyTSK) - require.NoError(t, err) - - av, err := actorstypes.VersionForNetwork(nv) - require.NoError(t, err) - - evmCodeCid, ok := actors.GetActorCodeID(av, manifest.EthAccountKey) - require.True(t, ok, "failed to get EVM code id") - require.Equal(t, act.Code, evmCodeCid) - eth0Addr, err := address.NewDelegatedAddress(builtintypes.EthereumAddressManagerActorID, make([]byte, 20)) require.NoError(t, err) require.Equal(t, *act.Address, eth0Addr)