Closed SatoKentaNayoro closed 2 years ago
Oh, then it's underflowing when the chain is less than 4096 blocks high?
If so, please use saturating_sub
instead of changing the types, as it doesn't really make sense to use signed types on block heights.
Good catch though.
Oh, then it's underflowing when the chain is less than 4096 blocks high?
If so, please use
saturating_sub
instead of changing the types, as it doesn't really make sense to use signed types on block heights.Good catch though.
I'm new to Rust and haven't used Saturating_sub yet, thanks for reminding me, I'll fix it in the morning
I've used saturating_sub
instead of changing the types, and apis should will work fine when the chain is less than 4096 blocks high now.
latest_block_height - Testnet2::ALEO_MAXIMUM_FORK_DEPTH >= height will panic when the result of (latest_block_height - Testnet2::ALEO_MAXIMUM_FORK_DEPTH) < 0,