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

Integration test: Chainlink Pricer #120

Closed
wants to merge 10 commits into from
Closed

Conversation

antoncoding
Copy link
Contributor

@antoncoding antoncoding commented Sep 4, 2020

Task: Feature Name:

High Level Description

Specific Changes
Function x was added ...

Code

  • Unit test 100% coverage
  • Does your code follow the naming and code documentation guidelines?

Documentation

  • Is your code up to date with the spec?
  • Have you added your tests to the testing doc?


const ChainlinkPricer = artifacts.require('ChainLinkPricer.sol')
const Oracle = artifacts.require('Oracle.sol')
const MockChainlinkAggregator = artifacts.require('MockChainlinkAggregator.sol')
Copy link
Contributor

@aparnakr aparnakr Sep 5, 2020

Choose a reason for hiding this comment

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

Can you use the actual chainLink contract instead of the mock
aggregator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think using Mock make more sense in this case!
In tests we mock things that's out of our control. In this case, aggregator is not part of our system and we won't be able to directly write to the aggregator when we're live on mainnet, so I don't think that's should be included in the test.
Everything we care about is reading from the aggregator, and this is the perfect situation of using mock contracts. If we copy paste Chainlink aggregator, we will need like 10 steps to submit a price to the aggregator, and we can't do the same thing on Mainnet either

Copy link
Contributor

@aparnakr aparnakr left a comment

Choose a reason for hiding this comment

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

LGTM.

@antoncoding antoncoding self-assigned this Sep 5, 2020
@antoncoding antoncoding added the test Integration tests / function tests label Sep 6, 2020
@antoncoding antoncoding linked an issue Sep 6, 2020 that may be closed by this pull request
@antoncoding
Copy link
Contributor Author

closing because the change is covered in #126

@antoncoding antoncoding deleted the test/chainlink-pricer branch October 6, 2020 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Integration tests / function tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add integration test for ChainlinkPricer + Oracle
2 participants