Skip to content

Commit ab4d6e1

Browse files
committed
Rename amount back to amount_staked in add_stake parameters
1 parent f0534f1 commit ab4d6e1

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

pallets/subtensor/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,11 +1781,11 @@ where
17811781
Some(Call::add_stake {
17821782
hotkey,
17831783
netuid,
1784-
amount,
1784+
amount_staked,
17851785
}) => {
17861786
// Fully validate the user input
17871787
Self::result_to_validity(Pallet::<T>::validate_add_stake(
1788-
who, hotkey, *netuid, *amount,
1788+
who, hotkey, *netuid, *amount_staked,
17891789
))
17901790
}
17911791
Some(Call::remove_stake {

pallets/subtensor/src/macros/dispatches.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,9 @@ mod dispatches {
584584
origin: OriginFor<T>,
585585
hotkey: T::AccountId,
586586
netuid: u16,
587-
amount: u64,
587+
amount_staked: u64,
588588
) -> DispatchResult {
589-
Self::do_add_stake(origin, hotkey, netuid, amount)
589+
Self::do_add_stake(origin, hotkey, netuid, amount_staked)
590590
}
591591

592592
/// Remove stake from the staking account. The call must be made

pallets/subtensor/src/tests/staking.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ use sp_core::{Get, H256, U256};
1919
fn test_add_stake_dispatch_info_ok() {
2020
new_test_ext(1).execute_with(|| {
2121
let hotkey = U256::from(0);
22-
let amount = 5000;
22+
let amount_staked = 5000;
2323
let netuid = 1;
2424
let call = RuntimeCall::SubtensorModule(SubtensorCall::add_stake {
2525
hotkey,
2626
netuid,
27-
amount,
27+
amount_staked,
2828
});
2929
assert_eq!(
3030
call.get_dispatch_info(),
@@ -2075,17 +2075,17 @@ fn test_stake_below_min_validate() {
20752075
let subnet_owner_hotkey = U256::from(1002);
20762076
let hotkey = U256::from(2);
20772077
let coldkey = U256::from(3);
2078-
let amount = DefaultMinStake::<Test>::get() + DefaultStakingFee::<Test>::get() - 1;
2078+
let amount_staked = DefaultMinStake::<Test>::get() + DefaultStakingFee::<Test>::get() - 1;
20792079

20802080
let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey);
20812081
SubtensorModule::create_account_if_non_existent(&coldkey, &hotkey);
2082-
SubtensorModule::add_balance_to_coldkey_account(&coldkey, amount);
2082+
SubtensorModule::add_balance_to_coldkey_account(&coldkey, amount_staked);
20832083

20842084
// Add stake call
20852085
let call = RuntimeCall::SubtensorModule(SubtensorCall::add_stake {
20862086
hotkey,
20872087
netuid,
2088-
amount,
2088+
amount_staked,
20892089
});
20902090

20912091
let info: crate::DispatchInfo =
@@ -2104,11 +2104,11 @@ fn test_stake_below_min_validate() {
21042104
);
21052105

21062106
// Increase the stake to be equal to the minimum, but leave the balance low
2107-
let amount = DefaultMinStake::<Test>::get() + DefaultStakingFee::<Test>::get();
2107+
let amount_staked = DefaultMinStake::<Test>::get() + DefaultStakingFee::<Test>::get();
21082108
let call_2 = RuntimeCall::SubtensorModule(SubtensorCall::add_stake {
21092109
hotkey,
21102110
netuid,
2111-
amount,
2111+
amount_staked,
21122112
});
21132113

21142114
// Submit to the signed extension validate function

runtime/src/precompiles/staking.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl StakingPrecompile {
8484
let call = RuntimeCall::SubtensorModule(pallet_subtensor::Call::<Runtime>::add_stake {
8585
hotkey,
8686
netuid,
87-
amount: amount_sub.unique_saturated_into(),
87+
amount_staked: amount_sub.unique_saturated_into(),
8888
});
8989
// Dispatch the add_stake call
9090
Self::dispatch(handle, call)

runtime/tests/pallet_proxy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ fn call_senate() -> RuntimeCall {
103103
// staking call
104104
fn call_add_stake() -> RuntimeCall {
105105
let netuid = 1;
106-
let amount = 100;
106+
let amount_staked = 100;
107107
RuntimeCall::SubtensorModule(pallet_subtensor::Call::add_stake {
108108
hotkey: AccountId::from(DELEGATE),
109109
netuid,
110-
amount,
110+
amount_staked,
111111
})
112112
}
113113

0 commit comments

Comments
 (0)