Rename StateVMCirculatingSupply to StateVMCirculatingSupplyInternal

This commit is contained in:
Aayush Rajasekaran 2020-10-12 16:41:27 -04:00
parent 96e1dfd8d7
commit 83624a8858
7 changed files with 14 additions and 14 deletions

View File

@ -419,9 +419,9 @@ type FullNode interface {
// StateCirculatingSupply returns the exact circulating supply of Filecoin at the given tipset. // 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. // This is not used anywhere in the protocol itself, and is only for external consumption.
StateCirculatingSupply(context.Context, types.TipSetKey) (abi.TokenAmount, error) 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. // 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 returns the network version at the given tipset
StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error) StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error)

View File

@ -211,7 +211,7 @@ type FullNodeStruct struct {
StateVerifiedRegistryRootKey func(ctx context.Context, tsk types.TipSetKey) (address.Address, error) `perm:"read"` 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"` 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"` 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"` StateNetworkVersion func(context.Context, types.TipSetKey) (stnetwork.Version, error) `perm:"read"`
MsigGetAvailableBalance func(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) `perm:"read"` MsigGetAvailableBalance func(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) `perm:"read"`
@ -968,8 +968,8 @@ func (c *FullNodeStruct) StateCirculatingSupply(ctx context.Context, tsk types.T
return c.Internal.StateCirculatingSupply(ctx, tsk) return c.Internal.StateCirculatingSupply(ctx, tsk)
} }
func (c *FullNodeStruct) StateVMCirculatingSupply(ctx context.Context, tsk types.TipSetKey) (api.CirculatingSupply, error) { func (c *FullNodeStruct) StateVMCirculatingSupplyInternal(ctx context.Context, tsk types.TipSetKey) (api.CirculatingSupply, error) {
return c.Internal.StateVMCirculatingSupply(ctx, tsk) return c.Internal.StateVMCirculatingSupplyInternal(ctx, tsk)
} }
func (c *FullNodeStruct) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (stnetwork.Version, error) { func (c *FullNodeStruct) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (stnetwork.Version, error) {

View File

@ -1711,7 +1711,7 @@ var stateCircSupplyCmd = &cli.Command{
} }
if cctx.IsSet("vm-supply") { if cctx.IsSet("vm-supply") {
circ, err := api.StateVMCirculatingSupply(ctx, ts.Key()) circ, err := api.StateVMCirculatingSupplyInternal(ctx, ts.Key())
if err != nil { if err != nil {
return err return err
} }

View File

@ -316,7 +316,7 @@ limit 1
} }
func (s *Syncer) storeCirculatingSupply(ctx context.Context, tipset *types.TipSet) error { 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 { if err != nil {
return err return err
} }

View File

@ -135,7 +135,7 @@ func doExtract(ctx context.Context, fapi api.FullNode, opts extractOpts) error {
} }
// get the circulating supply before the message was executed. // 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 { if err != nil {
return fmt.Errorf("failed while fetching circulating supply: %w", err) return fmt.Errorf("failed while fetching circulating supply: %w", err)
} }

View File

@ -165,7 +165,7 @@
* [StateSectorGetInfo](#StateSectorGetInfo) * [StateSectorGetInfo](#StateSectorGetInfo)
* [StateSectorPartition](#StateSectorPartition) * [StateSectorPartition](#StateSectorPartition)
* [StateSectorPreCommitInfo](#StateSectorPreCommitInfo) * [StateSectorPreCommitInfo](#StateSectorPreCommitInfo)
* [StateVMCirculatingSupply](#StateVMCirculatingSupply) * [StateVMCirculatingSupplyInternal](#StateVMCirculatingSupplyInternal)
* [StateVerifiedClientStatus](#StateVerifiedClientStatus) * [StateVerifiedClientStatus](#StateVerifiedClientStatus)
* [StateVerifiedRegistryRootKey](#StateVerifiedRegistryRootKey) * [StateVerifiedRegistryRootKey](#StateVerifiedRegistryRootKey)
* [StateVerifierStatus](#StateVerifierStatus) * [StateVerifierStatus](#StateVerifierStatus)
@ -4258,8 +4258,8 @@ Response:
} }
``` ```
### StateVMCirculatingSupply ### StateVMCirculatingSupplyInternal
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. This is the value reported by the runtime interface to actors code.

View File

@ -1049,7 +1049,7 @@ func (a *StateAPI) StateMinerInitialPledgeCollateral(ctx context.Context, maddr
return types.EmptyInt, xerrors.Errorf("loading reward actor state: %w", err) 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 { if err != nil {
return big.Zero(), xerrors.Errorf("getting circulating supply: %w", err) return big.Zero(), xerrors.Errorf("getting circulating supply: %w", err)
} }
@ -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) 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 { if err != nil {
return api.DealCollateralBounds{}, xerrors.Errorf("getting total circulating supply: %w", err) return api.DealCollateralBounds{}, xerrors.Errorf("getting total circulating supply: %w", err)
} }
@ -1244,7 +1244,7 @@ func (a *StateAPI) StateCirculatingSupply(ctx context.Context, tsk types.TipSetK
return a.StateManager.GetCirculatingSupply(ctx, ts.Height(), sTree) 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) ts, err := a.Chain.GetTipSetFromKey(tsk)
if err != nil { if err != nil {
return api.CirculatingSupply{}, xerrors.Errorf("loading tipset %s: %w", tsk, err) return api.CirculatingSupply{}, xerrors.Errorf("loading tipset %s: %w", tsk, err)