Skip to content

Commit

Permalink
Rename StateVMCirculatingSupply to StateVMCirculatingSupplyInternal
Browse files Browse the repository at this point in the history
  • Loading branch information
arajasek committed Oct 12, 2020
1 parent 96e1dfd commit 83624a8
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions api/api_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,9 @@ type FullNode interface {
// StateCirculatingSupply returns the exact circulating supply of Filecoin at the given tipset.
// This is not used anywhere in the protocol itself, and is only for external consumption.
StateCirculatingSupply(context.Context, types.TipSetKey) (abi.TokenAmount, error)
// StateVMCirculatingSupply returns an approximation of the circulating supply of Filecoin at the given tipset.
// StateVMCirculatingSupplyInternal returns an approximation of the circulating supply of Filecoin at the given tipset.
// This is the value reported by the runtime interface to actors code.
StateVMCirculatingSupply(context.Context, types.TipSetKey) (CirculatingSupply, error)
StateVMCirculatingSupplyInternal(context.Context, types.TipSetKey) (CirculatingSupply, error)
// StateNetworkVersion returns the network version at the given tipset
StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error)

Expand Down
6 changes: 3 additions & 3 deletions api/apistruct/struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ type FullNodeStruct struct {
StateVerifiedRegistryRootKey func(ctx context.Context, tsk types.TipSetKey) (address.Address, error) `perm:"read"`
StateDealProviderCollateralBounds func(context.Context, abi.PaddedPieceSize, bool, types.TipSetKey) (api.DealCollateralBounds, error) `perm:"read"`
StateCirculatingSupply func(context.Context, types.TipSetKey) (abi.TokenAmount, error) `perm:"read"`
StateVMCirculatingSupply func(context.Context, types.TipSetKey) (api.CirculatingSupply, error) `perm:"read"`
StateVMCirculatingSupplyInternal func(context.Context, types.TipSetKey) (api.CirculatingSupply, error) `perm:"read"`
StateNetworkVersion func(context.Context, types.TipSetKey) (stnetwork.Version, error) `perm:"read"`

MsigGetAvailableBalance func(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) `perm:"read"`
Expand Down Expand Up @@ -968,8 +968,8 @@ func (c *FullNodeStruct) StateCirculatingSupply(ctx context.Context, tsk types.T
return c.Internal.StateCirculatingSupply(ctx, tsk)
}

func (c *FullNodeStruct) StateVMCirculatingSupply(ctx context.Context, tsk types.TipSetKey) (api.CirculatingSupply, error) {
return c.Internal.StateVMCirculatingSupply(ctx, tsk)
func (c *FullNodeStruct) StateVMCirculatingSupplyInternal(ctx context.Context, tsk types.TipSetKey) (api.CirculatingSupply, error) {
return c.Internal.StateVMCirculatingSupplyInternal(ctx, tsk)
}

func (c *FullNodeStruct) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (stnetwork.Version, error) {
Expand Down
2 changes: 1 addition & 1 deletion cli/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ var stateCircSupplyCmd = &cli.Command{
}

if cctx.IsSet("vm-supply") {
circ, err := api.StateVMCirculatingSupply(ctx, ts.Key())
circ, err := api.StateVMCirculatingSupplyInternal(ctx, ts.Key())
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-chainwatch/syncer/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ limit 1
}

func (s *Syncer) storeCirculatingSupply(ctx context.Context, tipset *types.TipSet) error {
supply, err := s.node.StateVMCirculatingSupply(ctx, tipset.Key())
supply, err := s.node.StateVMCirculatingSupplyInternal(ctx, tipset.Key())
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/tvx/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func doExtract(ctx context.Context, fapi api.FullNode, opts extractOpts) error {
}

// get the circulating supply before the message was executed.
circSupplyDetail, err := fapi.StateVMCirculatingSupply(ctx, incTs.Key())
circSupplyDetail, err := fapi.StateVMCirculatingSupplyInternal(ctx, incTs.Key())
if err != nil {
return fmt.Errorf("failed while fetching circulating supply: %w", err)
}
Expand Down
6 changes: 3 additions & 3 deletions documentation/en/api-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
* [StateSectorGetInfo](#StateSectorGetInfo)
* [StateSectorPartition](#StateSectorPartition)
* [StateSectorPreCommitInfo](#StateSectorPreCommitInfo)
* [StateVMCirculatingSupply](#StateVMCirculatingSupply)
* [StateVMCirculatingSupplyInternal](#StateVMCirculatingSupplyInternal)
* [StateVerifiedClientStatus](#StateVerifiedClientStatus)
* [StateVerifiedRegistryRootKey](#StateVerifiedRegistryRootKey)
* [StateVerifierStatus](#StateVerifierStatus)
Expand Down Expand Up @@ -4258,8 +4258,8 @@ Response:
}
```

### StateVMCirculatingSupply
StateVMCirculatingSupply returns an approximation of the circulating supply of Filecoin at the given tipset.
### StateVMCirculatingSupplyInternal
StateVMCirculatingSupplyInternal returns an approximation of the circulating supply of Filecoin at the given tipset.
This is the value reported by the runtime interface to actors code.


Expand Down
6 changes: 3 additions & 3 deletions node/impl/full/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ func (a *StateAPI) StateMinerInitialPledgeCollateral(ctx context.Context, maddr
return types.EmptyInt, xerrors.Errorf("loading reward actor state: %w", err)
}

circSupply, err := a.StateVMCirculatingSupply(ctx, ts.Key())
circSupply, err := a.StateVMCirculatingSupplyInternal(ctx, ts.Key())
if err != nil {
return big.Zero(), xerrors.Errorf("getting circulating supply: %w", err)
}
Expand Down Expand Up @@ -1203,7 +1203,7 @@ func (a *StateAPI) StateDealProviderCollateralBounds(ctx context.Context, size a
return api.DealCollateralBounds{}, xerrors.Errorf("failed to load reward actor state: %w", err)
}

circ, err := a.StateVMCirculatingSupply(ctx, ts.Key())
circ, err := a.StateVMCirculatingSupplyInternal(ctx, ts.Key())
if err != nil {
return api.DealCollateralBounds{}, xerrors.Errorf("getting total circulating supply: %w", err)
}
Expand Down Expand Up @@ -1244,7 +1244,7 @@ func (a *StateAPI) StateCirculatingSupply(ctx context.Context, tsk types.TipSetK
return a.StateManager.GetCirculatingSupply(ctx, ts.Height(), sTree)
}

func (a *StateAPI) StateVMCirculatingSupply(ctx context.Context, tsk types.TipSetKey) (api.CirculatingSupply, error) {
func (a *StateAPI) StateVMCirculatingSupplyInternal(ctx context.Context, tsk types.TipSetKey) (api.CirculatingSupply, error) {
ts, err := a.Chain.GetTipSetFromKey(tsk)
if err != nil {
return api.CirculatingSupply{}, xerrors.Errorf("loading tipset %s: %w", tsk, err)
Expand Down

0 comments on commit 83624a8

Please sign in to comment.