-
Notifications
You must be signed in to change notification settings - Fork 720
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
Expose Ledger events through the API. #3085
Conversation
stateOld = clsState oldState | ||
if enableValidation | ||
then tickThenApply config block stateOld | ||
else tickThenReapplyCheckHash config block stateOld |
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.
New applyBlockWithEvents
function.
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 just pushed a refined interface to PR IntersectMBO/ouroboros-network#3292 and left a couple comments here explaining what needs to change. HTH.
tickThenApply cfg block lsb | ||
= either (Left . Text.pack . show) Right | ||
$ runExcept | ||
$ Ledger.tickThenApply cfg block lsb |
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 just pushed a refined interface to PR IntersectMBO/ouroboros-network#3292
I think this should now just be ... $ runExcept $ Ledger.tickThenApplyLedgerResult cfg block lsb
, no need for runLedgerT
.
tickThenReapplyCheckHash cfg block lsb = | ||
if Consensus.blockPrevHash block == Ledger.ledgerTipHash lsb | ||
then Right $ Ledger.tickThenReapply cfg block lsb |
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 just pushed a refined interface to PR IntersectMBO/ouroboros-network#3292
I think this should now just be ... $ Ledger.tickThenReapplyLedgerResult cfg block lsb
, no need for runIdentity
or runLedgerT
.
@@ -47,6 +50,8 @@ data LedgerEvent | |||
PoolReRegistration Certificate | |||
| -- | Rewards are being distributed. | |||
RewardsDistribution EpochNo (Map StakeCredential Lovelace) | |||
| -- | MIR are being distributed. | |||
MIRDistribution MIRDistributionDetails |
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 constructor have an EpochNo
field so that I know which epoch number that was paid in?
- Add a function 'applyBlockWithEvents' which yields events along with a new ledger state. - Add two events, both needed by DB-sync. More events are available.
bors merge |
Build succeeded: |
new ledger state.