Skip to content

Commit

Permalink
add datacap balance to circ supply
Browse files Browse the repository at this point in the history
  • Loading branch information
jennijuju committed Aug 6, 2024
1 parent 9707526 commit d68dca6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions chain/actors/builtin/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var SystemActorAddr = builtin.SystemActorAddr
var BurntFundsActorAddr = builtin.BurntFundsActorAddr
var CronActorAddr = builtin.CronActorAddr
var EthereumAddressManagerActorAddr = builtin.EthereumAddressManagerActorAddr
var DatacapActorAddr = builtin.DatacapActorAddr
var SaftAddress = makeAddress("t0122")
var ReserveAddress = makeAddress("t090")
var RootVerifierAddress = makeAddress("t080")
Expand Down Expand Up @@ -276,6 +277,15 @@ func IsPaymentChannelActor(c cid.Cid) bool {
return false
}

func IsDatacapActor(c cid.Cid) bool {
name, _, ok := actors.GetActorMetaByCode(c)
if ok {
return name == manifest.DatacapKey
}

return false
}

func IsPlaceholderActor(c cid.Cid) bool {
name, _, ok := actors.GetActorMetaByCode(c)
if ok {
Expand Down
3 changes: 2 additions & 1 deletion chain/stmgr/supply.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,8 @@ func (sm *StateManager) GetCirculatingSupply(ctx context.Context, height abi.Cha
builtin.IsPaymentChannelActor(actor.Code) ||
builtin.IsEthAccountActor(actor.Code) ||
builtin.IsEvmActor(actor.Code) ||
builtin.IsPlaceholderActor(actor.Code):
builtin.IsPlaceholderActor(actor.Code) ||
builtin.IsDatacapActor(actor.Code):

Check failure on line 447 in chain/stmgr/supply.go

View workflow job for this annotation

GitHub Actions / Check (docs-check)

undefined: builtin.IsDatacapActor

Check failure on line 447 in chain/stmgr/supply.go

View workflow job for this annotation

GitHub Actions / Check (gen-check)

undefined: builtin.IsDatacapActor

circ = big.Add(circ, actor.Balance)

Expand Down

0 comments on commit d68dca6

Please sign in to comment.