Skip to content

Commit

Permalink
Merge pull request #18 from lidofinance/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
avsetsin authored Oct 24, 2023
2 parents c89c6c2 + 12b41d0 commit a0d3f55
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
19 changes: 19 additions & 0 deletions programs/nor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <number>', 'node operator id')
.option('-l, --limit <number>', '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 <number>', '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')
Expand Down
10 changes: 7 additions & 3 deletions programs/staking-router.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -122,8 +122,12 @@ router
.command('max-deposits')
.description('returns max deposits count for staking module')
.argument('<module-id>', 'module id')
.action(async (moduleId) => {
const deposits = await stakingRouterContract.getStakingModuleMaxDepositsCount(moduleId);
.argument('<max-deposit-value>', 'max deposits value')
.action(async (moduleId, maxDepositsValue) => {
const deposits = await stakingRouterContract.getStakingModuleMaxDepositsCount(
moduleId,
parseEther(maxDepositsValue),
);
logger.log('Max deposits', deposits);
});

Expand Down
8 changes: 8 additions & 0 deletions programs/voting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit a0d3f55

Please sign in to comment.