Skip to content

Commit ef5ce60

Browse files
committed
Satisfy linters
1 parent 76d6c36 commit ef5ce60

File tree

1 file changed

+9
-2
lines changed
  • pallets/subtensor/src/utils

1 file changed

+9
-2
lines changed

pallets/subtensor/src/utils/evm.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ const MESSAGE_PREFIX: &str = "\x19Ethereum Signed Message:\n";
1111
impl<T: Config> Pallet<T> {
1212
pub(crate) fn hash_message_eip191<M: AsRef<[u8]>>(message: M) -> [u8; 32] {
1313
let msg_len = message.as_ref().len().to_string();
14-
keccak_256(&[MESSAGE_PREFIX.as_bytes(), msg_len.as_bytes(), message.as_ref()].concat())
14+
keccak_256(
15+
&[
16+
MESSAGE_PREFIX.as_bytes(),
17+
msg_len.as_bytes(),
18+
message.as_ref(),
19+
]
20+
.concat(),
21+
)
1522
}
1623

1724
/// Associate an EVM key with a hotkey.
@@ -50,7 +57,7 @@ impl<T: Config> Pallet<T> {
5057

5158
// Normalize the v value to 0 or 1
5259
if signature.0[64] >= 27 {
53-
signature.0[64] -= 27;
60+
signature.0[64] = signature.0[64].saturating_sub(27);
5461
}
5562

5663
let uid = Self::get_uid_for_net_and_hotkey(netuid, &hotkey)?;

0 commit comments

Comments
 (0)