Skip to content

Commit

Permalink
remove semi-colons and format
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlbui committed Jul 19, 2024
1 parent fb7dd65 commit 49936c6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/node-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export function registerNodeCommands(program: Command) {
});
});

program
program
.command('stake_info')
.description('Show staking info for a particular EOA account')
.argument('<address>', 'The EOA address to fetch stake info for')
Expand All @@ -432,24 +432,24 @@ export function registerNodeCommands(program: Command) {
}

try {
const eoaData = await fetchEOADetails(config, address);
const stakeValue = eoaData?.operatorAccountInfo?.stake?.value;
const nominee = eoaData?.operatorAccountInfo?.nominee ?? '';
const eoaData = await fetchEOADetails(config, address)
const stakeValue = eoaData?.operatorAccountInfo?.stake?.value
const nominee = eoaData?.operatorAccountInfo?.nominee ?? ''

// Convert stake value to ether, handling potential hexadecimal input
const stakeOutput = stakeValue
? ethers.utils.formatEther(
ethers.BigNumber.from(stakeValue.startsWith('0x') ? stakeValue : '0x' + stakeValue).toString()
)
: '';
: ''

console.log(yaml.dump({
stake: stakeOutput,
nominee: nominee
}));
} catch (error) {
console.log(error);
console.error(`Error fetching stake details for ${address}: ${error}`);
console.log(error)
console.error(`Error fetching stake details for ${address}: ${error}`)
}
});

Expand Down

0 comments on commit 49936c6

Please sign in to comment.