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

Week 06 #43

Merged
merged 84 commits into from
May 4, 2023
Merged

Week 06 #43

merged 84 commits into from
May 4, 2023

Conversation

juliusfrost
Copy link
Collaborator

No description provided.

@juliusfrost
Copy link
Collaborator Author

I'm trying to use pyaiken.uplc.eval but I'm getting this error for the redeemer argument:

ValueError: Type mismatch expected 'data' got 'integer'

Shouldn't the redeemer be an integer?

def validator(datum: CustomDatum, redeemer: int, context: ScriptContext):

@nielstron

@nielstron
Copy link
Collaborator

Shouldn't the redeemer be an integer?

Without having looked at the code too much, I imagine the issue is passing a BuiltinInteger vs a PlutusInteger. PlutusInteger is of type PlutusData and the validator always expects PlutusData, never builtin values

src/utils/tx_tools.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@nielstron
Copy link
Collaborator

@cffls A proper, deterministic mock context for evaluating UPLC starting from the TxBuilder 👀

@@ -0,0 +1,143 @@
from collections import defaultdict
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I think it may be a good idea to port this to pycardano.

@nielstron
Copy link
Collaborator

nielstron commented Apr 23, 2023

The mock context should now work as expected (for PlutusV2Scripts!). The property test fails (as expected?).
This would also nicely make it into the plutus-bench

@juliusfrost
Copy link
Collaborator Author

The mock context should now work as expected (for PlutusV2Scripts!). The property test fails (as expected?).
This would also nicely make it into the plutus-bench

Yes, I didn't finish making the property tests correctly yet

@juliusfrost
Copy link
Collaborator Author

The content for week06 is basically done now. I just need Python-Cardano/pycardano#228 merged and then I can set pycardano to use the main branch dependency.

@juliusfrost juliusfrost marked this pull request as ready for review April 29, 2023 03:22
@nielstron
Copy link
Collaborator

Nice work. This advanced the entire ecosystem by a good bit 😄

@juliusfrost
Copy link
Collaborator Author

juliusfrost commented Apr 29, 2023

@nielstron it says you requested changes on the pr, could you make an approval (whenever pycardano is ready)?

Copy link
Collaborator

@nielstron nielstron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@juliusfrost
Copy link
Collaborator Author

fyi for anyone following this, just need to update uplc, pyaiken, pycardano for this to merge

@nielstron
Copy link
Collaborator

UPLC and pyaiken are bumped :)

@juliusfrost
Copy link
Collaborator Author

@nielstron Thanks for the update!

We'll use the main branch of pycardano for now until the next release

@juliusfrost juliusfrost merged commit 08b130f into main May 4, 2023
@juliusfrost juliusfrost deleted the week06 branch May 6, 2023 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants