Skip to content

Commit

Permalink
Merge pull request #154 from EmmanuelAR/feat/153
Browse files Browse the repository at this point in the history
Fix variables and spaces
  • Loading branch information
EmmanuelAR authored Oct 25, 2024
2 parents 71938b2 + 74f25de commit 40ff525
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions contracts/src/donatorManager.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ mod DonatorManager {
owner: ContractAddress
}


// *************************************************************************
// EXTERNALS
// *************************************************************************
Expand All @@ -65,14 +64,16 @@ mod DonatorManager {
let mut calldata = ArrayTrait::<felt252>::new();
calldata.append(get_caller_address().try_into().unwrap());

let (address_0, _) = deploy_syscall(
let (new_donator_address, _) = deploy_syscall(
self.donator_class_hash.read(), 12345, calldata.span(), false
)
.unwrap();
self.donators.write(get_caller_address().try_into().unwrap(), address_0);
self.donators.write(get_caller_address().try_into().unwrap(), new_donator_address);
self
.emit(
DonatorContractDeployed { owner: get_caller_address(), new_donator: address_0 }
DonatorContractDeployed {
owner: get_caller_address(), new_donator: new_donator_address
}
)
}
fn getOwner(self: @ContractState) -> ContractAddress {
Expand Down
4 changes: 2 additions & 2 deletions contracts/src/fundManager.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ mod FundManager {
Serde::serialize(@get_caller_address(), ref call_data);
Serde::serialize(@name, ref call_data);
Serde::serialize(@goal, ref call_data);
let (address_0, _) = deploy_syscall(
let (new_fund_address, _) = deploy_syscall(
self.fund_class_hash.read(), 12345, call_data.span(), false
)
.unwrap();
self.funds.write(self.current_id.read(), address_0);
self.funds.write(self.current_id.read(), new_fund_address);
self.current_id.write(self.current_id.read() + 1);
}
fn getCurrentId(self: @ContractState) -> u128 {
Expand Down
2 changes: 1 addition & 1 deletion contracts/tests/test_fund_manager.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ fn test_new_fund() {
let expected_fund_class_hash = get_class_hash(fund_manager_contract.getFund(1));
let current_id = fund_manager_contract.getCurrentId();
assert(expected_fund_class_hash == fund_class_hash, 'Invalid fund address');
assert(current_id == 2 , 'Invalid current ID');
assert(current_id == 2, 'Invalid current ID');
}

0 comments on commit 40ff525

Please sign in to comment.