From 3b9c2265072e0de2e14edb78289fa9d1432b0abb Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Wed, 26 Oct 2022 17:12:02 +0100 Subject: [PATCH] Test that should pass when the problem is solved --- itests/remove_verifreg_datacap_test.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/itests/remove_verifreg_datacap_test.go b/itests/remove_verifreg_datacap_test.go index 2ce995d55..add3ab8b3 100644 --- a/itests/remove_verifreg_datacap_test.go +++ b/itests/remove_verifreg_datacap_test.go @@ -162,6 +162,8 @@ func TestNoRemoveDatacapFromVerifreg(t *testing.T) { require.NoError(t, err) require.Equal(t, *dc, datacapToAssign) + // END OF VERIFIED CLIENT BOILERPLATE + label, err := markettypes.NewLabelFromString("") require.NoError(t, err) @@ -220,8 +222,6 @@ func TestNoRemoveDatacapFromVerifreg(t *testing.T) { dealIds, err := ret.DealIDs() require.NoError(t, err) - // END OF VERIFIED CLIENT BOILERPLATE - verifiedClientDcap, err := clientApi.StateVerifiedClientStatus(ctx, verifiedClientIDAddr, types.EmptyTSK) require.NoError(t, err) @@ -280,15 +280,11 @@ func TestNoRemoveDatacapFromVerifreg(t *testing.T) { Params: params, Value: big.Zero(), }, nil) - require.NoError(t, err) // This should actually fail - - r, err = clientApi.StateWaitMsg(ctx, m.Cid(), 2, api.LookbackNoLimit, true) - require.NoError(t, err) - require.True(t, r.Receipt.ExitCode.IsSuccess()) + require.Error(t, err) verifregDatacapAfter, err := clientApi.StateVerifiedClientStatus(ctx, builtin.VerifiedRegistryActorAddr, types.EmptyTSK) require.NoError(t, err) - require.Nil(t, verifregDatacapAfter) // Verifreg datacap will be removed from datacap actor + require.Equal(t, *verifregDcapBefore, *verifregDatacapAfter) // Verifreg should not have lost datacap minerInfo, err := testClient.StateMinerInfo(ctx, testMiner.ActorAddr, types.EmptyTSK) require.NoError(t, err) @@ -343,4 +339,9 @@ func TestNoRemoveDatacapFromVerifreg(t *testing.T) { r, err = clientApi.StateWaitMsg(ctx, m.Cid(), 2, api.LookbackNoLimit, true) require.NoError(t, err) require.True(t, r.Receipt.ExitCode.IsSuccess()) + + // Deal should be activated + deal, err := clientApi.StateMarketStorageDeal(ctx, dealIds[0], types.EmptyTSK) + require.NoError(t, err) + require.NotEqual(t, -1, deal.State.SectorStartEpoch) }