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

Add GetVar(inputIndex, varId) + fix Context.getVar #785

Open
SethDusek opened this issue Nov 30, 2024 · 0 comments
Open

Add GetVar(inputIndex, varId) + fix Context.getVar #785

SethDusek opened this issue Nov 30, 2024 · 0 comments
Labels
6.0 Functionality needed for Ergo v6.0 (interpreter v3) Bounty - 100 ERG

Comments

@SethDusek
Copy link
Collaborator

Add a new method CONTEXT.getVarFromInput[T](inputIndex, varId) to read other input's context extension values.

Type definition:

def getVarFromInput[T](inputIndex: Short, varId: Byte) -> Option[T] 

Note that if getVarFromInput[T] is called and context variable is some other type U, then it should return None instead of an error, unlike getVar.

Also fix CONTEXT.getVar[T] method, in sigmastate-interpreter the method was implemented but with broken (de)serialization. In sigma-rust the method does not seem to be implemented at all (only global getVar Opcode). Add the getVar[T] method call and serialize T using explicit_type_args (see: #773 for how explicit type args are used)

Reference: ergoplatform/sigmastate-interpreter#1016

@SethDusek SethDusek added the 6.0 Functionality needed for Ergo v6.0 (interpreter v3) label Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.0 Functionality needed for Ergo v6.0 (interpreter v3) Bounty - 100 ERG
Projects
None yet
Development

No branches or pull requests

2 participants