Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add various 'at-block' programs and 'chain' programs #5

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

infloop
Copy link
Contributor

@infloop infloop commented Apr 21, 2023

No description provided.

@infloop infloop requested a review from avsetsin April 21, 2023 08:00
router
.command('modules-at-block')
.description('returns staking modules')
.argument('<block-tag>', 'blockTag')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it's better to add an option with the default value latest to modules command?

programs/dsm.ts Outdated
const lastDepositBlock = await stakingRouterContract.getStakingModuleLastDepositBlock(moduleId);
const minDepositBlockDistance = await dsmContract.getMinDepositBlockDistance();

const result = BigInt(block.number) - BigInt(lastDepositBlock) >= BigInt(minDepositBlockDistance);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a regular Number? it should be in the range

.description('returns the closest report for specific block')
.argument('<block-tag>', 'blockTag')
.action(async (blockTag) => {
const report = await getClosestReport(contract, parseInt(blockTag, 10));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would suggest keep 1 command but with option with default value latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants