Skip to content

Commit

Permalink
Polish to use array! syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
tensojka committed Nov 17, 2023
1 parent ab60119 commit 9eec3ea
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/options.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,7 @@ mod Options {
proxy_class: ClassHash, impl_class: ClassHash, salt: felt252
) -> ContractAddress {
let curr_salt = salt + impl_class.into();
let mut calldata = ArrayTrait::<felt252>::new();
calldata.append(impl_class.into());
calldata.append(0);
calldata.append(0);
let mut calldata = array![impl_class.into(), 0, 0];
let syscall_res = deploy_syscall(proxy_class, curr_salt, calldata.span(), false);
let (res, _) = syscall_res.unwrap_syscall();
res
Expand Down
2 changes: 1 addition & 1 deletion src/proposals.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ mod Proposals {
let already_delegated = find_already_delegated(to_addr, calldata_span, 0);
assert(caller_balance - already_delegated >= amount, 'Not enough funds');

let updated_list: Array<(ContractAddress, u128)> = ArrayTrait::new();
let updated_list: Array<(ContractAddress, u128)> = array![];
let updated_list_span = updated_list.span();

update_calldata(to_addr, already_delegated + amount, calldata_span, updated_list, 0);
Expand Down
1 change: 0 additions & 1 deletion src/traits.cairo
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use starknet::ContractAddress;
use array::ArrayTrait;

use governance::types::OptionSide;
use governance::types::OptionType;
Expand Down

0 comments on commit 9eec3ea

Please sign in to comment.