From 0487558b0cf70f1768a2b9d8cbe99c81088230d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sojka?= Date: Thu, 22 Aug 2024 16:51:21 +0000 Subject: [PATCH] Polish formatting --- src/contract.cairo | 8 ++++++-- src/proposals.cairo | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/contract.cairo b/src/contract.cairo index 4d07e49d..6719686a 100644 --- a/src/contract.cairo +++ b/src/contract.cairo @@ -191,7 +191,8 @@ mod Governance { proposals.add_custom_proposal_config(send_tokens_custom_proposal_config); - let set_default_proposal_params_custom_proposal_config: CustomProposalConfig = CustomProposalConfig { + let set_default_proposal_params_custom_proposal_config: CustomProposalConfig = + CustomProposalConfig { target: governance_address.into(), selector: selector!("set_default_proposal_params"), library_call: false, @@ -200,7 +201,10 @@ mod Governance { proposals.add_custom_proposal_config(set_default_proposal_params_custom_proposal_config); - proposals.set_default_proposal_params(quorum: 10, proposal_voting_seconds: consteval_int!(60 * 60 * 24 * 7)); // can be omitted to keep the default values + proposals + .set_default_proposal_params( + quorum: 10, proposal_voting_seconds: consteval_int!(60 * 60 * 24 * 7) + ); // can be omitted to keep the default values } #[abi(embed_v0)] diff --git a/src/proposals.cairo b/src/proposals.cairo index 1f43d629..4c5084b4 100644 --- a/src/proposals.cairo +++ b/src/proposals.cairo @@ -35,7 +35,9 @@ trait IProposals { ); fn get_total_delegated_to(self: @TContractState, to_addr: ContractAddress) -> u128; fn add_custom_proposal_config(ref self: TContractState, config: CustomProposalConfig) -> u32; - fn set_default_proposal_params(ref self: TContractState, quorum: u32, proposal_voting_seconds: u32); + fn set_default_proposal_params( + ref self: TContractState, quorum: u32, proposal_voting_seconds: u32 + ); } #[starknet::component] @@ -580,7 +582,9 @@ mod proposals { idx } - fn set_default_proposal_params(ref self: ComponentState, quorum: u32, proposal_voting_seconds: u32) { + fn set_default_proposal_params( + ref self: ComponentState, quorum: u32, proposal_voting_seconds: u32 + ) { assert(get_caller_address() == get_contract_address(), 'can only be called by self'); assert(quorum < 30, 'quorum must be <30'); assert(quorum >= 1, 'quorum < 1?');