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

Commit

Permalink
Merge pull request #678 from jimni1222/governance
Browse files Browse the repository at this point in the history
Added governance KIP-71 fields
  • Loading branch information
jimni1222 authored Jul 12, 2022
2 parents 88c804b + a539118 commit d970fc9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
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

0 comments on commit d970fc9

Please sign in to comment.