Skip to content

Commit

Permalink
Polish formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tensojka committed Aug 22, 2024
1 parent 9da3691 commit 0487558
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/contract.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)]
Expand Down
8 changes: 6 additions & 2 deletions src/proposals.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ trait IProposals<TContractState> {
);
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]
Expand Down Expand Up @@ -580,7 +582,9 @@ mod proposals {
idx
}

fn set_default_proposal_params(ref self: ComponentState<TContractState>, quorum: u32, proposal_voting_seconds: u32) {
fn set_default_proposal_params(
ref self: ComponentState<TContractState>, 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?');
Expand Down

0 comments on commit 0487558

Please sign in to comment.