Ideas to improve the Creditcoin-cli's 'distribute-rewards' command processor

I know the payout(claiming staking rewards) action should be done within 84 era(or something).

If there is era time-limits,
How about adding some validation logics following that check if an era option value is correct or not.


if ( era < 1 || era > 84 ) {
throw new Error( β€œEra value must be between 1 and 84” );
}

to the code (https://github.com/gluwa/creditcoin/blob/91450dc31ca0d2c494835b24357dc111dd8ecd01/scripts/cc-cli/src/commands/distributeRewards.ts#L59)

4 Likes