Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: api: add StateGetNetworkParmas #4875

Merged
merged 2 commits into from
May 11, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add comment
simlecode committed May 11, 2022
commit ee4fdd8425cee6680e5af2491a42e0dfd7baf038
1 change: 1 addition & 0 deletions app/submodule/chain/chaininfo_api.go
Original file line number Diff line number Diff line change
@@ -607,6 +607,7 @@ func (cia *chainInfoAPI) ChainGetPath(ctx context.Context, from types.TipSetKey,
return path, nil
}

// StateGetNetworkParams returns current network params
func (cia *chainInfoAPI) StateGetNetworkParams(ctx context.Context) (*types.NetworkParams, error) {
networkName, err := cia.getNetworkName(ctx)
if err != nil {
3 changes: 2 additions & 1 deletion venus-shared/api/chain/v0/chain.go
Original file line number Diff line number Diff line change
@@ -74,7 +74,8 @@ type IChainInfo interface {
VerifyEntry(parent, child *types.BeaconEntry, height abi.ChainEpoch) bool //perm:read
ChainExport(context.Context, abi.ChainEpoch, bool, types.TipSetKey) (<-chan []byte, error) //perm:read
ChainGetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*types.HeadChange, error) //perm:read
StateGetNetworkParams(ctx context.Context) (*types.NetworkParams, error) //perm:read
// StateGetNetworkParams return current network params
StateGetNetworkParams(ctx context.Context) (*types.NetworkParams, error) //perm:read
}

type IMinerState interface {
1 change: 1 addition & 0 deletions venus-shared/api/chain/v0/method.md
Original file line number Diff line number Diff line change
@@ -1245,6 +1245,7 @@ Inputs:
Response: `"f01234"`

### StateGetNetworkParams
StateGetNetworkParams return current network params


Perms: read
3 changes: 2 additions & 1 deletion venus-shared/api/chain/v1/chain.go
Original file line number Diff line number Diff line change
@@ -108,7 +108,8 @@ type IChainInfo interface {
VerifyEntry(parent, child *types.BeaconEntry, height abi.ChainEpoch) bool //perm:read
ChainExport(context.Context, abi.ChainEpoch, bool, types.TipSetKey) (<-chan []byte, error) //perm:read
ChainGetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*types.HeadChange, error) //perm:read
StateGetNetworkParams(ctx context.Context) (*types.NetworkParams, error) //perm:read
// StateGetNetworkParams return current network params
StateGetNetworkParams(ctx context.Context) (*types.NetworkParams, error) //perm:read
}

type IMinerState interface {
1 change: 1 addition & 0 deletions venus-shared/api/chain/v1/method.md
Original file line number Diff line number Diff line change
@@ -1277,6 +1277,7 @@ Inputs:
Response: `"f01234"`

### StateGetNetworkParams
StateGetNetworkParams return current network params


Perms: read