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

Add AggregatorRouter Contract use case #8

Merged
merged 6 commits into from
Jan 10, 2024

Conversation

nick-bisonai
Copy link
Contributor

No description provided.

Copy link
Member

@martinkersner martinkersner left a comment

Choose a reason for hiding this comment

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

LGTM! I left couple comments :)

package.json Outdated
"typescript": "^4.9.4"
}
"name": "data-feed-consumer",
"version": "0.2.0",
Copy link
Member

Choose a reason for hiding this comment

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

I think we should also increase version here.

@@ -7,15 +7,17 @@ import dotenv from 'dotenv'

dotenv.config()

let commonConfig = { gas: 5_000_000, gasPrice: 250_000_000_000 }
let commonConfig = {}
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason to move definition inside the conditional branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there were error from my environment so I had to change it..
image

Copy link
Member

Choose a reason for hiding this comment

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

It complains about accounts, not about gas and gasPrice. Did you try to define accounts as below?

let commonConfig = { gas: 5_000_000, gasPrice: 250_000_000_000, accounts: [] }

Then we could just update the accounts

commonConfig.accounts = [process.env.PRIV_KEY]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't know what's different from my environment but it still leads to error
Screenshot 2024-01-10 at 2 59 50 PM
image

Copy link
Contributor Author

@nick-bisonai nick-bisonai Jan 10, 2024

Choose a reason for hiding this comment

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

image

Copy link
Member

Choose a reason for hiding this comment

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

You don't have to waste time on it. We can fix it later ;)

int256 public answer;
uint80 public roundId;

constructor(address aggregatorProxy) {
constructor(address aggregatorProxy, address aggregatorRouter) {
Copy link
Member

Choose a reason for hiding this comment

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

I think passing AggregatorProxy loses its purpose after having access to the AggregatorRouter. How having two consumer contracts? One showing how to use AggregatorProxy and one for AggregatorRouter?

Copy link
Contributor Author

@nick-bisonai nick-bisonai Jan 10, 2024

Choose a reason for hiding this comment

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

I felt bothered to make another contract and make separate deploy script, and thought that this is enough explanation for other developers to understand. But I'll write another contract if you insist

Copy link
Member

Choose a reason for hiding this comment

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

Understood! We should assume that some people might want to take our code and make minimal modifications. In this case, they have to understand both approaches and always remove one of them. Please separate those two approaches into two consumer contracts.

, /* uint startedAt */
, /* uint updatedAt */
, /* uint80 answeredInRound */
int256 answer_ /* uint startedAt */ /* uint updatedAt */ /* uint80 answeredInRound */,
Copy link
Member

Choose a reason for hiding this comment

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

Can we keep the previous format? 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's automatically formatted from my vs code... I'll turn off format on save option and update it

@nick-bisonai nick-bisonai merged commit 31f6c34 into master Jan 10, 2024
1 check passed
@nick-bisonai nick-bisonai deleted the feat/aggregator-router-updates branch January 10, 2024 08:09
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