From 83624a8858d1983a28e0cd523c5ec353a5bbdaee Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Mon, 12 Oct 2020 16:41:27 -0400 Subject: [PATCH] Rename StateVMCirculatingSupply to StateVMCirculatingSupplyInternal --- api/api_full.go | 4 ++-- api/apistruct/struct.go | 6 +++--- cli/state.go | 2 +- cmd/lotus-chainwatch/syncer/sync.go | 2 +- cmd/tvx/extract.go | 2 +- documentation/en/api-methods.md | 6 +++--- node/impl/full/state.go | 6 +++--- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/api/api_full.go b/api/api_full.go index b7cdf9524..657e945ca 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -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) diff --git a/api/apistruct/struct.go b/api/apistruct/struct.go index a938653ce..7896d566e 100644 --- a/api/apistruct/struct.go +++ b/api/apistruct/struct.go @@ -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"` @@ -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) { diff --git a/cli/state.go b/cli/state.go index 5acdf940f..1e7e24ddb 100644 --- a/cli/state.go +++ b/cli/state.go @@ -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 } diff --git a/cmd/lotus-chainwatch/syncer/sync.go b/cmd/lotus-chainwatch/syncer/sync.go index d0931a978..37af9cce0 100644 --- a/cmd/lotus-chainwatch/syncer/sync.go +++ b/cmd/lotus-chainwatch/syncer/sync.go @@ -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 } diff --git a/cmd/tvx/extract.go b/cmd/tvx/extract.go index cc4494d0f..4bb391af6 100644 --- a/cmd/tvx/extract.go +++ b/cmd/tvx/extract.go @@ -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) } diff --git a/documentation/en/api-methods.md b/documentation/en/api-methods.md index f5dfcf815..cbec60c10 100644 --- a/documentation/en/api-methods.md +++ b/documentation/en/api-methods.md @@ -165,7 +165,7 @@ * [StateSectorGetInfo](#StateSectorGetInfo) * [StateSectorPartition](#StateSectorPartition) * [StateSectorPreCommitInfo](#StateSectorPreCommitInfo) - * [StateVMCirculatingSupply](#StateVMCirculatingSupply) + * [StateVMCirculatingSupplyInternal](#StateVMCirculatingSupplyInternal) * [StateVerifiedClientStatus](#StateVerifiedClientStatus) * [StateVerifiedRegistryRootKey](#StateVerifiedRegistryRootKey) * [StateVerifierStatus](#StateVerifierStatus) @@ -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. diff --git a/node/impl/full/state.go b/node/impl/full/state.go index 62636e4fa..1c39b59da 100644 --- a/node/impl/full/state.go +++ b/node/impl/full/state.go @@ -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) } @@ -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) } @@ -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)