Skip to content

Commit

Permalink
add: usage warning to convert-address cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
pLabarta committed Jan 19, 2024
1 parent ced8c7f commit 15c1634
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cli/src/commands/convertAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@ function convertAddressAction(options: OptionValues) {
const type = address.type;
if (type === 'EVM') {
console.log(`AssociatedSubstrate address: ${evmAddressToSubstrateAddress(address.address)}`);
printUsageWarning();
} else if (type === 'Substrate') {
console.log(`Associated EVM address: ${substrateAddressToEvmAddress(address.address)}`);
printUsageWarning();
} else {
console.error('Invalid address type');
process.exit(1);
}
process.exit(0);
}

function printUsageWarning ()
{
console.log("");
console.log(
'⚠️ Warning: This command is not cyclical. You will NOT get the original address back by running this command with the converted address.',
);
}

0 comments on commit 15c1634

Please sign in to comment.