-
Notifications
You must be signed in to change notification settings - Fork 212
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
Added Chainlink aggregator with tests #3673
Conversation
packages/zoe/tools/types.js
Outdated
@@ -14,7 +14,7 @@ | |||
* @typedef {Object} PriceDescription A description of a single quote | |||
* @property {Amount} amountIn The amount supplied to a trade | |||
* @property {Amount} amountOut The quoted result of trading `amountIn` | |||
* @property {TimerService} timer The service that gave the `timestamp` | |||
* @property {ERef<TimerService>} timer The service that gave the `timestamp` |
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 suggest reverting this. The PriceDescription needs to be comparable, and that means the timer
should be await
ed before putting it in the description.
AmountMath.coerce(amountOut, brandOut); | ||
if (theirTimestamp !== undefined) { | ||
return authenticateQuote([ | ||
{ amountIn, amountOut, timer, timestamp: theirTimestamp }, |
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.
This is how we use the non-ERef form of the timer as an identity:
{ amountIn, amountOut, timer, timestamp: theirTimestamp }, | |
{ amountIn, amountOut, timer: timerPresence, timestamp: theirTimestamp }, |
return E(timer) | ||
.getCurrentTimestamp() | ||
.then(now => | ||
authenticateQuote([{ amountIn, amountOut, timer, timestamp: now }]), |
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.
Please do the same with timer: timerPresence
here.
f286e77
to
99fe4a4
Compare
Addressed comments |
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.
Beautiful!
PR for changes requested in https://gitcoin.co/issue/Agoric/agoric-sdk/3200/100026006