Skip to content

Commit 9d3218b

Browse files
committed
Add netuid to get_stake in staking precompile
1 parent 5b70ab2 commit 9d3218b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

runtime/src/precompiles/staking.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,12 @@ impl StakingPrecompile {
115115

116116
fn get_stake(data: &[u8]) -> PrecompileResult {
117117
let (hotkey, coldkey) = Self::parse_hotkey_coldkey(data)?;
118+
let netuid = Self::parse_netuid(data, 0x3E)?;
118119

119-
let stake = pallet_subtensor::Pallet::<Runtime>::get_stake_for_coldkey_and_hotkey(
120+
let stake = pallet_subtensor::Pallet::<Runtime>::get_stake_for_hotkey_and_coldkey_on_subnet(
120121
&hotkey.into(),
121122
&coldkey.into(),
123+
netuid,
122124
);
123125

124126
let stake_u256 = U256::from(stake);

0 commit comments

Comments
 (0)