@@ -40,7 +40,7 @@ describe('PeerId', () => {
40
40
41
41
it ( 'can be created for a secp256k1 key' , async ( ) => {
42
42
const id = await PeerIdFactory . createSecp256k1PeerId ( )
43
- const expB58 = base58btc . encode ( ( await identity . digest ( id . publicKey ) ) . bytes ) . slice ( 1 )
43
+ const expB58 = base58btc . encode ( ( identity . digest ( id . publicKey ) ) . bytes ) . slice ( 1 )
44
44
expect ( id . toString ( ) ) . to . equal ( expB58 )
45
45
} )
46
46
@@ -154,33 +154,33 @@ describe('PeerId', () => {
154
154
155
155
it ( 'recreate from embedded ed25519 key' , async ( ) => {
156
156
const key = '12D3KooWRm8J3iL796zPFi2EtGGtUJn58AG67gcqzMFHZnnsTzqD'
157
- const id = await peerIdFromString ( key )
157
+ const id = peerIdFromString ( key )
158
158
expect ( id . toString ( ) ) . to . equal ( key )
159
159
160
160
if ( id . publicKey == null ) {
161
161
throw new Error ( 'No pubic key found on Ed25519 key' )
162
162
}
163
163
164
- const expB58 = base58btc . encode ( ( await identity . digest ( id . publicKey ) ) . bytes ) . slice ( 1 )
164
+ const expB58 = base58btc . encode ( ( identity . digest ( id . publicKey ) ) . bytes ) . slice ( 1 )
165
165
expect ( id . toString ( ) ) . to . equal ( expB58 )
166
166
} )
167
167
168
168
it ( 'recreate from embedded secp256k1 key' , async ( ) => {
169
169
const key = '16Uiu2HAm5qw8UyXP2RLxQUx5KvtSN8DsTKz8quRGqGNC3SYiaB8E'
170
- const id = await peerIdFromString ( key )
170
+ const id = peerIdFromString ( key )
171
171
expect ( id . toString ( ) ) . to . equal ( key )
172
172
173
173
if ( id . publicKey == null ) {
174
174
throw new Error ( 'No pubic key found on secp256k1 key' )
175
175
}
176
176
177
- const expB58 = base58btc . encode ( ( await identity . digest ( id . publicKey ) ) . bytes ) . slice ( 1 )
177
+ const expB58 = base58btc . encode ( ( identity . digest ( id . publicKey ) ) . bytes ) . slice ( 1 )
178
178
expect ( id . toString ( ) ) . to . equal ( expB58 )
179
179
} )
180
180
181
181
it ( 'recreate from string key' , async ( ) => {
182
182
const key = 'QmRsooYQasV5f5r834NSpdUtmejdQcpxXkK6qsozZWEihC'
183
- const id = await peerIdFromString ( key )
183
+ const id = peerIdFromString ( key )
184
184
expect ( id . toString ( ) ) . to . equal ( key )
185
185
} )
186
186
@@ -192,7 +192,7 @@ describe('PeerId', () => {
192
192
throw new Error ( 'No public key found on peer id created from secp256k1 public key' )
193
193
}
194
194
195
- const expB58 = base58btc . encode ( ( await identity . digest ( id . publicKey ) ) . bytes ) . slice ( 1 )
195
+ const expB58 = base58btc . encode ( ( identity . digest ( id . publicKey ) ) . bytes ) . slice ( 1 )
196
196
expect ( id . toString ( ) ) . to . equal ( expB58 )
197
197
} )
198
198
@@ -204,7 +204,7 @@ describe('PeerId', () => {
204
204
throw new Error ( 'No public key found on peer id created from secp256k1 private key' )
205
205
}
206
206
207
- const expB58 = base58btc . encode ( ( await identity . digest ( id . publicKey ) ) . bytes ) . slice ( 1 )
207
+ const expB58 = base58btc . encode ( ( identity . digest ( id . publicKey ) ) . bytes ) . slice ( 1 )
208
208
expect ( id . toString ( ) ) . to . equal ( expB58 )
209
209
} )
210
210
0 commit comments