-
Notifications
You must be signed in to change notification settings - Fork 155
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
Adds two UTxO properties #642
Conversation
byron/ledger/executable-spec/src/Cardano/Ledger/Spec/STS/UTXO.hs
Outdated
Show resolved
Hide resolved
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.
Thanks. LGTM.
My main remarks:
- I'd remove the
HasTrace UTXO
instance. - I'd replace
all
fortraverse_
for better error messages, and do some style changes.
Thanks for addressing the comments Marko. Ping me when you want me to take a second look 🙏 |
Thank you for the feedback! I'll think of coverage before pining you for another review. |
(utxo0, utxoSt) = (utxo *** utxo) . firstAndLastState $ t | ||
txs = body <$> traceSignals OldestFirst t | ||
when (all (\ti -> dom (txouts ti) ∩ dom utxo0 == empty) txs) $ | ||
foldl' union' empty txs ⋪ (utxo0 ∪ allTxOuts txs) === utxoSt |
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.
you could us Set.unions (foldl union empty) as in
Set.unions ((fromList . txins) <$> txs)
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.
That's a fair point. I guess it boils down to what's more readable to someone and/or what is one's preference. I don't have a strong opinion here. Should I change 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.
LGTM2
No problem. I would address the coverage in a separate issue. Let's just close this one if possible. |
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.
4e6d436
to
2e22a5d
Compare
* no double spending * UTxO is outputs minus inputs An issue with UTxO generators has appeared while working on this, which is tracked in a new issue #646.
2e22a5d
to
779be01
Compare
…perties Adds two UTxO properties per #263
This pull request implements two properties for UTxO:
It closes #263.
@dnadales , @uroboros: is there anything to add or change to improve this PR?