Skip to content

Commit

Permalink
implement fip-0028
Browse files Browse the repository at this point in the history
  • Loading branch information
hunjixin committed Jan 27, 2022
1 parent 2470cb3 commit b35e297
Show file tree
Hide file tree
Showing 20 changed files with 995 additions and 112 deletions.
4 changes: 2 additions & 2 deletions actors/builtin/init/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestExec(t *testing.T) {
// anne execs a payment channel actor with 100 FIL.
rt.SetCaller(anne, builtin.AccountActorCodeID)

rt.SetBalance(balance)
rt.SetActorBalance(balance)
rt.SetReceived(balance)

// re-org-stable address of the payment channel actor
Expand All @@ -92,7 +92,7 @@ func TestExec(t *testing.T) {

// creating another actor should get a different address, the below logic is a repeat of the above to insure
// the next ID address created is incremented. 100 -> 101
rt.SetBalance(balance)
rt.SetActorBalance(balance)
rt.SetReceived(balance)
uniqueAddr2 := tutil.NewActorAddr(t, "paych2")
rt.SetNewActorAddress(uniqueAddr2)
Expand Down
8 changes: 4 additions & 4 deletions actors/builtin/market/market_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ func TestPublishStorageDeals(t *testing.T) {
expectGetControlAddresses(rt, providerResolved, mAddr.owner, mAddr.worker)
rt.Call(actor.AddBalance, &mAddr.provider)
rt.Verify()
rt.SetBalance(big.Add(rt.Balance(), deal.ProviderCollateral))
rt.SetActorBalance(big.Add(rt.ActorBalance(), deal.ProviderCollateral))
require.EqualValues(t, deal.ProviderCollateral, actor.getEscrowBalance(rt, providerResolved))

// publish deal using the BLS addresses
Expand Down Expand Up @@ -2843,7 +2843,7 @@ func (h *marketActorTestHarness) addProviderFunds(rt *mock.Runtime, amount abi.T

rt.Call(h.AddBalance, &minerAddrs.provider)
rt.Verify()
rt.SetBalance(big.Add(rt.Balance(), amount))
rt.SetActorBalance(big.Add(rt.ActorBalance(), amount))
}

// addParticipantFunds is a helper method to setup non-provider storage market participant funds
Expand All @@ -2854,7 +2854,7 @@ func (h *marketActorTestHarness) addParticipantFunds(rt *mock.Runtime, addr addr

rt.Call(h.AddBalance, &addr)
rt.Verify()
rt.SetBalance(big.Add(rt.Balance(), amount))
rt.SetActorBalance(big.Add(rt.ActorBalance(), amount))
}

func (h *marketActorTestHarness) withdrawProviderBalance(rt *mock.Runtime, withDrawAmt, expectedSend abi.TokenAmount, miner *minerAddrs) {
Expand Down Expand Up @@ -3299,7 +3299,7 @@ func (h *marketActorTestHarness) generateDealWithCollateralAndAddFunds(rt *mock.
func (h *marketActorTestHarness) checkState(rt *mock.Runtime, expectedMessagePatterns ...string) {
var st market.State
rt.GetState(&st)
_, msgs := market.CheckStateInvariants(&st, rt.AdtStore(), rt.Balance(), rt.Epoch())
_, msgs := market.CheckStateInvariants(&st, rt.AdtStore(), rt.ActorBalance(), rt.Epoch())
if len(expectedMessagePatterns) == 0 {
assert.True(h.t, msgs.IsEmpty(), strings.Join(msgs.Messages(), "\n"))
} else {
Expand Down
3 changes: 2 additions & 1 deletion actors/builtin/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ var MethodsMiner = struct {
PreCommitSectorBatch abi.MethodNum
ProveCommitAggregate abi.MethodNum
ProveReplicaUpdates abi.MethodNum
}{MethodConstructor, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27}
ChangeBeneficiaryInfo abi.MethodNum
}{MethodConstructor, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28}

var MethodsVerifiedRegistry = struct {
Constructor abi.MethodNum
Expand Down
Loading

0 comments on commit b35e297

Please sign in to comment.