-
Notifications
You must be signed in to change notification settings - Fork 11
Fix chain index query filtering #153
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
Conversation
- added: wip filtering for chain-index - added: filtering for node query - failing: test suite - see "FIXME: redeem:"
- move c-indexquery adjustment to callers side - added: c-index requet-to-response matching check - fixed: tests
- use middleware to adjust c-index queries
- added: test for checking handling in Contract - fixed: mismatched c-index response
- added: mock implementation for utxoRefMembership and test for it
- fixed/adjusted: rest collateral tests
| collateralUtxo <- readCollateralUtxo contractEnv | ||
| let removeCollateral :: TxosResponse -> TxosResponse | ||
| removeCollateral (TxosResponse page) = TxosResponse (removeCollateralFromPage collateralUtxo page) | ||
| removeCollateral |
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.
Removing now handled by withCollateralHandling in handlePABEffect and runPABEffectPure
| collateralUtxo <- readCollateralUtxo contractEnv | ||
| let removeCollateral :: UtxosResponse -> UtxosResponse | ||
| removeCollateral (UtxosResponse tip page) = UtxosResponse tip (removeCollateralFromPage collateralUtxo page) | ||
| removeCollateral |
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.
Removing now handled by withCollateralHandling in handlePABEffect and runPABEffectPure
| let newPage = removeCollateralFromPage mc (page utxosResp) | ||
| in UtxoSetWithCurrencyResponse $ utxosResp {page = newPage} | ||
| -- adjustment based on request | ||
| (UtxoSetMembership oref, UtxoSetMembershipResponse (IsUtxoResponse ct isU)) -> |
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 is not too optimal to make request when we know already that oref is collateral, but I thought this way there will single function to adjust both real and mock interpretation, reducing the risk to get only mock implementation working correctly.
Any suggestions on how to make it better are welcome.
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.
Actually, filtering by query can be made in withCollateralHandling and just do not make request and don't call adjustChainIndexResponse if not required 🤔
And adjustChainIndexResponse can go to where part of withCollateralHandling
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.
Looks good
This PR:
UtxosAtbut with filtering -UtxosAtExcluding