-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update suggestions according to PR review
- Loading branch information
Showing
6 changed files
with
79 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,51 @@ | ||
export { run } from '@oclif/core'; | ||
import { Flags, Command } from '@oclif/core'; | ||
import { select } from '@inquirer/prompts'; | ||
import checkEligibility from './applications/check-eligibility'; | ||
import submitClaim from './applications/submit-claim'; | ||
import publishMultisigClaim from './applications/publish-multisig-claim'; | ||
import { Mainnet, Testnet } from './utils/'; | ||
|
||
enum Choice { | ||
CHECK_ELIGIBILITY, | ||
SUBMIT_CLAIM, | ||
SUBMIT_MULTISIG_CLAIM, | ||
} | ||
|
||
export default class Start extends Command { | ||
static flags = { | ||
network: Flags.string({ | ||
description: 'Operating network for the tool to run.', | ||
required: false, | ||
default: 'mainnet', | ||
options: ['mainnet', 'testnet'], | ||
}), | ||
}; | ||
|
||
static description = 'Start Lisk Claim CLI Tool.'; | ||
|
||
static examples = [`$ oex claim-cli`]; | ||
|
||
async run(): Promise<void> { | ||
const { flags } = await this.parse(Start); | ||
const { network } = flags; | ||
|
||
console.log(`Welcome to Lisk Migration CLI (Running on "${network}" Network)`); | ||
const answer = await select({ | ||
message: 'Please enter your choices', | ||
choices: [ | ||
{ name: 'Check my Eligibility', value: Choice.CHECK_ELIGIBILITY }, | ||
{ name: 'Submit a Claim', value: Choice.SUBMIT_CLAIM }, | ||
{ | ||
name: 'Publish a Multisig claim with completed signatures onchain', | ||
value: Choice.SUBMIT_MULTISIG_CLAIM, | ||
}, | ||
], | ||
}); | ||
|
||
const networkParams = { | ||
mainnet: Mainnet, | ||
testnet: Testnet, | ||
}[network as 'mainnet' | 'testnet']; | ||
await [checkEligibility, submitClaim, publishMultisigClaim][answer](networkParams); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters