From 8d162267e81e3c86351829c5d1ee0c53d177d6b6 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Thu, 13 Oct 2022 13:33:22 -0400 Subject: [PATCH] revert change to verifreg util --- chain/actors/builtin/verifreg/util.go | 9 +-------- itests/verifreg_test.go | 7 ++++++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/chain/actors/builtin/verifreg/util.go b/chain/actors/builtin/verifreg/util.go index 3e01709c4..09a7a132c 100644 --- a/chain/actors/builtin/verifreg/util.go +++ b/chain/actors/builtin/verifreg/util.go @@ -28,15 +28,8 @@ func getDataCap(store adt.Store, ver actors.Version, root rootFunc, addr address return false, big.Zero(), xerrors.Errorf("loading verifreg: %w", err) } - var keyedAddr abi.Keyer - if ver <= 8 { - keyedAddr = abi.AddrKey(addr) - } else { - keyedAddr = abi.IdAddrKey(addr) - } - var dcap abi.StoragePower - if found, err := vh.Get(keyedAddr, &dcap); err != nil { + if found, err := vh.Get(abi.AddrKey(addr), &dcap); err != nil { return false, big.Zero(), xerrors.Errorf("looking up addr: %w", err) } else if !found { return false, big.Zero(), nil diff --git a/itests/verifreg_test.go b/itests/verifreg_test.go index cb0faae5b..e942d6c71 100644 --- a/itests/verifreg_test.go +++ b/itests/verifreg_test.go @@ -226,7 +226,8 @@ func TestRemoveDataCap(t *testing.T) { // make the 2 verifiers makeVerifier := func(addr address.Address) error { - params, aerr := actors.SerializeParams(&verifregst.AddVerifierParams{Address: addr, Allowance: big.NewInt(100000000000)}) + allowance := big.NewInt(100000000000) + params, aerr := actors.SerializeParams(&verifregst.AddVerifierParams{Address: addr, Allowance: allowance}) require.NoError(t, aerr) msg := &types.Message{ @@ -245,6 +246,10 @@ func TestRemoveDataCap(t *testing.T) { require.NoError(t, err) require.EqualValues(t, 0, res.Receipt.ExitCode) + verifierAllowance, err := api.StateVerifierStatus(ctx, addr, types.EmptyTSK) + require.NoError(t, err) + require.Equal(t, allowance, *verifierAllowance) + return nil }