Skip to content

Commit

Permalink
chore: update gov params to include expedited fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasRalee committed Dec 23, 2024
1 parent 47ba17b commit 9befe07
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,26 @@ export class ChainGrpcGovTransformer {

return {
depositParams: {
minDepositList: params?.minDeposit || [],
minDeposit: params?.minDeposit || [],
expeditedMinDeposit: params?.expeditedMinDeposit || [],
maxDepositPeriod: parseInt(
params?.maxDepositPeriod?.seconds || '0',
10,
),
},
votingParams: {
votingPeriod: parseInt(params?.votingPeriod?.seconds || '0'),
expeditedVotingPeriod: parseInt(
params?.expeditedVotingPeriod?.seconds || '0',
),
},
tallyParams: {
quorum: uint8ArrayToString(params?.quorum || '0'),
threshold: uint8ArrayToString(params?.threshold || '0'),
vetoThreshold: uint8ArrayToString(params?.vetoThreshold || '0'),
expeditedThreshold: uint8ArrayToString(
params?.expeditedThreshold || '0',
),
},
}
}
Expand All @@ -56,19 +63,24 @@ export class ChainGrpcGovTransformer {
}): GovModuleStateParams {
return {
depositParams: {
minDepositList: depositParams?.minDeposit,
minDeposit: depositParams?.minDeposit,
expeditedMinDeposit: depositParams?.expeditedMinDeposit,
maxDepositPeriod: parseInt(
depositParams?.maxDepositPeriod?.seconds || '0',
10,
),
},
votingParams: {
votingPeriod: parseInt(votingParams.votingPeriod?.seconds || '0'),
expeditedVotingPeriod: parseInt(
votingParams.expeditedVotingPeriod?.seconds || '0',
),
},
tallyParams: {
quorum: uint8ArrayToString(tallyParams.quorum),
threshold: uint8ArrayToString(tallyParams.threshold),
vetoThreshold: uint8ArrayToString(tallyParams.vetoThreshold),
expeditedThreshold: uint8ArrayToString(tallyParams.expeditedThreshold),
},
}
}
Expand Down
11 changes: 7 additions & 4 deletions packages/sdk-ts/src/client/chain/types/gov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ import { Coin } from '@injectivelabs/ts-types'
export interface GovModuleStateParams {
votingParams: {
votingPeriod: number
expeditedVotingPeriod: number
}
tallyParams: {
quorum: string
threshold: string
vetoThreshold: string
expeditedThreshold: string
}
depositParams: {
minDepositList: Coin[]
minDeposit: Coin[]
maxDepositPeriod: number
expeditedMinDeposit: Coin[]
}
}

Expand Down Expand Up @@ -60,9 +63,9 @@ export type ProposalDeposit = {

export type GrpcProposal = CosmosGovV1Gov.Proposal
export type GrpcProposalDeposit = CosmosGovV1Gov.Deposit
export type GrpcGovernanceTallyParams = CosmosGovV1Gov.TallyParams
export type GrpcGovernanceVotingParams = CosmosGovV1Gov.VotingParams
export type GrpcGovernanceDepositParams = CosmosGovV1Gov.DepositParams
export type GrpcGovernanceTallyParams = CosmosGovV1Gov.Params
export type GrpcGovernanceVotingParams = CosmosGovV1Gov.Params
export type GrpcGovernanceDepositParams = CosmosGovV1Gov.Params
export type GrpcTallyResult = CosmosGovV1Gov.TallyResult
export type GrpcVote = CosmosGovV1Gov.Vote

Expand Down

0 comments on commit 9befe07

Please sign in to comment.