-
Notifications
You must be signed in to change notification settings - Fork 19
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
Modify behaviour of valueAdjust
#365
Comments
Good catch. It should be the latter I think |
…tness`
Hey @TotallyNotChase, this issue was reported to us by a dev from MLabs, I just echoed it back here. Seeing the behaviour of underlying |
Also, I am not sure if we should try maintaining the invariant of not allowing zero values in Here So values should not be zero. |
This sort of thing should really be handled in the section where app code is converted to ledger types. In fact, the ledger itself should be able to remove or add zeroes as necessary. Absolutely insane that that is not the case in cardano-ledger |
I should have also noted that cardano-ledger codebase actually does that. So even if we allow zero values, they are ultimately filtered for by cardano-ledger. |
That's perplexing. Then what does Or is it just the fact that, the ledger is not aware of values in datums being... well... values. So when the ledger sees a datum serialized by some higher level framework, say atlas, that does not deal with these invariants - it just sort of.... lets it be...? |
I think whenever we try to convert to underlying cardano-api/ledger value type, we see this normalisation (we use
I think so, yeah. But I am not sure if this was the original motivation to try filtering zero entries in |
feat(#365): add `valueAlter` and some typeclass instances for `GYTxWi…
wrt. zero ADA entries it's fine to do whatever ledger expects, the problem is when converting (this issue comes from my thread on slack) |
Thanks for elaborating @t4ccer! Yes, I'm fine with your proposed change. Would you like to create a PR for it? Else we can handle it. |
Alternatively, |
Currently,
valueAdjust
is a noop if an asset class is not present.valueAdjust (+1) GYLovelace mempty
should bemempty
orvalueFromList [(GYLovelace, 1)]
?The text was updated successfully, but these errors were encountered: