-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use formmated custom logger, fix bug parsing env private key #72
Conversation
remove all nest js related prints. change all console to logger fix merge issue
env var was implicitly converted to the string of 'undefined'
0763b0e
to
1c8d259
Compare
@@ -1,5 +1,6 @@ | |||
import TimeAgo from 'javascript-time-ago'; | |||
import en from 'javascript-time-ago/locale/en'; | |||
import {CustomLogger} from "@cli/shared/services/logger.service"; |
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.
If you're using webstorm, add extension to support .editorconfig and also enable eslint --fix on save.
For example, this import should have spaces before and after class name
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.
V
@@ -80,7 +82,7 @@ export const transformClusterData = (items, extra: any) => { | |||
return order.indexOf(a.status.text) - order.indexOf(b.status.text); | |||
}); | |||
} catch (e) { | |||
console.log(e); | |||
logger.error(e); |
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.
Add more descriptive explanation, showing that it was attempt to trnsform cluster data. not just raw error
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.
V
@@ -1,9 +1,12 @@ | |||
import {CustomLogger} from "@cli/shared/services/logger.service"; |
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.
same in all files with imports
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.
V
@@ -16,7 +19,7 @@ export const transformEarningData = items => { | |||
}); | |||
} | |||
} catch (e) { | |||
console.log(e); | |||
logger.error(e); |
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.
more details
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.
V
constructor(private _fetchTask: FetchTask) {} | ||
|
||
@Cron(CronExpression.EVERY_SECOND) | ||
async fetchNewValidators(): Promise<void> { | ||
try { | ||
await this._fetchTask.fetchAllEvents(); | ||
} catch (e) { | ||
console.log(e); | ||
this._logger.error(e); |
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.
same
constructor(private _liquidationTask: LiquidationTask) {} | ||
|
||
@Cron(CronExpression.EVERY_10_SECONDS) | ||
async liquidate(): Promise<void> { | ||
try { | ||
await this._liquidationTask.liquidate(); | ||
} catch (e) { | ||
console.log(e); | ||
this._logger.error(e); |
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.
same
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.
V
src/services/worker/worker.tsx
Outdated
// eslint-disable-next-line no-console | ||
console.info(`WebApp is running on port: ${port}`); | ||
app.useLogger(logger); | ||
logger.log('API is active'); |
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.
This is useless log
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.
V
src/shared/services/web3.provider.ts
Outdated
@@ -119,6 +115,8 @@ export class Web3Provider { | |||
genesisBlock: jsonCoreData.genesisBlock, | |||
}; | |||
|
|||
|
|||
|
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.
Too many empty lines
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.
V
src/shared/services/web3.provider.ts
Outdated
@@ -131,9 +129,13 @@ export class Web3Provider { | |||
hash: new Web3().utils.keccak256(error).substring(0, 10), | |||
}); | |||
} | |||
|
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.
Not necessary to have this empty line
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.
Looking at the code, the constructor is too long and should be broken down to small functions, having some empty lines seperates different common logics in the function and makes it more readable imo. I prefer not start to refactor it as part of the CR of this PR. will do it in a different one. removed the space.
src/shared/services/web3.provider.ts
Outdated
@@ -149,6 +151,16 @@ export class Web3Provider { | |||
return this.contract.abiViews as any; | |||
} | |||
|
|||
async printConfig(){ | |||
|
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.
Empty line
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.
It's not there already
@meshin-dev I addresses all your comments, please re-review |
No description provided.