Skip to content

Commit

Permalink
reorder propose arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
pscott committed Aug 31, 2023
1 parent 072efe7 commit af29aaa
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions starknet/src/authenticators/eth_sig.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ mod EthSigAuthenticator {
ISpaceDispatcher { contract_address: target }
.propose(
UserAddress::Ethereum(author),
metadata_URI,
execution_strategy,
user_proposal_validation_params,
metadata_URI
);
}

Expand Down Expand Up @@ -129,7 +129,7 @@ mod EthSigAuthenticator {
proposal_id,
choice,
user_voting_strategies,
metadata_URI
metadata_URI,
);
}

Expand Down
6 changes: 3 additions & 3 deletions starknet/src/authenticators/eth_tx.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ mod EthTxAuthenticator {
target.serialize(ref payload);
PROPOSE_SELECTOR.serialize(ref payload);
author.serialize(ref payload);
metadata_URI.serialize(ref payload);
execution_strategy.serialize(ref payload);
user_proposal_validation_params.serialize(ref payload);
metadata_URI.serialize(ref payload);
let payload_hash = poseidon::poseidon_hash_span(payload.span());

consume_commit(ref self, payload_hash, author);

ISpaceDispatcher { contract_address: target }
.propose(
UserAddress::Ethereum(author),
metadata_URI,
execution_strategy,
user_proposal_validation_params,
metadata_URI
);
}

Expand Down Expand Up @@ -108,7 +108,7 @@ mod EthTxAuthenticator {
proposal_id,
choice,
user_voting_strategies,
metadata_URI
metadata_URI,
);
}

Expand Down
4 changes: 2 additions & 2 deletions starknet/src/authenticators/stark_sig.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ mod StarkSigAuthenticator {
ISpaceDispatcher { contract_address: target }
.propose(
UserAddress::Starknet(author),
metadata_URI,
execution_strategy,
user_proposal_validation_params,
metadata_URI
);
}

Expand Down Expand Up @@ -123,7 +123,7 @@ mod StarkSigAuthenticator {
proposal_id,
choice,
user_voting_strategies,
metadata_URI
metadata_URI,
);
}

Expand Down
4 changes: 2 additions & 2 deletions starknet/src/authenticators/stark_tx.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ mod StarkTxAuthenticator {
ISpaceDispatcher { contract_address: space }
.propose(
UserAddress::Starknet(author),
metadata_URI,
execution_strategy,
user_proposal_validation_params,
metadata_URI
);
}

Expand All @@ -81,7 +81,7 @@ mod StarkTxAuthenticator {
proposal_id,
choice,
user_voting_strategies,
metadata_URI
metadata_URI,
);
}

Expand Down
4 changes: 2 additions & 2 deletions starknet/src/space/space.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ trait ISpace<TContractState> {
fn propose(
ref self: TContractState,
author: UserAddress,
metadata_URI: Array<felt252>,
execution_strategy: Strategy,
user_proposal_validation_params: Array<felt252>,
metadata_URI: Array<felt252>,
);
fn vote(
ref self: TContractState,
Expand Down Expand Up @@ -316,9 +316,9 @@ mod Space {
fn propose(
ref self: ContractState,
author: UserAddress,
metadata_URI: Array<felt252>,
execution_strategy: Strategy,
user_proposal_validation_params: Array<felt252>,
metadata_URI: Array<felt252>,
) {
assert_only_authenticator(@self);
assert(author.is_non_zero(), 'Zero Address');
Expand Down
14 changes: 7 additions & 7 deletions starknet/src/tests/test_space.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ mod tests {
let author = UserAddress::Starknet(contract_address_const::<0x5678>());
let mut propose_calldata = array![];
author.serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);

// Create Proposal
Expand Down Expand Up @@ -431,8 +431,8 @@ mod tests {
let author = UserAddress::Starknet(contract_address_const::<0x5678>());
let mut propose_calldata = array![];
author.serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);

// Try to create Proposal
Expand Down Expand Up @@ -467,8 +467,8 @@ mod tests {
let author = UserAddress::Starknet(contract_address_const::<0x5678>());
let mut propose_calldata = array![];
author.serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);

// Create Proposal
Expand Down Expand Up @@ -530,8 +530,8 @@ mod tests {
let mut propose_calldata = array![];
let author = UserAddress::Starknet(contract_address_const::<0x5678>());
author.serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);

// Create Proposal
Expand Down Expand Up @@ -592,8 +592,8 @@ mod tests {
let author = UserAddress::Starknet(contract_address_const::<0x0>());
let mut propose_calldata = array::ArrayTrait::<felt252>::new();
author.serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);

// Create Proposal
Expand Down Expand Up @@ -629,8 +629,8 @@ mod tests {
let author = UserAddress::Starknet(contract_address_const::<0x0>());
let mut propose_calldata = array::ArrayTrait::<felt252>::new();
author.serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);

// Create Proposal
Expand Down Expand Up @@ -682,8 +682,8 @@ mod tests {
let author = UserAddress::Starknet(contract_address_const::<0x5678>());
let mut propose_calldata = array::ArrayTrait::<felt252>::new();
author.serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);

// Create Proposal
Expand Down
2 changes: 1 addition & 1 deletion starknet/src/tests/test_upgrade.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ mod tests {

let mut propose_calldata = array![];
UserAddress::Starknet(contract_address_const::<0x7676>()).serialize(ref propose_calldata);
execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);
execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);

let authenticator = IVanillaAuthenticatorDispatcher {
Expand Down
2 changes: 1 addition & 1 deletion starknet/src/tests/vote.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ mod tests {
let author = UserAddress::Starknet(contract_address_const::<0x5678>());
let mut propose_calldata = array![];
author.serialize(ref propose_calldata);
execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);
execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);

// Create Proposal
Expand Down
6 changes: 3 additions & 3 deletions starknet/src/tests/voting_strategies/erc20_votes.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ mod tests {
let author = UserAddress::Starknet(contract_address_const::<0x5678>());
let mut propose_calldata = array::ArrayTrait::<felt252>::new();
author.serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);

// Create a proposal
Expand Down Expand Up @@ -217,8 +217,8 @@ mod tests {
let author = UserAddress::Starknet(contract_address_const::<0x5678>());
let mut propose_calldata = array::ArrayTrait::<felt252>::new();
author.serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);

// Create proposal
Expand Down Expand Up @@ -267,8 +267,8 @@ mod tests {
let author = UserAddress::Starknet(contract_address_const::<0x5678>());
let mut propose_calldata = array::ArrayTrait::<felt252>::new();
author.serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);
vanilla_execution_strategy.serialize(ref propose_calldata);
ArrayTrait::<felt252>::new().serialize(ref propose_calldata);

// Create proposal
Expand Down

0 comments on commit af29aaa

Please sign in to comment.