Skip to content

Commit

Permalink
Support RPC GetConsensus HardForkFeatures type as map
Browse files Browse the repository at this point in the history
  • Loading branch information
eval-exec committed Aug 4, 2024
1 parent 4d1627f commit be9a26b
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions types/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,30 +281,32 @@ type ProposalWindow struct {
}

type Consensus struct {
Id string `json:"ID"`
GenesisHash Hash `json:"genesis_hash"`
DaoTypeHash *Hash `json:"dao_type_hash"`
Secp256k1Blake160SighashAllTypeHash *Hash `json:"secp256k1_blake160_sighash_all_type_hash"`
Secp256k1Blake160MultisigAllTypeHash *Hash `json:"secp256k1_blake160_multisig_all_type_hash"`
InitialPrimaryEpochReward uint64 `json:"initial_primary_epoch_reward"`
SecondaryEpochReward uint64 `json:"secondary_epoch_reward"`
MaxUnclesNum uint64 `json:"max_uncles_num"`
OrphanRateTarget RationalU256 `json:"orphan_rate_target"`
EpochDurationTarget uint64 `json:"epoch_duration_target"`
TxProposalWindow ProposalWindow `json:"tx_proposal_window"`
ProposerRewardRatio RationalU256 `json:"proposer_reward_ratio"`
CellbaseMaturity uint64 `json:"cellbase_maturity"`
MedianTimeBlockCount uint64 `json:"median_time_block_count"`
MaxBlockCycles uint64 `json:"max_block_cycles"`
MaxBlockBytes uint64 `json:"max_block_bytes"`
BlockVersion uint32 `json:"block_version"`
TxVersion uint32 `json:"tx_version"`
TypeIdCodeHash Hash `json:"type_id_code_hash"`
MaxBlockProposalsLimit uint64 `json:"max_block_proposals_limit"`
PrimaryEpochRewardHalvingInterval uint64 `json:"primary_epoch_reward_halving_interval"`
PermanentDifficultyInDummy bool `json:"permanent_difficulty_in_dummy"`
HardforkFeatures []*HardForkFeature `json:"hardfork_features"`
}
Id string `json:"ID"`
GenesisHash Hash `json:"genesis_hash"`
DaoTypeHash *Hash `json:"dao_type_hash"`
Secp256k1Blake160SighashAllTypeHash *Hash `json:"secp256k1_blake160_sighash_all_type_hash"`
Secp256k1Blake160MultisigAllTypeHash *Hash `json:"secp256k1_blake160_multisig_all_type_hash"`
InitialPrimaryEpochReward uint64 `json:"initial_primary_epoch_reward"`
SecondaryEpochReward uint64 `json:"secondary_epoch_reward"`
MaxUnclesNum uint64 `json:"max_uncles_num"`
OrphanRateTarget RationalU256 `json:"orphan_rate_target"`
EpochDurationTarget uint64 `json:"epoch_duration_target"`
TxProposalWindow ProposalWindow `json:"tx_proposal_window"`
ProposerRewardRatio RationalU256 `json:"proposer_reward_ratio"`
CellbaseMaturity uint64 `json:"cellbase_maturity"`
MedianTimeBlockCount uint64 `json:"median_time_block_count"`
MaxBlockCycles uint64 `json:"max_block_cycles"`
MaxBlockBytes uint64 `json:"max_block_bytes"`
BlockVersion uint32 `json:"block_version"`
TxVersion uint32 `json:"tx_version"`
TypeIdCodeHash Hash `json:"type_id_code_hash"`
MaxBlockProposalsLimit uint64 `json:"max_block_proposals_limit"`
PrimaryEpochRewardHalvingInterval uint64 `json:"primary_epoch_reward_halving_interval"`
PermanentDifficultyInDummy bool `json:"permanent_difficulty_in_dummy"`
HardforkFeatures HardForkFeatures `json:"hardfork_features"`
}

type HardForkFeatures map[string]*HardForkFeature

type HardForkFeature struct {
Rfc string `json:"rfc"`
Expand Down

0 comments on commit be9a26b

Please sign in to comment.