From 8530b39441e3223c0469c936398a0f64bcb3eeba Mon Sep 17 00:00:00 2001 From: George Avsetsin Date: Mon, 23 Oct 2023 12:09:55 +0300 Subject: [PATCH 1/3] feat: target validator limit --- programs/nor.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/programs/nor.ts b/programs/nor.ts index 0a12cce..fa478b9 100644 --- a/programs/nor.ts +++ b/programs/nor.ts @@ -88,6 +88,25 @@ nor await authorizedCall(norContract, 'setNodeOperatorStakingLimit', [operatorId, limit]); }); +nor + .command('set-target-limit') + .description('sets target validators limit') + .option('-o, --operator-id ', 'node operator id') + .option('-l, --limit ', 'target limit') + .action(async (options) => { + const { operatorId, limit } = options; + await authorizedCall(norContract, 'updateTargetValidatorsLimits', [operatorId, true, limit]); + }); + +nor + .command('unset-target-limit') + .description('unsets target validators limit') + .option('-o, --operator-id ', 'node operator id') + .action(async (options) => { + const { operatorId } = options; + await authorizedCall(norContract, 'updateTargetValidatorsLimits', [operatorId, false, 0]); + }); + nor .command('penalized-operators') .description('returns penalties for all operators') From c56d47e5049bbbd6579208d5541d58441436ecf2 Mon Sep 17 00:00:00 2001 From: George Avsetsin Date: Mon, 23 Oct 2023 18:42:28 +0300 Subject: [PATCH 2/3] feat: vote time --- programs/voting.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/programs/voting.ts b/programs/voting.ts index d19b881..5d6eb50 100644 --- a/programs/voting.ts +++ b/programs/voting.ts @@ -17,6 +17,14 @@ voting logger.log('Vote', vote.toObject()); }); +voting + .command('vote-time') + .description('returns vote time') + .action(async () => { + const time = await votingContract.voteTime(); + logger.log('Vote time in seconds', Number(time)); + }); + voting .command('votes') .description('returns votes length') From 12b41d019c6d11ee3d0560ef788a115bcc56dc56 Mon Sep 17 00:00:00 2001 From: George Avsetsin Date: Tue, 24 Oct 2023 11:06:46 +0300 Subject: [PATCH 3/3] fix: max deposits value --- programs/staking-router.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/programs/staking-router.ts b/programs/staking-router.ts index f8ab74d..fae246f 100644 --- a/programs/staking-router.ts +++ b/programs/staking-router.ts @@ -1,7 +1,7 @@ import { program } from '@command'; import { stakingRouterContract } from '@contracts'; import { authorizedCall, logger } from '@utils'; -import { Result } from 'ethers'; +import { Result, parseEther } from 'ethers'; import { addAccessControlSubCommands, addLogsCommands, addOssifiableProxyCommands, addParsingCommands } from './common'; import { getNodeOperators, getStakingModules } from './staking-module'; @@ -122,8 +122,12 @@ router .command('max-deposits') .description('returns max deposits count for staking module') .argument('', 'module id') - .action(async (moduleId) => { - const deposits = await stakingRouterContract.getStakingModuleMaxDepositsCount(moduleId); + .argument('', 'max deposits value') + .action(async (moduleId, maxDepositsValue) => { + const deposits = await stakingRouterContract.getStakingModuleMaxDepositsCount( + moduleId, + parseEther(maxDepositsValue), + ); logger.log('Max deposits', deposits); });