File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { v4 as uuid } from 'uuid' ;
2
- import { sha256FromString } from 'ethereumjs-util ' ;
2
+ import { sha256 } from '@noble/hashes/sha256 ' ;
3
3
import { InternalAccount } from '@metamask/keyring-api' ;
4
+ import { toBuffer } from 'ethereumjs-util' ;
4
5
import { ETH_EOA_METHODS } from '../../../shared/constants/eth-methods' ;
5
6
import { migrate } from './105' ;
6
7
@@ -18,7 +19,7 @@ global.sentry = {
18
19
19
20
function addressToUUID ( address : string ) : string {
20
21
return uuid ( {
21
- random : sha256FromString ( address ) . slice ( 0 , 16 ) ,
22
+ random : sha256 ( toBuffer ( address ) ) . slice ( 0 , 16 ) ,
22
23
} ) ;
23
24
}
24
25
Original file line number Diff line number Diff line change 1
1
import { EthAccountType , InternalAccount } from '@metamask/keyring-api' ;
2
- import { sha256FromString } from 'ethereumjs-util' ;
2
+ import { sha256 } from '@noble/hashes/sha256' ;
3
+ import { toBuffer } from 'ethereumjs-util' ;
3
4
import { v4 as uuid } from 'uuid' ;
4
5
import { cloneDeep } from 'lodash' ;
5
6
import { ETH_EOA_METHODS } from '../../../shared/constants/eth-methods' ;
@@ -87,7 +88,7 @@ function createInternalAccountsForAccountsController(
87
88
88
89
Object . values ( identities ) . forEach ( ( identity ) => {
89
90
const expectedId = uuid ( {
90
- random : sha256FromString ( identity . address ) . slice ( 0 , 16 ) ,
91
+ random : sha256 ( toBuffer ( identity . address ) ) . slice ( 0 , 16 ) ,
91
92
} ) ;
92
93
93
94
accounts [ expectedId ] = {
You can’t perform that action at this time.
0 commit comments