Skip to content

Commit

Permalink
dev: rename function parameter to new_class_hash from class_hash
Browse files Browse the repository at this point in the history
…for `upgrade_contract`
  • Loading branch information
Harsh Bajpai authored and Harsh Bajpai committed Oct 17, 2023
1 parent b85f3ad commit 71262af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/contracts/src/components/upgradeable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use starknet::{replace_class_syscall, ClassHash};

#[starknet::interface]
trait IUpgradeable<TContractState> {
fn upgrade_contract(ref self: TContractState, class_hash: ClassHash);
fn upgrade_contract(ref self: TContractState, new_class_hash: ClassHash);
}


Expand Down Expand Up @@ -30,10 +30,10 @@ mod upgradeable_component {
TContractState, +HasComponent<TContractState>
> of super::IUpgradeable<ComponentState<TContractState>> {
fn upgrade_contract(
ref self: ComponentState<TContractState>, class_hash: starknet::ClassHash
ref self: ComponentState<TContractState>, new_class_hash: starknet::ClassHash
) {
starknet::replace_class_syscall(class_hash);
self.emit(ContractUpgraded { new_class_hash: class_hash });
starknet::replace_class_syscall(new_class_hash);
self.emit(ContractUpgraded { new_class_hash: new_class_hash });
}
}
}

0 comments on commit 71262af

Please sign in to comment.