Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Added governance KIP-71 fields #678

Merged
merged 3 commits into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 11 additions & 0 deletions test/packages/caver.rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,10 @@ describe('caver.rpc.governance', () => {
expect(payload.params.length).to.equal(caver.rpc.governance.getChainConfig.method.params)
const ret = {
chainId: 1001,
istanbulCompatibleBlock: 0,
londonCompatibleBlock: 0,
ethTxTypeCompatibleBlock: 0,
kip71CompatibleBlock: 1,
deriveShaImpl: 2,
governance: {
governanceMode: 'ballot',
Expand All @@ -862,6 +866,13 @@ describe('caver.rpc.governance', () => {
stakingUpdateInterval: 20,
useGiniCoeff: false,
},
kip71: {
lowerboundbasefee: 25000000000,
upperboundbasefee: 750000000000,
gastarget: 30000000,
maxblockgasusedforbasefee: 60000000,
basefeedenominator: 20,
},
},
istanbul: { epoch: 20, policy: 2, sub: 1 },
unitPrice: 25000000000,
Expand Down
23 changes: 22 additions & 1 deletion types/packages/caver-rpc/src/governance.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export interface Vote {

export interface ChainConfig {
chainId: number
istanbulCompatibleBlock?: number
londonCompatibleBlock?: number
ethTxTypeCompatibleBlock?: number
kip71CompatibleBlock?: number
deriveShaImpl: number
governance: {
governanceMode: string
Expand All @@ -54,6 +58,13 @@ export interface ChainConfig {
stakingUpdateInterval: number
useGiniCoeff: boolean
}
kip71?: {
lowerboundbasefee: number
upperboundbasefee: number
gastarget: number
maxblockgasusedforbasefee: number
basefeedenominator: number
}
}
istanbul: {
epoch: number
Expand All @@ -77,6 +88,11 @@ export interface GovernanceItems {
'reward.ratio': string
'reward.stakingupdateinterval': number
'reward.useginicoeff': boolean
'kip71.lowerboundbasefee'?: number
'kip71.upperboundbasefee'?: number
'kip71.gastarget'?: number
'kip71.maxblockgasusedforbasefee'?: number
'kip71.basefeedenominator'?: number
}

export interface VoteItems {
Expand All @@ -95,6 +111,11 @@ export interface VoteItems {
'reward.minimumstake'?: string
'reward.proposerupdateinterval'?: number
'reward.stakingupdateinterval'?: number
'kip71.lowerboundbasefee'?: number
'kip71.upperboundbasefee'?: number
'kip71.gastarget'?: number
'kip71.maxblockgasusedforbasefee'?: number
'kip71.basefeedenominator'?: number
}

export interface StakingInformation {
Expand All @@ -105,7 +126,7 @@ export interface StakingInformation {
CouncilStakingAmounts: number[]
Gini: number
KIRAddr: string
PoCAddr: string
PoCAddr: string // PoC is the previous name of KGF.
UseGini: boolean
}

Expand Down