diff --git a/starknet/src/tests/mocks/proposal_validation_always_fail.cairo b/starknet/src/tests/mocks/proposal_validation_always_fail.cairo index a25dccdf0..3be994271 100644 --- a/starknet/src/tests/mocks/proposal_validation_always_fail.cairo +++ b/starknet/src/tests/mocks/proposal_validation_always_fail.cairo @@ -2,12 +2,13 @@ mod AlwaysFailProposalValidationStrategy { use starknet::ContractAddress; use sx::types::UserAddress; + use sx::interfaces::{IProposalValidationStrategy,}; #[storage] struct Storage {} - #[generate_trait] - impl AlwaysFailProposalValidationStrategy of IAlwaysFailProposalValidationStrategy { + #[abi(embed_v0)] + impl AlwaysFailProposalValidationStrategy of IProposalValidationStrategy { fn validate( self: @ContractState, author: UserAddress, diff --git a/starknet/src/tests/proposal_validation_strategies/proposition_power.cairo b/starknet/src/tests/proposal_validation_strategies/proposition_power.cairo index 26f9481d6..da467fbb6 100644 --- a/starknet/src/tests/proposal_validation_strategies/proposition_power.cairo +++ b/starknet/src/tests/proposal_validation_strategies/proposition_power.cairo @@ -260,7 +260,12 @@ mod tests { // deploy erc20 voting strategy let owner = starknet::contract_address_const::<'owner'>(); - let mut constructor = array!['TEST', 'TST']; + let mut constructor = array![]; + let name: ByteArray = "TEST"; + let symbol: ByteArray = "TST"; + + name.serialize(ref constructor); + symbol.serialize(ref constructor); SUPPLY.serialize(ref constructor); owner.serialize(ref constructor); diff --git a/starknet/src/tests/space/space.cairo b/starknet/src/tests/space/space.cairo index 21ebf547f..58259d7a6 100644 --- a/starknet/src/tests/space/space.cairo +++ b/starknet/src/tests/space/space.cairo @@ -20,7 +20,6 @@ mod tests { use sx::tests::utils::strategy_trait::{StrategyImpl, StrategyDefault}; use sx::tests::mocks::executor::ExecutorWithoutTxExecutionStrategy; - fn assert_correct_proposal_event( space_address: ContractAddress, proposal_id: u256, diff --git a/starknet/src/tests/voting_strategies/erc20_votes.cairo b/starknet/src/tests/voting_strategies/erc20_votes.cairo index 981416af9..ed01f6843 100644 --- a/starknet/src/tests/voting_strategies/erc20_votes.cairo +++ b/starknet/src/tests/voting_strategies/erc20_votes.cairo @@ -23,8 +23,7 @@ mod tests { use sx::utils::constants::{PROPOSE_SELECTOR, VOTE_SELECTOR}; use sx::tests::mocks::vanilla_execution_strategy::VanillaExecutionStrategy; - const NAME: felt252 = 'TEST'; - const SYMBOL: felt252 = 'TST'; + const INITIAL_SUPPLY: u256 = 1_000; fn OWNER() -> ContractAddress { @@ -32,11 +31,22 @@ mod tests { } fn deploy_token_contract() -> ContractAddress { - // Deploy ERC20 - let constructor_data = array![ - NAME, SYMBOL, INITIAL_SUPPLY.low.into(), INITIAL_SUPPLY.high.into(), OWNER().into() - ]; + let NAME: ByteArray = "TEST"; + let SYMBOL: ByteArray = "TST"; + let mut constructor_data = array![]; + NAME.serialize(ref constructor_data); + SYMBOL.serialize(ref constructor_data); + INITIAL_SUPPLY.low.serialize(ref constructor_data); + INITIAL_SUPPLY.high.serialize(ref constructor_data); + OWNER().serialize(ref constructor_data); + + // let constructor_data = array![ + // NAME, SYMBOL, INITIAL_SUPPLY.low.into(), INITIAL_SUPPLY.high.into(), OWNER().into() + // ]; + // let constructor_data = (NAME, SYMBOL, INITIAL_SUPPLY.low, INITIAL_SUPPLY, OWNER()); + + // Deploy ERC20 let (token_contract, _) = syscalls::deploy_syscall( ERC20VotesPreset::TEST_CLASS_HASH.try_into().unwrap(), 0, @@ -149,7 +159,7 @@ mod tests { #[test] #[available_gas(1000000000)] - fn works() { + fn scott_works() { let (config, space) = setup_space(); let vanilla_execution_strategy = get_vanilla_execution_strategy(); let accounts = setup_accounts(space.voting_strategies(1));