-
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
BBODY examples #2259
BBODY examples #2259
Conversation
87d3131
to
4cb281f
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.
Just a few cosmetic changes. Looks good to me.
|
||
initBBodyState :: BbodyState A | ||
initBBodyState = BbodyState (LedgerState UTXOW.initUtxoSt dpstate) (BlocksMade mempty) | ||
|
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.
call this initialBBodyState, initBBody state sounds like a noun, so I expect it to be a function.
BHBody | ||
{ bheaderBlockNo = BlockNo 0, | ||
bheaderSlotNo = SlotNo 0, | ||
bheaderPrev = GenesisHash, | ||
bheaderVk = vKey coldKeys, | ||
bheaderVrfVk = vvrf, | ||
bheaderEta = coerce $ evalCertified () nonceNonce svrf, | ||
bheaderL = coerce $ evalCertified () leaderNonce svrf, | ||
bsize = fromIntegral $ bBodySize txs, | ||
bhash = hashTxSeq txs, | ||
bheaderOCert = | ||
OCert | ||
vkes | ||
0 | ||
(KESPeriod 0) | ||
(signedDSIGN @C_Crypto (sKey coldKeys) (OCertSignable vkes 0 (KESPeriod 0))), | ||
bprotver = ProtVer 5 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.
Should this part, making the BHBody be a function that is reusable? Seems it is a function of txs.
|
||
-- | We always expect the alwaysFailsOutput to remain in the UTxO map. | ||
-- Each of the eight example transactions below will consume one of the | ||
-- feeInputs, given by feeInputs. | ||
-- The transaction where IsValidating is True will create a transaction output. | ||
-- Additionally, the alwaysFailsOutput will be consumed in the IsSpend case. | ||
expectedUTxO :: Expect -> Natural -> UTxO A |
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.
Add to the comments how this should be used. The comments tells what it does, not how one should use it.
The function was replaced by collectTwoPhaseScriptInputs a while ago, but the old function was never removed.
4cb281f
to
485d7e5
Compare
This PR makes an
BBODY
example by packing the 8 transactions from theUTXOW
examples into a single block. This is the top-most rule changed in the Alonzo era.This involved a bit of reorganizing the UTXOW examples.
Additionally, I changed the
collectTwoPhaseScriptInputs
function to supply Plutus data in this order: datum, redeemer, context. See #2248 (comment).I also removed the unused function
collectNNScriptInputs
which was previously replaced bycollectTwoPhaseScriptInputs
.