-
Notifications
You must be signed in to change notification settings - Fork 8
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 support for networks using WitnetFeeds contract #368
Conversation
cdfcc17
to
011d4a9
Compare
be286ee
to
bfc2264
Compare
Add support for networks using [WitnetFeeds contract](https://github.com/witnet/witnet-solidity-bridge/blob/2.0.x/contracts/apps/WitnetFeeds.sol): - Implement the NetworkRouter class that handles all the communication with each network. - Listen to the networks using the `WitnetPriceRouter` with `listenLegacyPriceRouter` and the new network using `WitnetFeeds` with `listenWitnetPriceFeeds`. - Update the configuration file. The networks still using the old witnet price router are marked using `legacy: true` in the network configuration. Also, the file configuration has been updated to include the feed key. This new key consists of a map with the default values of the existing price feeds. According to that, the price feeds deployed using the default configuration have been deleted from the network feeds section. If a feed configuration appears in the network feeds, it will overwrite the default configuration. Now, we get all the available price feeds in a network called the [supportedFeeds](https://github.com/witnet/witnet-solidity-bridge/blob/2.0.x/contracts/interfaces/IFeeds.sol#L8) method.
bfc2264
to
26dda67
Compare
@@ -65,6 +66,7 @@ export class ResultRequestRepository { | |||
async getLastResult ( | |||
feedFullName: string | |||
): Promise<ResultRequestDbObjectNormalized | null> { | |||
console.log('inside getLastResult with feedFullname', feedFullName) |
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.
Remove this console.log
console.log(`Error in getLastResult: ${feedFullName}`, e) | ||
return null | ||
}) | ||
console.log(lastResultRequest) |
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.
Remove this console.log
|
||
describe('NetworkRouter', () => { | ||
// FIXME: web3 library is not working with jest. It works if use use vitest instead. | ||
it.skip('should fetch network contract', async () => { |
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.
use vitest
packages/ui/components/Main.vue
Outdated
@@ -147,6 +147,8 @@ export default { | |||
this.currentPage = val | |||
}, | |||
setCurrentNetwork(options) { | |||
console.log('options', options) |
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.
Remove this console.log
packages/ui/components/Main.vue
Outdated
@@ -147,6 +147,8 @@ export default { | |||
this.currentPage = val | |||
}, | |||
setCurrentNetwork(options) { | |||
console.log('options', options) | |||
console.log('this.$route.params.network', this.$route) |
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.
Remove this console.log
Add support for networks using WitnetFeeds contract
WitnetPriceRouter
withlistenLegacyPriceRouter
and the new network usingWitnetFeeds
withlistenWitnetPriceFeeds
.legacy: true
in the network configuration. Also, the file configuration has been updated to include the feed key. This new key consists of a map with the default values of the existing price feeds. According to that, the price feeds deployed using the default configuration have been deleted from the network feeds section. If a feed configuration appears in the network feeds, it will overwrite the default configuration. Now, we get all the available price feeds in a network called the supportedFeeds method.