Skip to content
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

Merged
merged 1 commit into from
Aug 13, 2021
Merged

Conversation

yashpatel5400
Copy link
Contributor

@@ -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`
Copy link
Member

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 awaited before putting it in the description.

AmountMath.coerce(amountOut, brandOut);
if (theirTimestamp !== undefined) {
return authenticateQuote([
{ amountIn, amountOut, timer, timestamp: theirTimestamp },
Copy link
Member

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:

Suggested change
{ amountIn, amountOut, timer, timestamp: theirTimestamp },
{ amountIn, amountOut, timer: timerPresence, timestamp: theirTimestamp },

return E(timer)
.getCurrentTimestamp()
.then(now =>
authenticateQuote([{ amountIn, amountOut, timer, timestamp: now }]),
Copy link
Member

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.

@yashpatel5400
Copy link
Contributor Author

Addressed comments

Copy link
Member

@michaelfig michaelfig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants