-
Notifications
You must be signed in to change notification settings - Fork 20
Adding Example Smart Contracts and Traces. #955
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments here and there.
@williamdemeo and I had discussed with @Ali-Hill that probably it will be better to move all the examples to its own hierarchy outside of src. Maybe in a folder called src-ext-test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the contents of this file relate to scripts I suggest to move it to the Script folder.
I see two options:
- Merge it with
Script.Base - Replace
Script.Baseby this module and move the currentScript.BasetoScript.Structure(or something along those lines)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@carlostome I think the first option will create a cyclic module dependency so we could either go with the second option, or we could simply move the ScriptPurpose.agda file into Specification/Script/ (and, incidentally, we should rename it ScriptPurpose.lagda.md). For now I'll do the latter, since it has less impact.
| ⦃ Dec-validPlutusScript ⦄ : ∀ {x} → (validPlutusScript x ⁇³) | ||
| language : PlutusScript → Language | ||
| toData : ∀ {A : Type} → A → Data | ||
| -- toData : ∀ {A : Type} → A → Data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this commented out?
| -- valContext : TxInfo → ScriptPurpose → Data | ||
| -- valContext txinfo sp = toData (txinfo , sp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these lines commented out?
| --valContext : TxInfo → ScriptPurpose → Data | ||
| --valContext txinfo sp = toData (txinfo , sp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these lines commented out?
|
I agree, it could even be factored into a separate library. |
Proposed refactor for IntersectMBO#955: reorganize & rename files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks great, modulo the changes I suggested earlier and already contributed. (In particular, I've moved the tests and examples up to a top-level directory.) Nice work!
Description
Reimplements the changes in Alasdair's PR #885 modernized for the most recent commit of the master branch.
Additionally adds three more example contracts and their respective traces to the Conway specification tests including:
Development notes:
All examples currently only use coinTokenAlgebra, because the more complex Token Algebras cause the computational traces to hang endlessly. Attempted to use the proposed fixed-length vector implementation as well as a simplified version with just Ada and one singular token with no success. This makes the Distributed Exchange a bit weird since it does not have different currencies to exchange, but should be easily adaptable once Token Algebras are fully implemented.
As part of the previous changes, we removed
toData, which will need to be reflected in the spec of Djikstra going forward.Checklist
CHANGELOG.md