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 10 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 <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
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 71 lines in your changes missing coverage. Please review.

Project coverage is 91.85%. Comparing base (7d921e9) to head (bc17c17).

Files with missing lines Patch % Lines
vyper/cli/venom_main.py 0.00% 38 Missing ⚠️
vyper/cli/vyper_ir.py 0.00% 33 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4398      +/-   ##
==========================================
- Coverage   92.07%   91.85%   -0.22%     
==========================================
  Files         120      120              
  Lines       17352    17393      +41     
  Branches     2938     2942       +4     
==========================================
  Hits        15977    15977              
- Misses        957      998      +41     
  Partials      418      418              

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

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@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