File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
pallets/subtensor/src/utils Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,14 @@ const MESSAGE_PREFIX: &str = "\x19Ethereum Signed Message:\n";
11
11
impl < T : Config > Pallet < T > {
12
12
pub ( crate ) fn hash_message_eip191 < M : AsRef < [ u8 ] > > ( message : M ) -> [ u8 ; 32 ] {
13
13
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
+ )
15
22
}
16
23
17
24
/// Associate an EVM key with a hotkey.
@@ -50,7 +57,7 @@ impl<T: Config> Pallet<T> {
50
57
51
58
// Normalize the v value to 0 or 1
52
59
if signature. 0 [ 64 ] >= 27 {
53
- signature. 0 [ 64 ] -= 27 ;
60
+ signature. 0 [ 64 ] = signature . 0 [ 64 ] . saturating_sub ( 27 ) ;
54
61
}
55
62
56
63
let uid = Self :: get_uid_for_net_and_hotkey ( netuid, & hotkey) ?;
You can’t perform that action at this time.
0 commit comments