From 9eec3eac5c806bf0e853788cfaecb0c165566e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sojka?= Date: Fri, 17 Nov 2023 14:06:23 +0000 Subject: [PATCH] Polish to use array! syntax --- src/options.cairo | 5 +---- src/proposals.cairo | 2 +- src/traits.cairo | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/options.cairo b/src/options.cairo index dcb44716..edebd9f1 100644 --- a/src/options.cairo +++ b/src/options.cairo @@ -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::::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 diff --git a/src/proposals.cairo b/src/proposals.cairo index 548322f5..532337fd 100644 --- a/src/proposals.cairo +++ b/src/proposals.cairo @@ -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); diff --git a/src/traits.cairo b/src/traits.cairo index 4aca7aa5..b606dbf8 100644 --- a/src/traits.cairo +++ b/src/traits.cairo @@ -1,5 +1,4 @@ use starknet::ContractAddress; -use array::ArrayTrait; use governance::types::OptionSide; use governance::types::OptionType;