Loan open and close quotes don't allow checking predictions for past blocks
Based on this Discord discussion:
As with other querier endpoints, the height parameter in a swap quote gives distinct and consistent results
(good for development discussion and for comparing a past quote to a real transaction right after it).
However,
https://thornode.ninerealms.com/thorchain/quote/loan/close?from_asset=BNB.BNB&amount=10000000&to_asset=BTC.BTC&loan_owner=bc1qcxssye4j6730h7ehgega3gyykkuwgdgmmpu62n&height=8669715
for instance gives
{"error":"unexpected parameter height"}
.
My current impression is that the height specification is working as normal, but is then being checked again and rejected.
More specifically, here and here in 'allowed' map checks for only queryQuoteLoanOpen
and queryQuoteLoanClose
, and not in for instance queryQuoteSwap
.
I suggest at this point that `"height" be added to the constants list here as 'heightParam', and heightParam added to the 'allowed' lists.
(As with swap quotes, past height like caching should not be used for APIs to select memos for the current height.)
Also brought to attention (and also on the subject of loan quote parameters) in the same discussion is that the 'Try it out' at
https://thornode.ninerealms.com/thorchain/doc
for /thorchain/quote/loan/open and /thorchain/quote/loan/close
return "missing required parameter from_asset"
,
indicating that they need to be updated to reflect #1612 (closed)/!3056 (closed).
My specific code proposal at this time: !3063 (merged)
'Loan quote parameter compatibility'.