From 6ca40cf1ed30ed246d8094221733b33f67140ca3 Mon Sep 17 00:00:00 2001 From: aidan Date: Thu, 30 May 2024 15:08:29 +0200 Subject: [PATCH] fix: Remove worker related functionality Since the storage providers will handle their own worker addresses it is not needed to include the worker addresses in the pallet implementation. --- pallets/storage-provider/src/lib.rs | 52 ----------------------------- 1 file changed, 52 deletions(-) diff --git a/pallets/storage-provider/src/lib.rs b/pallets/storage-provider/src/lib.rs index 065e943f..a38b7406 100644 --- a/pallets/storage-provider/src/lib.rs +++ b/pallets/storage-provider/src/lib.rs @@ -73,18 +73,10 @@ pub mod pallet { MinerCreated { owner: T::AccountId, }, - ChangeWorkerAddressRequested { - miner: T::MinerAccountId, - new_worker: T::WorkerAddress, - }, PeerIdChanged { miner: T::MinerAccountId, peer_id: PeerId, }, - WorkerAddressChanged { - miner: T::MinerAccountId, - new_worker: T::WorkerAddress, - }, OwnerAddressChanged { miner: T::MinerAccountId, new_owner: T::AccountId, @@ -98,7 +90,6 @@ pub mod pallet { pub fn create_miner( origin: OriginFor, owner: T::AccountId, - _worker: T::WorkerAddress, _peer_id: PeerId, ) -> DispatchResultWithPostInfo { // Check that the extrinsic was signed and get the signer. @@ -112,28 +103,6 @@ pub mod pallet { todo!() } - /// Request to change a worker address for a given miner - #[pallet::call_index(1)] - pub fn change_worker_address( - origin: OriginFor, - miner: T::MinerAccountId, - new_worker: T::WorkerAddress, - ) -> DispatchResultWithPostInfo { - // Check that the extrinsic was signed and get the signer. - let _who = ensure_signed(origin)?; - - // Get miner info from `Miners` with `who` value - // let miner_info = Miners::::try_get(&miner); - - // Ensure who is the owner of the miner - // ensure!(who == miner_info.owner) - - // Flag miner as worker address change - - Self::deposit_event(Event::ChangeWorkerAddressRequested { miner, new_worker }); - todo!() - } - /// Update PeerId associated with a given miner. #[pallet::call_index(2)] pub fn change_peer_id( @@ -156,27 +125,6 @@ pub mod pallet { todo!() } - /// Confirms the change of the worker address initiated by `change_worker_address` - #[pallet::call_index(3)] - pub fn confirm_change_worker_address( - origin: OriginFor, - _miner: T::MinerAccountId, - ) -> DispatchResultWithPostInfo { - // Check that the extrinsic was signed and get the signer. - let _who = ensure_signed(origin)?; - - // Get miner info from `Miners` with `who` value - // let miner_info = Miners::::try_get(&miner); - - // Ensure who is the owner of the miner - // ensure!(who == miner_info.owner) - - // Change worker address and extract `new_worker` for event emitted. - - // Self::deposit_event(Event::WorkerAddressChanged { miner, new_worker }); - todo!() - } - // This function updates the owner address to the given `new_owner` for the given `miner` #[pallet::call_index(4)] pub fn change_owner_address(