tweag / cooked-validators

MIT License
39 stars 11 forks source link

Bump apps dependency to latest version #342

Closed MaximilianAlgehed closed 1 year ago

MaximilianAlgehed commented 1 year ago

Hi!

We have been working on making the ContractModel testing framework general and compatible with cooked-validators and we needed to bump the apps dependency to make everything fit together. For simplicity I just bumped to the latest apps main. Please let me know if that's not right.

I had to make some minor modifications to utxoIndex0From in order to coax everything past the new "cardano API only" apps API. Specifically, this meant we had to make utxoIndex0From a "proper" genesis transaction in order to make it validate (which, I wish I didn't have to say this, was the only way to make building the transaction comfortable in cardano-api-1.35.4).

I hope this is valuable to you guys.

P.S. You can check out the cooked-contractmodel repo over here if it's interesting to you guys. It contains a nice worked example of a QuickCheck model of your auction contract.

MaximilianAlgehed commented 1 year ago

@carlhammann If you wouldn't mind taking a look at this I would be very grateful.

MaximilianAlgehed commented 1 year ago

@Niols Perhaps you have time to have a look at this?

MaximilianAlgehed commented 1 year ago

Hello @MaximilianAlgehed and thanks for the PR! I think this is very useful, and we'll probably merge it. I'll try to understand the background a bit better, however, before approving. If you don't mind, could you elaborate a bit (or point me to some relevant bits of code/documentation) on why the "proper" genesis transaction has become necessary?

Hi, yes this is necessary because apps now uses only CardanoAPI transactions and the version of CardanoAPI they use only provide one "reasonable" way to build transactions - and those transactions basically have to validate. That's why we are using C.makeTransactionBody in the code. Later versions of the API do give you the ability to "cheat" and get around this requirement, but right now this is the best we can do.

I hope that's enough?

MaximilianAlgehed commented 1 year ago

Thank you! Please feel free to reach out with any questions about cooked contractmodel.

As for merging I'm afraid I don't have write access, but I would be happy to call this done now and for you to merge this when you feel like it :)