-
Notifications
You must be signed in to change notification settings - Fork 190
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
Added Staking Information API #929
Added Staking Information API #929
Conversation
blockNumber := uint64(0) | ||
if num == nil || *num == rpc.LatestBlockNumber { | ||
blockNumber = api.governance.blockChain.CurrentHeader().Number.Uint64() | ||
} else if *num == rpc.PendingBlockNumber { | ||
return nil, kerrors.ErrPendingBlockNotSupported | ||
} else { | ||
blockNumber = uint64(num.Int64()) | ||
} | ||
return reward.GetStakingInfo(blockNumber), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many repeated code. I think it can be defined as a function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. This is not only repeated one. Can we update this later with other repeated code fragments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@aidan-kwon @yoomee1313 Please take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Proposed changes
BlockNum
is the block where staking information of Council is fetched.Types of changes
Please put an x in the boxes related to your change.
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
$ make test
)