rpc: add validatorscount to getversion response

See neo-project/neo-modules#642.
This commit is contained in:
Roman Khimov 2021-09-28 10:10:26 +03:00
parent 0a52c32df3
commit 5a2b77238c
3 changed files with 3 additions and 0 deletions

View file

@ -31,6 +31,7 @@ type (
MaxValidUntilBlockIncrement uint32 `json:"maxvaliduntilblockincrement"`
MaxTransactionsPerBlock uint16 `json:"maxtransactionsperblock"`
MemoryPoolMaxTransactions int `json:"memorypoolmaxtransactions"`
ValidatorsCount byte `json:"validatorscount"`
InitialGasDistribution fixedn.Fixed8 `json:"initialgasdistribution"`
// StateRootInHeader is true if state root is contained in block header.
StateRootInHeader bool `json:"staterootinheader,omitempty"`

View file

@ -536,6 +536,7 @@ func (s *Server) getVersion(_ request.Params) (interface{}, *response.Error) {
MaxValidUntilBlockIncrement: cfg.MaxValidUntilBlockIncrement,
MaxTransactionsPerBlock: cfg.MaxTransactionsPerBlock,
MemoryPoolMaxTransactions: cfg.MemPoolSize,
ValidatorsCount: byte(cfg.ValidatorsCount),
InitialGasDistribution: cfg.InitialGASSupply,
StateRootInHeader: cfg.StateRootInHeader,
},

View file

@ -699,6 +699,7 @@ var rpcTestCases = map[string][]rpcTestCase{
require.EqualValues(t, cfg.MaxValidUntilBlockIncrement, resp.Protocol.MaxValidUntilBlockIncrement)
require.EqualValues(t, cfg.MaxTransactionsPerBlock, resp.Protocol.MaxTransactionsPerBlock)
require.EqualValues(t, cfg.MemPoolSize, resp.Protocol.MemoryPoolMaxTransactions)
require.EqualValues(t, cfg.ValidatorsCount, resp.Protocol.ValidatorsCount)
require.EqualValues(t, cfg.InitialGASSupply, resp.Protocol.InitialGasDistribution)
require.EqualValues(t, false, resp.Protocol.StateRootInHeader)
},