From af29aaaa26940381b7ada3b5e0eed2c1a16bc76a Mon Sep 17 00:00:00 2001 From: Scott Piriou <30843220+pscott@users.noreply.github.com> Date: Thu, 31 Aug 2023 11:57:18 +0200 Subject: [PATCH] reorder propose arguments --- starknet/src/authenticators/eth_sig.cairo | 4 ++-- starknet/src/authenticators/eth_tx.cairo | 6 +++--- starknet/src/authenticators/stark_sig.cairo | 4 ++-- starknet/src/authenticators/stark_tx.cairo | 4 ++-- starknet/src/space/space.cairo | 4 ++-- starknet/src/tests/test_space.cairo | 14 +++++++------- starknet/src/tests/test_upgrade.cairo | 2 +- starknet/src/tests/vote.cairo | 2 +- .../src/tests/voting_strategies/erc20_votes.cairo | 6 +++--- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/starknet/src/authenticators/eth_sig.cairo b/starknet/src/authenticators/eth_sig.cairo index 86eda08e..768649eb 100644 --- a/starknet/src/authenticators/eth_sig.cairo +++ b/starknet/src/authenticators/eth_sig.cairo @@ -91,9 +91,9 @@ mod EthSigAuthenticator { ISpaceDispatcher { contract_address: target } .propose( UserAddress::Ethereum(author), + metadata_URI, execution_strategy, user_proposal_validation_params, - metadata_URI ); } @@ -129,7 +129,7 @@ mod EthSigAuthenticator { proposal_id, choice, user_voting_strategies, - metadata_URI + metadata_URI, ); } diff --git a/starknet/src/authenticators/eth_tx.cairo b/starknet/src/authenticators/eth_tx.cairo index e9be8b46..4edf7d30 100644 --- a/starknet/src/authenticators/eth_tx.cairo +++ b/starknet/src/authenticators/eth_tx.cairo @@ -65,9 +65,9 @@ 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); @@ -75,9 +75,9 @@ mod EthTxAuthenticator { ISpaceDispatcher { contract_address: target } .propose( UserAddress::Ethereum(author), + metadata_URI, execution_strategy, user_proposal_validation_params, - metadata_URI ); } @@ -108,7 +108,7 @@ mod EthTxAuthenticator { proposal_id, choice, user_voting_strategies, - metadata_URI + metadata_URI, ); } diff --git a/starknet/src/authenticators/stark_sig.cairo b/starknet/src/authenticators/stark_sig.cairo index b69a0dff..8f587013 100644 --- a/starknet/src/authenticators/stark_sig.cairo +++ b/starknet/src/authenticators/stark_sig.cairo @@ -86,9 +86,9 @@ mod StarkSigAuthenticator { ISpaceDispatcher { contract_address: target } .propose( UserAddress::Starknet(author), + metadata_URI, execution_strategy, user_proposal_validation_params, - metadata_URI ); } @@ -123,7 +123,7 @@ mod StarkSigAuthenticator { proposal_id, choice, user_voting_strategies, - metadata_URI + metadata_URI, ); } diff --git a/starknet/src/authenticators/stark_tx.cairo b/starknet/src/authenticators/stark_tx.cairo index ff4e13f6..4e72a2af 100644 --- a/starknet/src/authenticators/stark_tx.cairo +++ b/starknet/src/authenticators/stark_tx.cairo @@ -58,9 +58,9 @@ mod StarkTxAuthenticator { ISpaceDispatcher { contract_address: space } .propose( UserAddress::Starknet(author), + metadata_URI, execution_strategy, user_proposal_validation_params, - metadata_URI ); } @@ -81,7 +81,7 @@ mod StarkTxAuthenticator { proposal_id, choice, user_voting_strategies, - metadata_URI + metadata_URI, ); } diff --git a/starknet/src/space/space.cairo b/starknet/src/space/space.cairo index b06ee4a3..a9818872 100644 --- a/starknet/src/space/space.cairo +++ b/starknet/src/space/space.cairo @@ -42,9 +42,9 @@ trait ISpace { fn propose( ref self: TContractState, author: UserAddress, + metadata_URI: Array, execution_strategy: Strategy, user_proposal_validation_params: Array, - metadata_URI: Array, ); fn vote( ref self: TContractState, @@ -316,9 +316,9 @@ mod Space { fn propose( ref self: ContractState, author: UserAddress, + metadata_URI: Array, execution_strategy: Strategy, user_proposal_validation_params: Array, - metadata_URI: Array, ) { assert_only_authenticator(@self); assert(author.is_non_zero(), 'Zero Address'); diff --git a/starknet/src/tests/test_space.cairo b/starknet/src/tests/test_space.cairo index 3f1919a6..04a0f320 100644 --- a/starknet/src/tests/test_space.cairo +++ b/starknet/src/tests/test_space.cairo @@ -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::::new().serialize(ref propose_calldata); + vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); // Create Proposal @@ -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::::new().serialize(ref propose_calldata); + vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); // Try to create Proposal @@ -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::::new().serialize(ref propose_calldata); + vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); // Create Proposal @@ -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::::new().serialize(ref propose_calldata); + vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); // Create Proposal @@ -592,8 +592,8 @@ mod tests { let author = UserAddress::Starknet(contract_address_const::<0x0>()); let mut propose_calldata = array::ArrayTrait::::new(); author.serialize(ref propose_calldata); - vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); + vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); // Create Proposal @@ -629,8 +629,8 @@ mod tests { let author = UserAddress::Starknet(contract_address_const::<0x0>()); let mut propose_calldata = array::ArrayTrait::::new(); author.serialize(ref propose_calldata); - vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); + vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); // Create Proposal @@ -682,8 +682,8 @@ mod tests { let author = UserAddress::Starknet(contract_address_const::<0x5678>()); let mut propose_calldata = array::ArrayTrait::::new(); author.serialize(ref propose_calldata); - vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); + vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); // Create Proposal diff --git a/starknet/src/tests/test_upgrade.cairo b/starknet/src/tests/test_upgrade.cairo index a46ed4e6..3720af6a 100644 --- a/starknet/src/tests/test_upgrade.cairo +++ b/starknet/src/tests/test_upgrade.cairo @@ -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::::new().serialize(ref propose_calldata); + execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); let authenticator = IVanillaAuthenticatorDispatcher { diff --git a/starknet/src/tests/vote.cairo b/starknet/src/tests/vote.cairo index a71ab8b8..f5fe4d80 100644 --- a/starknet/src/tests/vote.cairo +++ b/starknet/src/tests/vote.cairo @@ -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::::new().serialize(ref propose_calldata); + execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); // Create Proposal diff --git a/starknet/src/tests/voting_strategies/erc20_votes.cairo b/starknet/src/tests/voting_strategies/erc20_votes.cairo index cbb33210..c0c281f3 100644 --- a/starknet/src/tests/voting_strategies/erc20_votes.cairo +++ b/starknet/src/tests/voting_strategies/erc20_votes.cairo @@ -170,8 +170,8 @@ mod tests { let author = UserAddress::Starknet(contract_address_const::<0x5678>()); let mut propose_calldata = array::ArrayTrait::::new(); author.serialize(ref propose_calldata); - vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); + vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); // Create a proposal @@ -217,8 +217,8 @@ mod tests { let author = UserAddress::Starknet(contract_address_const::<0x5678>()); let mut propose_calldata = array::ArrayTrait::::new(); author.serialize(ref propose_calldata); - vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); + vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); // Create proposal @@ -267,8 +267,8 @@ mod tests { let author = UserAddress::Starknet(contract_address_const::<0x5678>()); let mut propose_calldata = array::ArrayTrait::::new(); author.serialize(ref propose_calldata); - vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); + vanilla_execution_strategy.serialize(ref propose_calldata); ArrayTrait::::new().serialize(ref propose_calldata); // Create proposal