File tree Expand file tree Collapse file tree 4 files changed +29
-24
lines changed Expand file tree Collapse file tree 4 files changed +29
-24
lines changed Original file line number Diff line number Diff line change 1
- ███████╗████████╗ █████╗ ███╗ ██╗██████╗ ██████╗ ██╗ ██╗ ███████╗███████╗████████╗████████╗██╗███╗ ██╗ ██████╗ ██╗ ██╗██████╗
2
- ██╔════╝╚══██╔══╝██╔══██╗████╗ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝ ██╔════╝██╔════╝╚══██╔══╝╚══██╔══╝██║████╗ ██║██╔════╝ ██║ ██║██╔══██╗
3
- ███████╗ ██║ ███████║██╔██╗ ██║██║ ██║██████╔╝ ╚████╔╝ ███████╗█████╗ ██║ ██║ ██║██╔██╗ ██║██║ ███╗ ██║ ██║██████╔╝
4
- ╚════██║ ██║ ██╔══██║██║╚██╗██║██║ ██║██╔══██╗ ╚██╔╝ ╚════██║██╔══╝ ██║ ██║ ██║██║╚██╗██║██║ ██║ ██║ ██║██╔═══╝
5
- ███████║ ██║ ██║ ██║██║ ╚████║██████╔╝██████╔╝ ██║ ███████║███████╗ ██║ ██║ ██║██║ ╚████║╚██████╔╝ ╚██████╔╝██║
6
- ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═╝ ╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═╝
1
+ ███╗ ██╗ █████╗ ██████╗ ███╗ ███╗ ██████╗ ██████╗ ███████╗
2
+ ████╗ ██║██╔══██╗██╔══██╗ ████╗ ████║██╔═══██╗██╔══██╗██╔════╝
3
+ ██╔██╗ ██║███████║██████╔╝ ██╔████╔██║██║ ██║██║ ██║█████╗
4
+ ██║╚██╗██║██╔══██║██╔═══╝ ██║╚██╔╝██║██║ ██║██║ ██║██╔══╝
5
+ ██║ ╚████║██║ ██║██║ ██║ ╚═╝ ██║╚██████╔╝██████╔╝███████╗
6
+ ╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝
7
+ ██████╗ ███████╗ ██████╗ █████╗ ██████╗██╗ ██╗ ██████╗ ███╗ ██╗ ██╗███╗ ██╗ █████╗ ██████╗ ██╗████████╗
8
+ ██╔══██╗██╔════╝ ██╔══██╗██╔══██╗██╔════╝██║ ██╔╝ ██╔═══██╗████╗ ██║ ██║████╗ ██║ ██╔══██╗ ██╔══██╗██║╚══██╔══╝
9
+ ██████╔╝█████╗ ██████╔╝███████║██║ █████╔╝ ██║ ██║██╔██╗ ██║ ██║██╔██╗ ██║ ███████║ ██████╔╝██║ ██║
10
+ ██╔══██╗██╔══╝ ██╔══██╗██╔══██║██║ ██╔═██╗ ██║ ██║██║╚██╗██║ ██║██║╚██╗██║ ██╔══██║ ██╔══██╗██║ ██║
11
+ ██████╔╝███████╗ ██████╔╝██║ ██║╚██████╗██║ ██╗ ╚██████╔╝██║ ╚████║ ██║██║ ╚████║ ██║ ██║ ██████╔╝██║ ██║
12
+ ╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
Original file line number Diff line number Diff line change @@ -127,24 +127,6 @@ export function getDirectoryStructure(folderPath) {
127
127
} ) ;
128
128
return tree ;
129
129
}
130
- export async function ensureDirLegacy ( folderPath ) {
131
- const directories = normalize ( folderPath ) . split ( path . sep ) ;
132
- let currentPath = `${ path . sep } ` ;
133
- for ( const dir of directories ) {
134
- if ( dir . length ) {
135
- currentPath = path . join ( currentPath , dir ) ;
136
- try {
137
- await stat ( currentPath ) ;
138
- } catch {
139
- try {
140
- await mkdir ( currentPath ) ;
141
- } catch {
142
- console . log ( 'Error creating folder' , currentPath ) ;
143
- }
144
- }
145
- }
146
- }
147
- }
148
130
export async function ensureDirectoryPath ( filePath ) {
149
131
const pathNormalized = normalize ( filePath ) ;
150
132
return fsExtra . ensureDir ( path . dirname ( pathNormalized ) ) ;
Original file line number Diff line number Diff line change
1
+ import ed25519 from '#crypto/signature/ed25519.js' ;
2
+ import { encodeStrict } from '#utilities/serialize' ;
3
+ import { hashLegacyAddress } from '#crypto/hash/shake256' ;
4
+ export async function generateAddress ( publicKey , type , version = 0 ) {
5
+ const domained = await encodeStrict ( {
6
+ type,
7
+ version,
8
+ publicKey,
9
+ } ) ;
10
+ if ( this . cipherSuite . walletSize === 20 ) {
11
+ return this . cipherSuite . hash . hashLegacyAddress ( domained ) ;
12
+ } else if ( this . cipherSuite . walletSize === 32 ) {
13
+ return this . cipherSuite . hash . hash256 ( domained ) ;
14
+ } else if ( this . cipherSuite . walletSize === 64 ) {
15
+ return this . cipherSuite . hash . hash512 ( domained ) ;
16
+ }
17
+ }
You can’t perform that action at this time.
0 commit comments