From feda6f71b639566074f445acfa857b69d7e2f4db Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Tue, 19 Sep 2023 10:59:10 +0800 Subject: [PATCH 1/6] remove ignore --- .tool-versions | 1 + contracts/src/tests/test_upgradeable.cairo | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.tool-versions b/.tool-versions index 55a3fa158..686b1866b 100644 --- a/.tool-versions +++ b/.tool-versions @@ -9,6 +9,7 @@ mockery 2.22.1 golangci-lint 1.51.2 actionlint 1.6.12 shellcheck 0.8.0 +scarb 0.7.0 # Kubernetes k3d 5.4.4 diff --git a/contracts/src/tests/test_upgradeable.cairo b/contracts/src/tests/test_upgradeable.cairo index 3da6b6991..460101bed 100644 --- a/contracts/src/tests/test_upgradeable.cairo +++ b/contracts/src/tests/test_upgradeable.cairo @@ -8,6 +8,7 @@ use starknet::class_hash::class_hash_const; use chainlink::libraries::upgradeable::Upgradeable; use chainlink::libraries::ownable::Ownable; +// Some tests are still written in TS due to missing features in cairo-test fn setup() -> ContractAddress { let account: ContractAddress = contract_address_const::<777>(); @@ -15,9 +16,7 @@ fn setup() -> ContractAddress { account } -// replace_class_syscall() not yet supported in tests #[test] -#[ignore] #[available_gas(2000000)] fn test_upgrade() { let sender = setup(); From eb350e4315028b56b18356170de65d4e5179e598 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Tue, 19 Sep 2023 14:51:29 +0800 Subject: [PATCH 2/6] add mock contracts --- contracts/src/libraries.cairo | 1 + contracts/src/libraries/mocks.cairo | 2 ++ .../mocks/mock_non_upgradeable.cairo | 19 ++++++++++++ .../libraries/mocks/mock_upgradeable.cairo | 30 +++++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 contracts/src/libraries/mocks.cairo create mode 100644 contracts/src/libraries/mocks/mock_non_upgradeable.cairo create mode 100644 contracts/src/libraries/mocks/mock_upgradeable.cairo diff --git a/contracts/src/libraries.cairo b/contracts/src/libraries.cairo index 56b6fa85a..2fd5588af 100644 --- a/contracts/src/libraries.cairo +++ b/contracts/src/libraries.cairo @@ -2,3 +2,4 @@ mod ownable; mod access_control; mod token; mod upgradeable; +mod mocks; diff --git a/contracts/src/libraries/mocks.cairo b/contracts/src/libraries/mocks.cairo new file mode 100644 index 000000000..9a58bab7d --- /dev/null +++ b/contracts/src/libraries/mocks.cairo @@ -0,0 +1,2 @@ +mod mock_upgradeable; +mod mock_non_upgradeable; diff --git a/contracts/src/libraries/mocks/mock_non_upgradeable.cairo b/contracts/src/libraries/mocks/mock_non_upgradeable.cairo new file mode 100644 index 000000000..baa4350f5 --- /dev/null +++ b/contracts/src/libraries/mocks/mock_non_upgradeable.cairo @@ -0,0 +1,19 @@ +#[starknet::interface] +trait IMockNonUpgradeable { + fn bar(self: @TContractState) -> bool; +} + +#[starknet::contract] +mod MockNonUpgradeable { + #[storage] + struct Storage {} + + #[constructor] + fn constructor(self: @ContractState) {} + + impl MockNonUpgradeableImpl of super::IMockNonUpgradeable { + fn bar(self: @ContractState) -> bool { + true + } + } +} diff --git a/contracts/src/libraries/mocks/mock_upgradeable.cairo b/contracts/src/libraries/mocks/mock_upgradeable.cairo new file mode 100644 index 000000000..dc4162491 --- /dev/null +++ b/contracts/src/libraries/mocks/mock_upgradeable.cairo @@ -0,0 +1,30 @@ +use starknet::class_hash::ClassHash; + +#[starknet::interface] +trait IMockUpgradeable { + fn foo(self: @TContractState) -> bool; + fn upgrade(ref self: TContractState, new_impl: ClassHash); +} + +#[starknet::contract] +mod MockUpgradeable { + use starknet::class_hash::ClassHash; + + use chainlink::libraries::upgradeable::Upgradeable; + + #[storage] + struct Storage {} + + #[constructor] + fn constructor(self: @ContractState) {} + + impl MockUpgradeableImpl of super::IMockUpgradeable { + fn foo(self: @ContractState) -> bool { + true + } + + fn upgrade(ref self: ContractState, new_impl: ClassHash) { + Upgradeable::upgrade(new_impl) + } + } +} From af81ebb82cc1ac2ca1c31aa454cb8d5a778087cc Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Tue, 19 Sep 2023 15:28:20 +0800 Subject: [PATCH 3/6] finish test --- .../mocks/mock_non_upgradeable.cairo | 1 + .../libraries/mocks/mock_upgradeable.cairo | 1 + contracts/src/libraries/upgradeable.cairo | 1 + contracts/src/tests/test_upgradeable.cairo | 35 +++++++++++++++++++ 4 files changed, 38 insertions(+) diff --git a/contracts/src/libraries/mocks/mock_non_upgradeable.cairo b/contracts/src/libraries/mocks/mock_non_upgradeable.cairo index baa4350f5..3b17df236 100644 --- a/contracts/src/libraries/mocks/mock_non_upgradeable.cairo +++ b/contracts/src/libraries/mocks/mock_non_upgradeable.cairo @@ -11,6 +11,7 @@ mod MockNonUpgradeable { #[constructor] fn constructor(self: @ContractState) {} + #[external(v0)] impl MockNonUpgradeableImpl of super::IMockNonUpgradeable { fn bar(self: @ContractState) -> bool { true diff --git a/contracts/src/libraries/mocks/mock_upgradeable.cairo b/contracts/src/libraries/mocks/mock_upgradeable.cairo index dc4162491..bd49e2796 100644 --- a/contracts/src/libraries/mocks/mock_upgradeable.cairo +++ b/contracts/src/libraries/mocks/mock_upgradeable.cairo @@ -18,6 +18,7 @@ mod MockUpgradeable { #[constructor] fn constructor(self: @ContractState) {} + #[external(v0)] impl MockUpgradeableImpl of super::IMockUpgradeable { fn foo(self: @ContractState) -> bool { true diff --git a/contracts/src/libraries/upgradeable.cairo b/contracts/src/libraries/upgradeable.cairo index 22bfdb880..5978238d0 100644 --- a/contracts/src/libraries/upgradeable.cairo +++ b/contracts/src/libraries/upgradeable.cairo @@ -2,6 +2,7 @@ use starknet::class_hash::ClassHash; #[starknet::interface] trait IUpgradeable { + // note: any contract that uses this module will have a mutable reference to contract state fn upgrade(ref self: TContractState, new_impl: ClassHash); } diff --git a/contracts/src/tests/test_upgradeable.cairo b/contracts/src/tests/test_upgradeable.cairo index 460101bed..337d8b98e 100644 --- a/contracts/src/tests/test_upgradeable.cairo +++ b/contracts/src/tests/test_upgradeable.cairo @@ -4,9 +4,22 @@ use starknet::testing::set_caller_address; use starknet::ContractAddress; use starknet::contract_address_const; use starknet::class_hash::class_hash_const; +use starknet::syscalls::deploy_syscall; use chainlink::libraries::upgradeable::Upgradeable; use chainlink::libraries::ownable::Ownable; +use chainlink::libraries::mocks::mock_upgradeable::{ + MockUpgradeable, IMockUpgradeableDispatcher, IMockUpgradeableDispatcherTrait, + IMockUpgradeableDispatcherImpl +}; +use chainlink::libraries::mocks::mock_non_upgradeable::{ + MockNonUpgradeable, IMockNonUpgradeableDispatcher, IMockNonUpgradeableDispatcherTrait, + IMockNonUpgradeableDispatcherImpl +}; + +fn STATE() -> MockUpgradeable::ContractState { + MockUpgradeable::contract_state_for_testing() +} // Some tests are still written in TS due to missing features in cairo-test @@ -21,9 +34,31 @@ fn setup() -> ContractAddress { fn test_upgrade() { let sender = setup(); + // doesn't error Upgradeable::upgrade(class_hash_const::<1>()); } +#[test] +#[available_gas(2000000)] +fn test_upgrade_and_call() { + let sender = setup(); + + let calldata = array![]; + let (contractAddr, _) = deploy_syscall( + MockUpgradeable::TEST_CLASS_HASH.try_into().unwrap(), 0, calldata.span(), false + ) + .unwrap(); + let mockUpgradeable = IMockUpgradeableDispatcher { contract_address: contractAddr }; + assert(mockUpgradeable.foo() == true, 'should call foo'); + + mockUpgradeable.upgrade(MockNonUpgradeable::TEST_CLASS_HASH.try_into().unwrap()); + + // now, contract should be different + let mockNonUpgradeable = IMockNonUpgradeableDispatcher { contract_address: contractAddr }; + assert(mockNonUpgradeable.bar() == true, 'should call bar'); +} + + #[test] #[available_gas(2000000)] #[should_panic(expected: ('Class hash cannot be zero',))] From e4b7558a52d62e0d5c85842417308ab9dc7655c2 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Tue, 19 Sep 2023 15:33:10 +0800 Subject: [PATCH 4/6] remove unused code --- contracts/src/tests/test_upgradeable.cairo | 6 ------ 1 file changed, 6 deletions(-) diff --git a/contracts/src/tests/test_upgradeable.cairo b/contracts/src/tests/test_upgradeable.cairo index 337d8b98e..1605b0439 100644 --- a/contracts/src/tests/test_upgradeable.cairo +++ b/contracts/src/tests/test_upgradeable.cairo @@ -17,12 +17,6 @@ use chainlink::libraries::mocks::mock_non_upgradeable::{ IMockNonUpgradeableDispatcherImpl }; -fn STATE() -> MockUpgradeable::ContractState { - MockUpgradeable::contract_state_for_testing() -} - -// Some tests are still written in TS due to missing features in cairo-test - fn setup() -> ContractAddress { let account: ContractAddress = contract_address_const::<777>(); set_caller_address(account); From 7928e2f5c010e8bb3018d384c178b0f9c0646ada Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Fri, 22 Sep 2023 09:34:03 +0800 Subject: [PATCH 5/6] fix mock constructor + define impl of trait --- .../src/access_control/access_controller.cairo | 12 +++++++----- .../src/libraries/mocks/mock_non_upgradeable.cairo | 2 +- .../src/libraries/mocks/mock_upgradeable.cairo | 2 +- contracts/src/ocr2/aggregator.cairo | 12 +++++++----- contracts/src/ocr2/aggregator_proxy.cairo | 13 ++++++++----- contracts/src/tests/test_access_controller.cairo | 4 +++- contracts/src/tests/test_aggregator.cairo | 7 +++++-- contracts/src/tests/test_aggregator_proxy.cairo | 4 ++-- contracts/src/tests/test_link_token.cairo | 4 ++-- contracts/src/token/link_token.cairo | 12 +++++++----- 10 files changed, 43 insertions(+), 29 deletions(-) diff --git a/contracts/src/access_control/access_controller.cairo b/contracts/src/access_control/access_controller.cairo index edb73ada2..075ac5fd6 100644 --- a/contracts/src/access_control/access_controller.cairo +++ b/contracts/src/access_control/access_controller.cairo @@ -7,7 +7,7 @@ mod AccessController { use chainlink::libraries::access_control::{AccessControl, IAccessController}; use chainlink::libraries::ownable::{Ownable, IOwnable}; - use chainlink::libraries::upgradeable::Upgradeable; + use chainlink::libraries::upgradeable::{Upgradeable, IUpgradeable}; #[storage] struct Storage {} @@ -98,9 +98,11 @@ mod AccessController { } #[external(v0)] - fn upgrade(ref self: ContractState, new_impl: ClassHash) { - let ownable = Ownable::unsafe_new_contract_state(); - Ownable::assert_only_owner(@ownable); - Upgradeable::upgrade(new_impl); + impl UpgradeableImpl of IUpgradeable { + fn upgrade(ref self: ContractState, new_impl: ClassHash) { + let ownable = Ownable::unsafe_new_contract_state(); + Ownable::assert_only_owner(@ownable); + Upgradeable::upgrade(new_impl); + } } } diff --git a/contracts/src/libraries/mocks/mock_non_upgradeable.cairo b/contracts/src/libraries/mocks/mock_non_upgradeable.cairo index 3b17df236..1dc6ac1fb 100644 --- a/contracts/src/libraries/mocks/mock_non_upgradeable.cairo +++ b/contracts/src/libraries/mocks/mock_non_upgradeable.cairo @@ -9,7 +9,7 @@ mod MockNonUpgradeable { struct Storage {} #[constructor] - fn constructor(self: @ContractState) {} + fn constructor(ref self: ContractState) {} #[external(v0)] impl MockNonUpgradeableImpl of super::IMockNonUpgradeable { diff --git a/contracts/src/libraries/mocks/mock_upgradeable.cairo b/contracts/src/libraries/mocks/mock_upgradeable.cairo index bd49e2796..c46c4258c 100644 --- a/contracts/src/libraries/mocks/mock_upgradeable.cairo +++ b/contracts/src/libraries/mocks/mock_upgradeable.cairo @@ -16,7 +16,7 @@ mod MockUpgradeable { struct Storage {} #[constructor] - fn constructor(self: @ContractState) {} + fn constructor(ref self: ContractState) {} #[external(v0)] impl MockUpgradeableImpl of super::IMockUpgradeable { diff --git a/contracts/src/ocr2/aggregator.cairo b/contracts/src/ocr2/aggregator.cairo index 64a677f29..f23f07347 100644 --- a/contracts/src/ocr2/aggregator.cairo +++ b/contracts/src/ocr2/aggregator.cairo @@ -197,7 +197,7 @@ mod Aggregator { use chainlink::utils::split_felt; use chainlink::libraries::ownable::{Ownable, IOwnable}; use chainlink::libraries::access_control::AccessControl; - use chainlink::libraries::upgradeable::Upgradeable; + use chainlink::libraries::upgradeable::{Upgradeable, IUpgradeable}; use openzeppelin::token::erc20::interface::{IERC20, IERC20Dispatcher, IERC20DispatcherTrait}; @@ -375,10 +375,12 @@ mod Aggregator { // --- Upgradeable --- #[external(v0)] - fn upgrade(ref self: ContractState, new_impl: ClassHash) { - let ownable = Ownable::unsafe_new_contract_state(); - Ownable::assert_only_owner(@ownable); - Upgradeable::upgrade(new_impl) + impl UpgradeableImpl of IUpgradeable { + fn upgrade(ref self: ContractState, new_impl: ClassHash) { + let ownable = Ownable::unsafe_new_contract_state(); + Ownable::assert_only_owner(@ownable); + Upgradeable::upgrade(new_impl) + } } // --- Ownership --- diff --git a/contracts/src/ocr2/aggregator_proxy.cairo b/contracts/src/ocr2/aggregator_proxy.cairo index 02176d0a5..bbb06c881 100644 --- a/contracts/src/ocr2/aggregator_proxy.cairo +++ b/contracts/src/ocr2/aggregator_proxy.cairo @@ -52,7 +52,7 @@ mod AggregatorProxy { use chainlink::libraries::ownable::{Ownable, IOwnable}; use chainlink::libraries::access_control::{AccessControl, IAccessController}; use chainlink::utils::split_felt; - use chainlink::libraries::upgradeable::Upgradeable; + use chainlink::libraries::upgradeable::{Upgradeable, IUpgradeable}; const SHIFT: felt252 = 0x100000000000000000000000000000000; const MAX_ID: felt252 = 0xffffffffffffffffffffffffffffffff; @@ -172,12 +172,15 @@ mod AggregatorProxy { // -- Upgradeable -- #[external(v0)] - fn upgrade(ref self: ContractState, new_impl: ClassHash) { - let ownable = Ownable::unsafe_new_contract_state(); - Ownable::assert_only_owner(@ownable); - Upgradeable::upgrade(new_impl) + impl UpgradeableImpl of IUpgradeable { + fn upgrade(ref self: ContractState, new_impl: ClassHash) { + let ownable = Ownable::unsafe_new_contract_state(); + Ownable::assert_only_owner(@ownable); + Upgradeable::upgrade(new_impl) + } } + // -- Access Control -- #[external(v0)] diff --git a/contracts/src/tests/test_access_controller.cairo b/contracts/src/tests/test_access_controller.cairo index 862dc5248..b267d24f5 100644 --- a/contracts/src/tests/test_access_controller.cairo +++ b/contracts/src/tests/test_access_controller.cairo @@ -13,6 +13,8 @@ use option::OptionTrait; use core::result::ResultTrait; use chainlink::access_control::access_controller::AccessController; +use chainlink::access_control::access_controller::AccessController::UpgradeableImpl; + use chainlink::libraries::access_control::{ IAccessController, IAccessControllerDispatcher, IAccessControllerDispatcherTrait }; @@ -34,7 +36,7 @@ fn test_upgrade_not_owner() { let sender = setup(); let mut state = STATE(); - AccessController::upgrade(ref state, class_hash_const::<2>()); + UpgradeableImpl::upgrade(ref state, class_hash_const::<2>()); } #[test] diff --git a/contracts/src/tests/test_aggregator.cairo b/contracts/src/tests/test_aggregator.cairo index b004bd9fa..fbda54ee6 100644 --- a/contracts/src/tests/test_aggregator.cairo +++ b/contracts/src/tests/test_aggregator.cairo @@ -15,7 +15,9 @@ use core::result::ResultTrait; use chainlink::ocr2::aggregator::pow; use chainlink::ocr2::aggregator::Aggregator; -use chainlink::ocr2::aggregator::Aggregator::{AggregatorImpl, BillingImpl, PayeeManagementImpl}; +use chainlink::ocr2::aggregator::Aggregator::{ + AggregatorImpl, BillingImpl, PayeeManagementImpl, UpgradeableImpl +}; use chainlink::ocr2::aggregator::Aggregator::BillingConfig; use chainlink::ocr2::aggregator::Aggregator::PayeeConfig; use chainlink::access_control::access_controller::AccessController; @@ -155,7 +157,8 @@ fn test_access_control() { fn test_upgrade_non_owner() { let sender = setup(); let mut state = STATE(); - Aggregator::upgrade(ref state, class_hash_const::<123>()); + + UpgradeableImpl::upgrade(ref state, class_hash_const::<123>()); } // --- Billing tests --- diff --git a/contracts/src/tests/test_aggregator_proxy.cairo b/contracts/src/tests/test_aggregator_proxy.cairo index 6f1462691..4ae15a1ee 100644 --- a/contracts/src/tests/test_aggregator_proxy.cairo +++ b/contracts/src/tests/test_aggregator_proxy.cairo @@ -17,7 +17,7 @@ use chainlink::ocr2::mocks::mock_aggregator::{ // use chainlink::ocr2::aggregator::{IAggregator, IAggregatorDispatcher, IAggregatorDispatcherTrait}; use chainlink::ocr2::aggregator_proxy::AggregatorProxy; use chainlink::ocr2::aggregator_proxy::AggregatorProxy::{ - AggregatorProxyImpl, AggregatorProxyInternal, AccessControllerImpl + AggregatorProxyImpl, AggregatorProxyInternal, AccessControllerImpl, UpgradeableImpl }; use chainlink::ocr2::aggregator::Round; use chainlink::utils::split_felt; @@ -95,7 +95,7 @@ fn test_access_control() { fn test_upgrade_non_owner() { let (_, _, _, _, _) = setup(); let mut state = STATE(); - AggregatorProxy::upgrade(ref state, class_hash_const::<123>()); + UpgradeableImpl::upgrade(ref state, class_hash_const::<123>()); } fn test_query_latest_round_data() { diff --git a/contracts/src/tests/test_link_token.cairo b/contracts/src/tests/test_link_token.cairo index 111d4d951..fa78d4fd7 100644 --- a/contracts/src/tests/test_link_token.cairo +++ b/contracts/src/tests/test_link_token.cairo @@ -13,7 +13,7 @@ use option::OptionTrait; use core::result::ResultTrait; use chainlink::token::link_token::LinkToken; -use chainlink::token::link_token::LinkToken::{MintableToken, ERC20Impl}; +use chainlink::token::link_token::LinkToken::{MintableToken, ERC20Impl, UpgradeableImpl}; use chainlink::tests::test_ownable::should_implement_ownable; // only tests link token specific functionality @@ -152,6 +152,6 @@ fn test_upgrade_non_owner() { let mut state = STATE(); LinkToken::constructor(ref state, sender, contract_address_const::<111>()); - LinkToken::upgrade(ref state, class_hash_const::<123>()); + UpgradeableImpl::upgrade(ref state, class_hash_const::<123>()); } diff --git a/contracts/src/token/link_token.cairo b/contracts/src/token/link_token.cairo index 6134de169..0d793c9ea 100644 --- a/contracts/src/token/link_token.cairo +++ b/contracts/src/token/link_token.cairo @@ -21,7 +21,7 @@ mod LinkToken { use openzeppelin::token::erc20::interface::{IERC20, IERC20Dispatcher, IERC20DispatcherTrait}; use chainlink::libraries::token::erc677::ERC677; use chainlink::libraries::ownable::{Ownable, IOwnable}; - use chainlink::libraries::upgradeable::Upgradeable; + use chainlink::libraries::upgradeable::{Upgradeable, IUpgradeable}; const NAME: felt252 = 'ChainLink Token'; const SYMBOL: felt252 = 'LINK'; @@ -86,10 +86,12 @@ mod LinkToken { // Upgradeable // #[external(v0)] - fn upgrade(ref self: ContractState, new_impl: ClassHash) { - let ownable = Ownable::unsafe_new_contract_state(); - Ownable::assert_only_owner(@ownable); - Upgradeable::upgrade(new_impl) + impl UpgradeableImpl of IUpgradeable { + fn upgrade(ref self: ContractState, new_impl: ClassHash) { + let ownable = Ownable::unsafe_new_contract_state(); + Ownable::assert_only_owner(@ownable); + Upgradeable::upgrade(new_impl) + } } // From ea71a8dec37437c256fc1ee20a5a07f92606fee9 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Tue, 3 Oct 2023 15:21:58 +0800 Subject: [PATCH 6/6] use upgradeable interface for multisig --- contracts/src/multisig.cairo | 16 +++++++++------- contracts/src/tests/test_multisig.cairo | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/contracts/src/multisig.cairo b/contracts/src/multisig.cairo index 3aae1181f..3d6ffe6e1 100644 --- a/contracts/src/multisig.cairo +++ b/contracts/src/multisig.cairo @@ -50,7 +50,6 @@ trait IMultisig { fn is_executed(self: @TContractState, nonce: u128) -> bool; fn get_transaction(self: @TContractState, nonce: u128) -> (Transaction, Array::); fn type_and_version(self: @TContractState) -> felt252; - fn upgrade(ref self: TContractState, new_impl: ClassHash); fn submit_transaction( ref self: TContractState, to: ContractAddress, @@ -93,7 +92,7 @@ mod Multisig { use starknet::storage_write_syscall; use starknet::class_hash::ClassHash; - use chainlink::libraries::upgradeable::Upgradeable; + use chainlink::libraries::upgradeable::{Upgradeable, IUpgradeable}; #[event] #[derive(Drop, starknet::Event)] @@ -162,6 +161,14 @@ mod Multisig { self._set_threshold(threshold); } + #[external(v0)] + impl UpgradeableImpl of IUpgradeable { + fn upgrade(ref self: ContractState, new_impl: ClassHash) { + self._require_multisig(); + Upgradeable::upgrade(new_impl) + } + } + #[external(v0)] impl MultisigImpl of super::IMultisig { /// Views @@ -214,11 +221,6 @@ mod Multisig { /// Externals - fn upgrade(ref self: ContractState, new_impl: ClassHash) { - self._require_multisig(); - Upgradeable::upgrade(new_impl) - } - fn submit_transaction( ref self: ContractState, to: ContractAddress, diff --git a/contracts/src/tests/test_multisig.cairo b/contracts/src/tests/test_multisig.cairo index 179dd3472..8976eafa5 100644 --- a/contracts/src/tests/test_multisig.cairo +++ b/contracts/src/tests/test_multisig.cairo @@ -12,7 +12,7 @@ use traits::TryInto; use chainlink::multisig::assert_unique_values; use chainlink::multisig::Multisig; -use chainlink::multisig::Multisig::MultisigImpl; +use chainlink::multisig::Multisig::{MultisigImpl, UpgradeableImpl}; #[starknet::contract] mod MultisigTest { @@ -288,7 +288,7 @@ fn test_upgrade_not_multisig() { let account = contract_address_const::<777>(); set_caller_address(account); - MultisigImpl::upgrade(ref state, class_hash_const::<1>()) + UpgradeableImpl::upgrade(ref state, class_hash_const::<1>()) } #[test]