-
Notifications
You must be signed in to change notification settings - Fork 220
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
Rewrite tokenBundleSizeAssessor with ledger types #4098
Rewrite tokenBundleSizeAssessor with ledger types #4098
Conversation
lib/wallet/test/unit/Cardano/Wallet/Write/Tx/Balance/TokenBundleSizeSpec.hs
Show resolved
Hide resolved
lib/wallet/src/Cardano/Wallet/Write/Tx/Balance/TokenBundleSize.hs
Outdated
Show resolved
Hide resolved
740ee3d
to
d472455
Compare
This removes the dependency on `Cardano.Wallet.Shelley.Compatibility.toCardanoValue`
d472455
to
bf53694
Compare
lib/wallet/test/unit/Cardano/Wallet/Write/Tx/Balance/TokenBundleSizeSpec.hs
Outdated
Show resolved
Hide resolved
lib/wallet/test/unit/Cardano/Wallet/Write/Tx/Balance/TokenBundleSizeSpec.hs
Outdated
Show resolved
Hide resolved
@jonathanknowles I noticed some remaining things, but could you please have a look? A key change here is that we now use the entire |
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.
Hi @Anviking. This looks mostly good to me -- I've made some suggestions.
lib/wallet/test/unit/Cardano/Wallet/Write/Tx/Balance/TokenBundleSizeSpec.hs
Outdated
Show resolved
Hide resolved
lib/wallet/src/Cardano/Wallet/Write/Tx/Balance/TokenBundleSize.hs
Outdated
Show resolved
Hide resolved
lib/wallet/test/unit/Cardano/Wallet/Write/Tx/Balance/TokenBundleSizeSpec.hs
Outdated
Show resolved
Hide resolved
lib/wallet/test/unit/Cardano/Wallet/Write/Tx/Balance/TokenBundleSizeSpec.hs
Outdated
Show resolved
Hide resolved
lib/wallet/src/Cardano/Wallet/Write/Tx/Balance/TokenBundleSize.hs
Outdated
Show resolved
Hide resolved
lib/wallet/src/Cardano/Wallet/Write/Tx/Balance/TokenBundleSize.hs
Outdated
Show resolved
Hide resolved
lib/wallet/src/Cardano/Wallet/Write/Tx/Balance/TokenBundleSize.hs
Outdated
Show resolved
Hide resolved
@@ -64,17 +88,17 @@ spec = describe "Assessing the sizes of token bundles" $ do | |||
prop_assessTokenBundleSize_enlarge | |||
:: Blind (VariableSize1024 TokenBundle) | |||
-> Blind (VariableSize16 TokenBundle) | |||
-> PParamsInRecentEra |
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.
Hm, it seems this was hard-coded before, but it seems to work 🤷♂️
bundle | ||
actualLengthBytes = computeTokenBundleSerializedLengthBytes bundle | ||
actualAssessment = assessTokenBundleSize assessor bundle | ||
v = eraProtVerLow @StandardBabbage -- FIXME! |
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.
👀
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 think just dropping the FIXME
is fine. Ideally we'd re-use the same version as was used by the TokenBundleSizeAssessor
but 🤷♂️
lib/wallet/test/unit/Cardano/Wallet/Write/Tx/Balance/TokenBundleSizeSpec.hs
Outdated
Show resolved
Hide resolved
lib/wallet/test/unit/Cardano/Wallet/Write/Tx/Balance/TokenBundleSizeSpec.hs
Outdated
Show resolved
Hide resolved
& ppProtocolVersionL .~ (ProtVer (eraProtVerLow @StandardBabbage) 0) | ||
& ppMaxValSizeL .~ maryTokenBundleMaxSize | ||
where | ||
maryTokenBundleMaxSize = 4000 |
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.
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.
Co-authored-by: Jonathan Knowles <[email protected]>
e0cfdd8
to
270b6ad
Compare
This removes the dependency on
Cardano.Wallet.Shelley.Compatibility.toCardanoValue
Issue Number
ADP-3081