OpShin/opshin-pioneer-program

Hint: You can import the Data definitions from Eopsin and initialize them when using pycardano

nielstron opened this issue · 2 comments

For example here you instantiate PlutusData in the pycardano code. It doesn't make much sense for week2 but in week3 it could come in handy if you want to build the txs as well.

from week03.src.vesting_contract import VestingParams

 ....

   datum = VestingParams(...)

https://github.com/juliusfrost/eopsin-pioneer-program/blob/3d57101ef7b326951b703290384e8d485d256ece/src/week02/scripts/make_gift.py#L32

Thanks! I will incorporate that when I make the off-chain scripts.

I've updated the make_gift.py and collect_gift.py scripts in week02 able to run on all lecture scripts. As part of this, I demonstrate an import from the custom_types.py validation script:

https://github.com/OpShin/eopsin-pioneer-program/blob/b4447bd682921c4a46002d4a7bdb1c8db9e54a4b/src/week02/scripts/collect_gift.py#L80-L87