@@ -31,9 +31,7 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
31
31
constructor ( private readonly _extensionUri : vscode . Uri ) { }
32
32
33
33
async _osmiumWatcherCallback ( uri : vscode . Uri ) {
34
- if ( ! this . _view ) {
35
- return ;
36
- }
34
+ if ( ! this . _view ) { return ; }
37
35
const basename = path . basename ( uri . fsPath , '.json' ) ;
38
36
if ( basename === 'contracts' ) {
39
37
this . _interactContractRepository ?. load ( ) ;
@@ -202,15 +200,9 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
202
200
walletPk : 'Enter private key' ,
203
201
walletRpc : 'Enter rpc' ,
204
202
} ) ;
205
- if ( ! inputs ) {
206
- return ;
207
- }
208
- if ( ! inputs . walletAddress . startsWith ( '0x' ) || ! inputs . walletPk . startsWith ( '0x' ) ) {
209
- return ;
210
- }
211
- if ( ! inputs . walletRpc . startsWith ( 'http' ) && ! inputs . walletRpc . startsWith ( 'ws' ) ) {
212
- return ;
213
- }
203
+ if ( ! inputs ) { return ; }
204
+ if ( ! inputs . walletAddress . startsWith ( '0x' ) || ! inputs . walletPk . startsWith ( '0x' ) ) { return ; }
205
+ if ( ! inputs . walletRpc . startsWith ( 'http' ) && ! inputs . walletRpc . startsWith ( 'ws' ) ) { return ; }
214
206
215
207
this . _walletRepository . createWallet (
216
208
inputs . walletName ,
@@ -228,9 +220,7 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
228
220
ignoreFocusOut : true ,
229
221
} ,
230
222
) ;
231
- if ( ! walletName ) {
232
- return ;
233
- }
223
+ if ( ! walletName ) { return ; }
234
224
this . _walletRepository . deleteWallet ( walletName ) ;
235
225
}
236
226
break ;
@@ -248,12 +238,8 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
248
238
contractRpc : 'Enter rpc' ,
249
239
contractChainId : 'Enter chain id' ,
250
240
} ) ;
251
- if ( ! inputs || ! inputs . contractAddress . startsWith ( '0x' ) ) {
252
- return ;
253
- }
254
- if ( ! inputs . contractRpc . startsWith ( 'http' ) && ! inputs . contractRpc . startsWith ( 'ws' ) ) {
255
- return ;
256
- }
241
+ if ( ! inputs || ! inputs . contractAddress . startsWith ( '0x' ) ) { return ; }
242
+ if ( ! inputs . contractRpc . startsWith ( 'http' ) && ! inputs . contractRpc . startsWith ( 'ws' ) ) { return ; }
257
243
this . _interactContractRepository . createContract (
258
244
< Address > inputs [ 'contractAddress' ] ,
259
245
JSON . parse ( inputs [ 'contractAbi' ] ) ,
@@ -270,9 +256,7 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
270
256
ignoreFocusOut : true ,
271
257
} ,
272
258
) ;
273
- if ( ! contractName ) {
274
- return ;
275
- }
259
+ if ( ! contractName ) { return ; }
276
260
this . _interactContractRepository . deleteContract ( contractName ) ;
277
261
}
278
262
break ;
@@ -286,12 +270,8 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
286
270
environmentName : 'Enter name' ,
287
271
environmentRpc : 'Enter rpc' ,
288
272
} ) ;
289
- if ( ! inputs ) {
290
- return ;
291
- }
292
- if ( ! inputs . environmentRpc . startsWith ( 'http' ) && ! inputs . environmentRpc . startsWith ( 'ws' ) ) {
293
- return ;
294
- }
273
+ if ( ! inputs ) { return ; }
274
+ if ( ! inputs . environmentRpc . startsWith ( 'http' ) && ! inputs . environmentRpc . startsWith ( 'ws' ) ) { return ; }
295
275
296
276
this . _environmentRepository . createEnvironment ( inputs . environmentName , < RpcUrl > inputs . environmentRpc ) ;
297
277
}
@@ -303,9 +283,7 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
303
283
ignoreFocusOut : true ,
304
284
} ,
305
285
) ;
306
- if ( ! environmentName ) {
307
- return ;
308
- }
286
+ if ( ! environmentName ) { return ; }
309
287
this . _environmentRepository . deleteEnvironment ( environmentName ) ;
310
288
}
311
289
break ;
0 commit comments