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

feat: add conflux data feeds #20

Merged
merged 8 commits into from
Aug 27, 2021
Merged

Conversation

gabaldon
Copy link
Collaborator

@gabaldon gabaldon commented Jun 30, 2021

close #14
close #20
close #64
close #63

Comment on lines 41 to 44
console.log(
'resolve path: ',
path.resolve(process.env.DATA_FEED_CONFIG_PATH || './dataFeeds.json')
)
Copy link
Member

Choose a reason for hiding this comment

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

Preferently, let's move path.resolve(process.env.DATA_FEED_CONFIG_PATH || './dataFeeds.json') into a const statement before the logging, then we can reuse on line 48 to avoid code repetition and ensure that we are logging the path that is actually being used.

@gabaldon gabaldon force-pushed the add-conflux-feed branch 3 times, most recently from 5e03d68 to 99ddfc6 Compare August 24, 2021 15:51
@@ -77,7 +77,9 @@ export class Web3Middleware {
async entry => await this.listenToDataFeed(entry.feedInfo, entry.feedId)
)

Promise.all(promises)
Promise.all(promises).catch(err => {
console.error('[ERROR]', err.message)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.error('[ERROR]', err.message)
console.error(err)

Comment on lines 11 to 17
const dataFeeds = JSON.parse(
fs.readFileSync(
path.resolve('./test/web3Middleware/dataFeeds.json'),
'utf-8'
)
)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const dataFeeds = JSON.parse(
fs.readFileSync(
path.resolve('./test/web3Middleware/dataFeeds.json'),
'utf-8'
)
)
import dataFeeds from './test/web3Middleware/dataFeeds.json'

Comment on lines 13 to 16
const dataFeeds = JSON.parse(
fs.readFileSync(path.resolve('./test/web3Middleware/dataFeeds.json'), 'utf-8')
)

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const dataFeeds = JSON.parse(
fs.readFileSync(path.resolve('./test/web3Middleware/dataFeeds.json'), 'utf-8')
)
import dataFeeds from './test/web3Middleware/dataFeeds.json'

packages/api/test/web3Middleware/index.spec.ts Outdated Show resolved Hide resolved
packages/api/test/web3Middleware/index.spec.ts Outdated Show resolved Hide resolved
packages/ui/assets/styles/main.scss Show resolved Hide resolved
@gabaldon gabaldon merged commit 05f863c into witnet:main Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants