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

refactor[tool]: refactor venom and fang CLI parsing #4398

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

pcaversaccio
Copy link
Collaborator

@pcaversaccio pcaversaccio commented Dec 15, 2024

What I did

This PR refactors the venom and fang CLI parsing and improves the error handling.

How I did it

Played around with the CLI and saw some opportunities for improvements.

How to verify it

For fang, use the file test.lll:

(with x pass
 (with y pass
  (with baseUnit pass
   (div (with t (mul x y) (seq (assert (eq (div t x) y)) t)) baseUnit)
    )))

For venom, use the file test.venom:

function entry {
    entry:
        invoke @check_cv
        jmp @wow
    wow:
        mstore 0, 1
        return 0, 32
}
function check_cv {
    check_cv:
        %1 = callvalue
        %2 = param
        jnz @no_value, @has_value, %1
    no_value:
        ret %2
    has_value:
        revert 0, 0
}
[data]

For standard input, use this:

echo "function start { start: %1 = callvalue jnz @fine, @has_callvalue, %1 fine: %2 = calldataload 4 %4 = add %2, 279387 return %2, %4 has_callvalue: revert 0, 0 } [data]" | venom --stdin

Commit message

this commit refactors the `venom` and `fang` CLI parsing.
it improves error handling and updates the help message. 

Description for the changelog

refactor[tool]: refactor venom and fang CLI parsing

Cute Animal Picture

image

pcaversaccio and others added 5 commits December 15, 2024 15:53
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
vyper/cli/venom_main.py Fixed Show fixed Hide fixed
process_venom_source(venom_source)


def read_from_stdin():

Check notice

Code scanning / CodeQL

Explicit returns mixed with implicit (fall through) returns Note

Mixing implicit and explicit returns may indicate an error as implicit returns always return None.
Copy link

codecov bot commented Dec 15, 2024

Codecov Report

Attention: Patch coverage is 0% with 69 lines in your changes missing coverage. Please review.

Project coverage is 52.66%. Comparing base (537313b) to head (68c4ce0).

Files with missing lines Patch % Lines
vyper/cli/venom_main.py 0.00% 36 Missing ⚠️
vyper/cli/vyper_ir.py 0.00% 33 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (537313b) and HEAD (68c4ce0). Click for more details.

HEAD has 170 uploads less than BASE
Flag BASE (537313b) HEAD (68c4ce0)
200 30
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #4398       +/-   ##
===========================================
- Coverage   91.11%   52.66%   -38.46%     
===========================================
  Files         115      115               
  Lines       16225    16264       +39     
  Branches     2728     2732        +4     
===========================================
- Hits        14784     8566     -6218     
- Misses       1006     7067     +6061     
- Partials      435      631      +196     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Pascal Marco Caversaccio <[email protected]>
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
@pcaversaccio pcaversaccio marked this pull request as draft December 15, 2024 17:19
@pcaversaccio pcaversaccio self-assigned this Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant