Skip to content

Commit 54f1d33

Browse files
committed
chore: rename parse_hotkey to parse_ss58
1 parent cd366c5 commit 54f1d33

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

runtime/src/precompiles/staking.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl StakingPrecompile {
6969
}
7070

7171
fn add_stake(handle: &mut impl PrecompileHandle, data: &[u8]) -> PrecompileResult {
72-
let hotkey = Self::parse_hotkey(data)?.into();
72+
let hotkey = Self::parse_ss58(data)?.into();
7373
let amount: U256 = handle.context().apparent_value;
7474

7575
// TODO: Use netuid method parameter here
@@ -89,7 +89,7 @@ impl StakingPrecompile {
8989
Self::dispatch(handle, call)
9090
}
9191
fn remove_stake(handle: &mut impl PrecompileHandle, data: &[u8]) -> PrecompileResult {
92-
let hotkey = Self::parse_hotkey(data)?.into();
92+
let hotkey = Self::parse_ss58(data)?.into();
9393

9494
// TODO: Use netuid method parameter here
9595
let netuid: u16 = 0;
@@ -114,8 +114,8 @@ impl StakingPrecompile {
114114
}
115115

116116
fn get_stake_coldkey(data: &[u8]) -> PrecompileResult {
117-
// TODO: rename parse_hotkey to parse_key or something?
118-
let coldkey: AccountId32 = Self::parse_hotkey(data)?.into();
117+
// TODO: rename parse_ss58 to parse_key or something?
118+
let coldkey: AccountId32 = Self::parse_ss58(data)?.into();
119119

120120
// get total stake of coldkey
121121
let total_stake = pallet_subtensor::TotalColdkeyStake::<Runtime>::get(coldkey);
@@ -129,7 +129,7 @@ impl StakingPrecompile {
129129
})
130130
}
131131

132-
fn parse_hotkey(data: &[u8]) -> Result<[u8; 32], PrecompileFailure> {
132+
fn parse_ss58(data: &[u8]) -> Result<[u8; 32], PrecompileFailure> {
133133
if data.len() < 32 {
134134
return Err(PrecompileFailure::Error {
135135
exit_status: ExitError::InvalidRange,

0 commit comments

Comments
 (0)