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

Staking contract query - block_height from past #19

Open
pronvis opened this issue Nov 3, 2021 · 1 comment
Open

Staking contract query - block_height from past #19

pronvis opened this issue Nov 3, 2021 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@pronvis
Copy link

pronvis commented Nov 3, 2021

Hello guys!
Found issue in my Staking contract (that was copypasted from yours): Nexus-Protocol/services-contracts#17

Your code here:

fn compute_reward(config: &Config, state: &mut State, block_height: u64) {

have the same issue

If you pass block_height from the past this part:

let passed_blocks = std::cmp::min(s.1, block_height) - std::cmp::max(s.0, state.last_distributed);

will fail

@MSNTCS
Copy link
Contributor

MSNTCS commented Nov 9, 2021

@pronvis Thanks for the report, yes that causes a problem in the query. We will reflect this in our new update.

@MSNTCS MSNTCS added bug Something isn't working good first issue Good for newcomers labels Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants