Skip to content

Commit

Permalink
fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
renauter committed Jul 25, 2023
1 parent f9c48a9 commit 75bbfc1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 13. Untrack GPU status on a node
# 14. Untrack GPU status on a node

Date: 2023-06-22

Expand Down
1 change: 1 addition & 0 deletions substrate-node/pallets/pallet-tfgrid/src/migrations/v16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use frame_support::{
weights::Weight,
};
use log::info;
use sp_core::Get;
use sp_std::marker::PhantomData;

pub struct KillNodeGpuStatus<T: Config>(PhantomData<T>);
Expand Down
24 changes: 0 additions & 24 deletions substrate-node/pallets/pallet-tfgrid/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,30 +385,6 @@ impl<T: Config> Pallet<T> {
});
}

pub fn _set_node_gpu_status(
account_id: &T::AccountId,
gpu_status: bool,
) -> DispatchResultWithPostInfo {
let twin_id = TwinIdByAccountID::<T>::get(account_id).ok_or(Error::<T>::TwinNotExists)?;

ensure!(
NodeIdByTwinID::<T>::contains_key(twin_id),
Error::<T>::NodeNotExists
);
let node_id = NodeIdByTwinID::<T>::get(twin_id);

ensure!(Nodes::<T>::contains_key(node_id), Error::<T>::NodeNotExists);

NodeGpuStatus::<T>::insert(node_id, gpu_status);

Self::deposit_event(Event::NodeGpuStatusChanged {
node_id,
gpu_status,
});

Ok(Pays::No.into())
}

fn get_resources(
resources: pallet::ResourcesInput,
) -> Result<Resources, DispatchErrorWithPostInfo> {
Expand Down

0 comments on commit 75bbfc1

Please sign in to comment.