lotus/itests/kit/state.go
raulk e7aa7cb04f
add a basic FEVM integration test. (#9922)
* add a basic FEVM integration test.

Exercises f4 addresses, placeholder transitions, Ethereum Account.

* remove unused parameter from newEthTxFromFilecoinMessageLookup.

* break when found in newEthTxFromFilecoinMessageLookup.

* fixup test.

* lint and gen.

* move test to itests root package.

Co-authored-by: Shrenuj Bansal <shrenuj.bansal@protocol.ai>
2022-12-21 15:12:07 -05:00

34 lines
934 B
Go

package kit
import (
"context"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-address"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/types"
)
// AssertActorType verifies that the supplied address is an actor of the
// specified type (as per its manifest key).
func (f *TestFullNode) AssertActorType(ctx context.Context, addr address.Address, actorType string) {
// validate that an embryo was created
act, err := f.StateGetActor(ctx, addr, types.EmptyTSK)
require.NoError(f.t, err)
nv, err := f.StateNetworkVersion(ctx, types.EmptyTSK)
require.NoError(f.t, err)
av, err := actorstypes.VersionForNetwork(nv)
require.NoError(f.t, err)
codecid, exists := actors.GetActorCodeID(av, actorType)
require.True(f.t, exists)
// check the code CID
require.Equal(f.t, codecid, act.Code)
}