diff --git a/itests/deals_publish_test.go b/itests/deals_publish_test.go index 296152e34..2fb4f50f9 100644 --- a/itests/deals_publish_test.go +++ b/itests/deals_publish_test.go @@ -58,7 +58,7 @@ func TestPublishDealsBatching(t *testing.T) { _, err = client.WalletImport(ctx, &publisherKey.KeyInfo) require.NoError(t, err) - kit.SetControlAddresses(t, client, miner, publisherKey.Address) + miner.SetControlAddresses(publisherKey.Address) dh := kit.NewDealHarness(t, client, miner) diff --git a/itests/kit/control.go b/itests/kit/control.go index 0528c4c89..73ac39b7a 100644 --- a/itests/kit/control.go +++ b/itests/kit/control.go @@ -2,7 +2,6 @@ package kit import ( "context" - "testing" "github.com/stretchr/testify/require" @@ -15,11 +14,11 @@ import ( "github.com/filecoin-project/lotus/chain/types" ) -func SetControlAddresses(t *testing.T, client *TestFullNode, w *TestMiner, addrs ...addr.Address) { +func (tm *TestMiner) SetControlAddresses(addrs ...addr.Address) { ctx := context.TODO() - mi, err := client.StateMinerInfo(ctx, w.ActorAddr, types.EmptyTSK) - require.NoError(t, err) + mi, err := tm.FullNode.StateMinerInfo(ctx, tm.ActorAddr, types.EmptyTSK) + require.NoError(tm.t, err) cwp := &miner2.ChangeWorkerAddressParams{ NewWorker: mi.Worker, @@ -27,17 +26,17 @@ func SetControlAddresses(t *testing.T, client *TestFullNode, w *TestMiner, addrs } sp, err := actors.SerializeParams(cwp) - require.NoError(t, err) + require.NoError(tm.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(), Params: sp, }, nil) - require.NoError(t, err) + require.NoError(tm.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 100e77183..e49c708ea 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") }