diff --git a/itests/kit/control.go b/itests/kit/control.go index 0528c4c8993..98bb2a2adca 100644 --- a/itests/kit/control.go +++ b/itests/kit/control.go @@ -15,10 +15,10 @@ import ( "github.com/filecoin-project/lotus/chain/types" ) -func SetControlAddresses(t *testing.T, client *TestFullNode, w *TestMiner, addrs ...addr.Address) { +func (tm *TestMiner) SetControlAddresses(t *testing.T, addrs ...addr.Address) { ctx := context.TODO() - mi, err := client.StateMinerInfo(ctx, w.ActorAddr, types.EmptyTSK) + mi, err := tm.FullNode.StateMinerInfo(ctx, tm.ActorAddr, types.EmptyTSK) require.NoError(t, err) cwp := &miner2.ChangeWorkerAddressParams{ @@ -29,9 +29,9 @@ func SetControlAddresses(t *testing.T, client *TestFullNode, w *TestMiner, addrs sp, err := actors.SerializeParams(cwp) require.NoError(t, err) - smsg, err := client.MpoolPushMessage(ctx, &types.Message{ + smsg, err := tm.FullNode.MpoolPushMessage(ctx, &types.Message{ From: mi.Owner, - To: w.ActorAddr, + To: tm.ActorAddr, Method: miner.Methods.ChangeWorkerAddress, Value: big.Zero(), @@ -39,5 +39,5 @@ func SetControlAddresses(t *testing.T, client *TestFullNode, w *TestMiner, addrs }, nil) require.NoError(t, err) - WaitMsg(ctx, t, client, smsg.Cid()) + tm.FullNode.WaitMsg(ctx, smsg.Cid()) } diff --git a/itests/kit/funds.go b/itests/kit/funds.go index 100e77183f7..e49c708ea9b 100644 --- a/itests/kit/funds.go +++ b/itests/kit/funds.go @@ -29,12 +29,12 @@ func SendFunds(ctx context.Context, t *testing.T, sender *TestFullNode, recipien sm, err := sender.MpoolPushMessage(ctx, msg, nil) require.NoError(t, err) - WaitMsg(ctx, t, sender, sm.Cid()) + sender.WaitMsg(ctx, sm.Cid()) } -func WaitMsg(ctx context.Context, t *testing.T, node *TestFullNode, msg cid.Cid) { - res, err := node.StateWaitMsg(ctx, msg, 3, api.LookbackNoLimit, true) - require.NoError(t, err) +func (f *TestFullNode) WaitMsg(ctx context.Context, msg cid.Cid) { + res, err := f.StateWaitMsg(ctx, msg, 3, api.LookbackNoLimit, true) + require.NoError(f.t, err) - require.EqualValues(t, 0, res.Receipt.ExitCode, "message did not successfully execute") + require.EqualValues(f.t, 0, res.Receipt.ExitCode, "message did not successfully execute") }