From 4e74dcc41d1b730d8c600b6ad7bc7164914ffb97 Mon Sep 17 00:00:00 2001 From: Andrei Baltariu Date: Wed, 13 Nov 2024 16:50:04 +0200 Subject: [PATCH] Added empty endpoint for completing setup_phase Signed-off-by: Andrei Baltariu --- chain-factory/src/factory.rs | 6 ++++++ chain-factory/wasm-chain-factory-full/src/lib.rs | 5 +++-- chain-factory/wasm/src/lib.rs | 5 +++-- common/proxies/src/chain_factory_proxy.rs | 13 +++++++++++++ 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/chain-factory/src/factory.rs b/chain-factory/src/factory.rs index f499bfb6..c5cbc081 100644 --- a/chain-factory/src/factory.rs +++ b/chain-factory/src/factory.rs @@ -108,6 +108,12 @@ pub trait FactoryModule: only_admin::OnlyAdminModule { .sync_call() } + #[only_owner] + #[endpoint(completeSetupPhase)] + fn complete_setup_phase(&self, _contract_address: ManagedAddress) { + // TODO: will have to call each contract's endpoint to finish setup phase + } + #[storage_mapper("chainConfigTemplate")] fn chain_config_template(&self) -> SingleValueMapper; diff --git a/chain-factory/wasm-chain-factory-full/src/lib.rs b/chain-factory/wasm-chain-factory-full/src/lib.rs index ac0e9d02..30ad4ca8 100644 --- a/chain-factory/wasm-chain-factory-full/src/lib.rs +++ b/chain-factory/wasm-chain-factory-full/src/lib.rs @@ -6,9 +6,9 @@ // Init: 1 // Upgrade: 1 -// Endpoints: 11 +// Endpoints: 12 // Async Callback (empty): 1 -// Total number of exported functions: 14 +// Total number of exported functions: 15 #![no_std] @@ -24,6 +24,7 @@ multiversx_sc_wasm_adapter::endpoints! { deployHeaderVerifier => deploy_header_verifier deployEnshrineEsdtSafe => deploy_enshrine_esdt_safe deployFeeMarket => deploy_fee_market + completeSetupPhase => complete_setup_phase setMinValidSigners => set_min_valid_signers addSigners => add_signers removeSigners => remove_signers diff --git a/chain-factory/wasm/src/lib.rs b/chain-factory/wasm/src/lib.rs index ac0e9d02..30ad4ca8 100644 --- a/chain-factory/wasm/src/lib.rs +++ b/chain-factory/wasm/src/lib.rs @@ -6,9 +6,9 @@ // Init: 1 // Upgrade: 1 -// Endpoints: 11 +// Endpoints: 12 // Async Callback (empty): 1 -// Total number of exported functions: 14 +// Total number of exported functions: 15 #![no_std] @@ -24,6 +24,7 @@ multiversx_sc_wasm_adapter::endpoints! { deployHeaderVerifier => deploy_header_verifier deployEnshrineEsdtSafe => deploy_enshrine_esdt_safe deployFeeMarket => deploy_fee_market + completeSetupPhase => complete_setup_phase setMinValidSigners => set_min_valid_signers addSigners => add_signers removeSigners => remove_signers diff --git a/common/proxies/src/chain_factory_proxy.rs b/common/proxies/src/chain_factory_proxy.rs index c9c5b1e3..80c3ebe0 100644 --- a/common/proxies/src/chain_factory_proxy.rs +++ b/common/proxies/src/chain_factory_proxy.rs @@ -166,6 +166,19 @@ where .original_result() } + pub fn complete_setup_phase< + Arg0: ProxyArg>, + >( + self, + _contract_address: Arg0, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("completeSetupPhase") + .argument(&_contract_address) + .original_result() + } + pub fn set_min_valid_signers< Arg0: ProxyArg, >(