-
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
feat: add conflux data feeds #20
Conversation
a34c991
to
aad0260
Compare
aad0260
to
29fee3a
Compare
29fee3a
to
75c5315
Compare
793633c
to
f5bd8cc
Compare
packages/api/src/index.ts
Outdated
console.log( | ||
'resolve path: ', | ||
path.resolve(process.env.DATA_FEED_CONFIG_PATH || './dataFeeds.json') | ||
) |
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.
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.
5e03d68
to
99ddfc6
Compare
@@ -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) |
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.
console.error('[ERROR]', err.message) | |
console.error(err) |
packages/api/test/feeds.spec.ts
Outdated
const dataFeeds = JSON.parse( | ||
fs.readFileSync( | ||
path.resolve('./test/web3Middleware/dataFeeds.json'), | ||
'utf-8' | ||
) | ||
) |
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.
const dataFeeds = JSON.parse( | |
fs.readFileSync( | |
path.resolve('./test/web3Middleware/dataFeeds.json'), | |
'utf-8' | |
) | |
) | |
import dataFeeds from './test/web3Middleware/dataFeeds.json' |
const dataFeeds = JSON.parse( | ||
fs.readFileSync(path.resolve('./test/web3Middleware/dataFeeds.json'), 'utf-8') | ||
) | ||
|
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.
const dataFeeds = JSON.parse( | |
fs.readFileSync(path.resolve('./test/web3Middleware/dataFeeds.json'), 'utf-8') | |
) | |
import dataFeeds from './test/web3Middleware/dataFeeds.json' |
9ced57f
to
f322c2d
Compare
close #14
close #20
close #64
close #63