add StateGetNetworkParams api
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper"
|
||||
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
@@ -1438,3 +1439,39 @@ func (a *StateAPI) StateGetRandomnessFromBeacon(ctx context.Context, personaliza
|
||||
return a.StateManager.GetRandomnessFromBeacon(ctx, personalization, randEpoch, entropy, tsk)
|
||||
|
||||
}
|
||||
|
||||
func (a *StateAPI) StateGetNetworkParams(ctx context.Context) (*api.NetworkParams, error) {
|
||||
networkName, err := a.StateNetworkName(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &api.NetworkParams{
|
||||
NetworkName: networkName,
|
||||
BlockDelaySecs: build.BlockDelaySecs,
|
||||
ConsensusMinerMinPower: build.ConsensusMinerMinPower,
|
||||
SupportedProofTypes: build.SupportedProofTypes,
|
||||
PreCommitChallengeDelay: build.PreCommitChallengeDelay,
|
||||
ForkUpgradeParams: api.ForkUpgradeParams{
|
||||
UpgradeSmokeHeight: build.UpgradeSmokeHeight,
|
||||
UpgradeBreezeHeight: build.UpgradeBreezeHeight,
|
||||
UpgradeIgnitionHeight: build.UpgradeIgnitionHeight,
|
||||
UpgradeLiftoffHeight: build.UpgradeLiftoffHeight,
|
||||
UpgradeAssemblyHeight: build.UpgradeAssemblyHeight,
|
||||
UpgradeRefuelHeight: build.UpgradeRefuelHeight,
|
||||
UpgradeTapeHeight: build.UpgradeTapeHeight,
|
||||
UpgradeKumquatHeight: build.UpgradeKumquatHeight,
|
||||
BreezeGasTampingDuration: build.BreezeGasTampingDuration,
|
||||
UpgradeCalicoHeight: build.UpgradeCalicoHeight,
|
||||
UpgradePersianHeight: build.UpgradePersianHeight,
|
||||
UpgradeOrangeHeight: build.UpgradeOrangeHeight,
|
||||
UpgradeClausHeight: build.UpgradeClausHeight,
|
||||
UpgradeTrustHeight: build.UpgradeTrustHeight,
|
||||
UpgradeNorwegianHeight: build.UpgradeNorwegianHeight,
|
||||
UpgradeTurboHeight: build.UpgradeTurboHeight,
|
||||
UpgradeHyperdriveHeight: build.UpgradeHyperdriveHeight,
|
||||
UpgradeChocolateHeight: build.UpgradeChocolateHeight,
|
||||
UpgradeOhSnapHeight: build.UpgradeOhSnapHeight,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user