-
Notifications
You must be signed in to change notification settings - Fork 157
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
remove exunits from txbody #2166
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.
LGTM
Please either rebase or squash before committing. |
@@ -399,18 +401,24 @@ txsize :: Tx era -> Integer | |||
txsize (TxConstr (Memo _ bytes)) = fromIntegral (SBS.length bytes) | |||
|
|||
minfee :: | |||
( HasField "exunits" (Core.TxBody era) ExUnits | |||
( Era era, | |||
ToCBOR (Core.AuxiliaryData era), |
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 don't see why we need this ToCBOR
constraint. Where is it used?
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.
it was complaining about the lack of this constraint. I saw that it was also used somewhere else where txrdmrs
appeared
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.
ill try taking it out
where | ||
a protparam = Coin (fromIntegral (_minfeeA protparam)) | ||
b protparam = Coin (fromIntegral (_minfeeB protparam)) | ||
totExunits = foldl (<>) mempty (snd $ unzip (Map.elems trd)) | ||
trd = getField @"txrdmrs" txw | ||
txw = getField @"wits" tx |
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.
Could just inline this in the previous line
ExUnits
field in the body of the tx because they are already tracked in the indexed redeemer structure inside the witness section of the transactionadHash
from the body because the body contained 2 hashes of auxiliary data, and only needs 1, and renamingscriptHash
(the other aux. data hash) toauxdHash
to match the order in the spec