From 6394bf7a884d29bff29f922891c85044a4de6c96 Mon Sep 17 00:00:00 2001 From: "Sebastian.Bor" Date: Sat, 24 Apr 2021 13:24:28 +0100 Subject: [PATCH] chore: rename timelockType --- packages/proposals/src/actions/registerProgramGovernance.ts | 2 +- packages/proposals/src/models/governance.ts | 6 +++--- packages/proposals/src/models/initGovernance.ts | 4 ++-- packages/proposals/src/views/governance/index.tsx | 4 ++-- packages/proposals/src/views/governance/register.tsx | 4 ++-- packages/proposals/src/views/proposal/new.tsx | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/proposals/src/actions/registerProgramGovernance.ts b/packages/proposals/src/actions/registerProgramGovernance.ts index dc3d572..828770c 100644 --- a/packages/proposals/src/actions/registerProgramGovernance.ts +++ b/packages/proposals/src/actions/registerProgramGovernance.ts @@ -144,7 +144,7 @@ export const registerProgramGovernance = async ( uninitializedGovernance.voteThreshold!, uninitializedGovernance.executionType || ExecutionType.Independent, - uninitializedGovernance.timelockType || GovernanceType.Governance, + uninitializedGovernance.governanceType || GovernanceType.Governance, uninitializedGovernance.votingEntryRule || VotingEntryRule.Anytime, uninitializedGovernance.minimumSlotWaitingPeriod || new BN(0), uninitializedGovernance.timeLimit || new BN(0), diff --git a/packages/proposals/src/models/governance.ts b/packages/proposals/src/models/governance.ts index 913d46a..246aad7 100644 --- a/packages/proposals/src/models/governance.ts +++ b/packages/proposals/src/models/governance.ts @@ -66,7 +66,7 @@ export interface Governance { /// Execution type executionType: ExecutionType; /// Governance Type - timelockType: GovernanceType; + governanceType: GovernanceType; /// Voting entry rule votingEntryRule: VotingEntryRule; /// Minimum slot time-distance from creation of proposal for an instruction to be placed @@ -99,7 +99,7 @@ export const GovernanceLayout: typeof BufferLayout.Structure = BufferLayout.stru BufferLayout.u8('accountType'), BufferLayout.u8('voteThreshold'), BufferLayout.u8('executionType'), - BufferLayout.u8('timelockType'), + BufferLayout.u8('governanceType'), BufferLayout.u8('votingEntryRule'), Layout.uint64('minimumSlotWaitingPeriod'), Layout.publicKey('governanceMint'), @@ -432,7 +432,7 @@ export const GovernanceParser = ( accountType: data.accountType, voteThreshold: data.voteThreshold, executionType: data.executionType, - timelockType: data.timelockType, + governanceType: data.governanceType, votingEntryRule: data.votingEntryRule, minimumSlotWaitingPeriod: data.minimumSlotWaitingPeriod, governanceMint: data.governanceMint, diff --git a/packages/proposals/src/models/initGovernance.ts b/packages/proposals/src/models/initGovernance.ts index 275d2ea..f6f33d5 100644 --- a/packages/proposals/src/models/initGovernance.ts +++ b/packages/proposals/src/models/initGovernance.ts @@ -33,7 +33,7 @@ export const initGovernanceInstruction = ( BufferLayout.u8('instruction'), BufferLayout.u8('voteThreshold'), BufferLayout.u8('executionType'), - BufferLayout.u8('timelockType'), + BufferLayout.u8('governanceType'), BufferLayout.u8('votingEntryRule'), Layout.uint64('minimumSlotWaitingPeriod'), Layout.uint64('timeLimit'), @@ -52,7 +52,7 @@ export const initGovernanceInstruction = ( instruction: GovernanceInstruction.InitGovernance, voteThreshold, executionType, - timelockType: governanceType, + governanceType, votingEntryRule, minimumSlotWaitingPeriod, timeLimit, diff --git a/packages/proposals/src/views/governance/index.tsx b/packages/proposals/src/views/governance/index.tsx index dcd18a9..7882914 100644 --- a/packages/proposals/src/views/governance/index.tsx +++ b/packages/proposals/src/views/governance/index.tsx @@ -40,8 +40,8 @@ const columns = [ }, { title: LABELS.PROPOSAL_TYPE, - dataIndex: 'timelockType', - key: 'timelockType', + dataIndex: 'governanceType', + key: 'governanceType', render: (number: number) => {GovernanceType[number]}, }, { diff --git a/packages/proposals/src/views/governance/register.tsx b/packages/proposals/src/views/governance/register.tsx index 933ab8d..f7a5eaa 100644 --- a/packages/proposals/src/views/governance/register.tsx +++ b/packages/proposals/src/views/governance/register.tsx @@ -120,7 +120,7 @@ export function NewForm({ } const uninitializedGovernance = { - timelockType: values.governanceType, + governanceType: values.governanceType, executionType: values.executionType, voteThreshold: values.voteThreshold, votingEntryRule: values.votingEntryRule, @@ -215,7 +215,7 @@ export function NewForm({