Skip to content

Commit

Permalink
add --accept for bridge register
Browse files Browse the repository at this point in the history
  • Loading branch information
fewensa committed Jul 25, 2024
1 parent 293ea43 commit 04b8c06
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ helixbridge
helixbridge register
--group=mainnet
--datadir=/path/to/config
--accept
encrypt encrypt a private key
helixbridge encrypt
Expand Down
26 changes: 15 additions & 11 deletions src/register/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,22 @@ async function handle(options) {
return;
}

await safe.init(options);
switch (register.type) {
case 'lnv3':
await lnv3.register(options);
break;
case 'lnv2-default':
await lnv2Default.register(options);
break;
case 'lnv2-opposite':
await lnv2Opposite.register(options);
break;
const accepted = arg.option('accept');
if (accepted) {
await safe.init(options);
switch (register.type) {
case 'lnv3':
await lnv3.register(options);
break;
case 'lnv2-default':
await lnv2Default.register(options);
break;
case 'lnv2-opposite':
await lnv2Opposite.register(options);
break;
}
}

await ensureLock(ensureLockOptions, true);
console.log(chalk.green(`the bridge ${_identifyRegisterName(register)} registered`));
}
Expand Down

0 comments on commit 04b8c06

Please sign in to comment.