-
Notifications
You must be signed in to change notification settings - Fork 158
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
Alonzo UTXOW examples #2215
Alonzo UTXOW examples #2215
Conversation
388efd8
to
42a4fcc
Compare
1de11a7
to
d227aa9
Compare
toData (Context _ _) = undefined | ||
-- toData will be implemented in the Plutus library, | ||
-- this is just a FakePlutus hack. | ||
toData (Context _ _) = I 0 |
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.
This is handled correctly in #2242
transCostModel :: CostModel -> P.CostModel | ||
transCostModel (CostModel mp) = | ||
case P.validateAndCreateCostModel mp of | ||
Nothing -> P.defaultCostModel -- TODO validation should be before this |
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.
This is definitely not what we want in the long term. We need a plan for where and how to handle the cost model validation on the ledger side, which is probably our next priority.
These examples are great! We will sort out the cost model validation soon, I assume in a separate PR? |
yep, that's my plan. |
d227aa9
to
f9f76c6
Compare
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.
Every thing looks fine to me.
( Show (Core.Value era) | ||
( Era era, | ||
Show (Core.Value era) | ||
) => | ||
Show (TxOut era) | ||
where | ||
show = error "Not yet implemented" | ||
show (TxOut addr vl dh) = | ||
"TxOut (" <> show addr <> " " <> show vl <> " " <> show dh <> ")" |
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.
This is going to clash with master. I don't think i matters what version we choose.
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 like what is in master better, I'll rebase, thanks!
import qualified Plutus.V1.Ledger.Api as P | ||
( EvaluationError (..), | ||
ExBudget (..), | ||
VerboseMode (..), | ||
evaluateScriptRestricting, | ||
) |
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.
Shouldn't we be using runPLCScript (defined in TxInfo.hs, which is defined in terms of this function) as that is how the specification is written. I guess, from that function we don't very interesting information about why scripts fail.
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.
yea, that is just used for a sanity check of a unit test, that we can call plutus directly as expected.
f9f76c6
to
b1d5c98
Compare
This introduces the first 8 unit tests / examples for Alonzo: a failing and a succeeding transaction for each of: Spend, Cert, Rewrd, and Mint. Using the real Plutus interpreter!