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

[Feature] implement block.height command #2420

Merged
merged 6 commits into from
Jun 20, 2023
Merged

Conversation

collinc97
Copy link
Collaborator

Overview

The block.height opcode has been implemented in Aleo Instructions https://github.com/AleoHQ/snarkVM/pull/1650

New Leo Syntax

block.height can be used in a finalize context to fetch the latest block height in a program.

transition matches(height: u32) {
    return then finalize(height);
} finalize matches(height: u32) {
    assert_eq(height, block.height);
}

@collinc97 collinc97 added the feature A new feature. label Jun 19, 2023
@collinc97 collinc97 requested a review from d0cd June 19, 2023 22:58
@codecov
Copy link

codecov bot commented Jun 19, 2023

Codecov Report

Merging #2420 (86d4903) into testnet3 (e5ae160) will decrease coverage by 0.06%.
The diff coverage is 86.66%.

@@             Coverage Diff              @@
##           testnet3    #2420      +/-   ##
============================================
- Coverage     78.86%   78.81%   -0.06%     
============================================
  Files           153      153              
  Lines          4751     4768      +17     
  Branches       4750     4767      +17     
============================================
+ Hits           3747     3758      +11     
- Misses         1004     1010       +6     
Impacted Files Coverage Δ
compiler/parser/src/tokenizer/token.rs 85.71% <ø> (ø)
compiler/span/src/symbol.rs 84.61% <ø> (ø)
...rors/src/errors/type_checker/type_checker_error.rs 79.00% <66.66%> (-0.39%) ⬇️
...iler/passes/src/type_checking/check_expressions.rs 81.84% <87.50%> (+0.09%) ⬆️
compiler/parser/src/parser/expression.rs 83.84% <100.00%> (+0.07%) ⬆️
compiler/parser/src/tokenizer/lexer.rs 99.17% <100.00%> (-0.83%) ⬇️
...mpiler/passes/src/code_generation/visit_program.rs 82.60% <100.00%> (+0.38%) ⬆️

... and 12 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@collinc97 collinc97 merged commit 4a0ee1d into testnet3 Jun 20, 2023
@collinc97 collinc97 deleted the feat/block-height branch June 20, 2023 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants