Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pallets/admin-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub mod pallet {
/// Event emitted when Bonds Reset is toggled.
BondsResetToggled {
/// The network identifier.
netuid: u16,
netuid: NetUid,
/// Indicates if the Bonds Reset was enabled or disabled.
enabled: bool,
},
Expand Down Expand Up @@ -1625,7 +1625,7 @@ pub mod pallet {
#[pallet::weight((0, DispatchClass::Operational, Pays::No))]
pub fn sudo_set_bonds_reset_enabled(
origin: OriginFor<T>,
netuid: u16,
netuid: NetUid,
enabled: bool,
) -> DispatchResult {
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;
Expand Down
4 changes: 2 additions & 2 deletions pallets/admin-utils/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1785,7 +1785,7 @@ fn test_set_sn_owner_hotkey_root() {
#[test]
fn test_sudo_set_bonds_reset_enabled() {
new_test_ext().execute_with(|| {
let netuid: u16 = 1;
let netuid = NetUid::from(1);
let to_be_set: bool = true;
let sn_owner = U256::from(1);
add_network(netuid, 10);
Expand Down Expand Up @@ -1822,7 +1822,7 @@ fn test_sudo_set_bonds_reset_enabled() {
#[test]
fn test_sudo_set_yuma3_enabled() {
new_test_ext().execute_with(|| {
let netuid: u16 = 1;
let netuid = NetUid::from(1);
let to_be_set: bool = true;
let sn_owner = U256::from(1);
add_network(netuid, 10);
Expand Down
9 changes: 7 additions & 2 deletions precompiles/src/subnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,9 @@ where
#[precompile::public("getBondsResetEnabled(uint16)")]
#[precompile::view]
fn get_bonds_reset_enabled(_: &mut impl PrecompileHandle, netuid: u16) -> EvmResult<bool> {
Ok(pallet_subtensor::BondsResetOn::<R>::get(netuid))
Ok(pallet_subtensor::BondsResetOn::<R>::get(NetUid::from(
netuid,
)))
}

#[precompile::public("setYuma3Enabled(uint16,bool)")]
Expand Down Expand Up @@ -649,7 +651,10 @@ where
netuid: u16,
enabled: bool,
) -> EvmResult<()> {
let call = pallet_admin_utils::Call::<R>::sudo_set_bonds_reset_enabled { netuid, enabled };
let call = pallet_admin_utils::Call::<R>::sudo_set_bonds_reset_enabled {
netuid: netuid.into(),
enabled,
};

handle.try_dispatch_runtime_call::<R, _>(
call,
Expand Down
Loading