Merge pull request #113 from christroutner/unstable

fix(_this): Using _this instead of this
This commit is contained in:
Chris Troutner
2020-03-08 10:02:45 -07:00
committed by GitHub
2 changed files with 15 additions and 13 deletions
+7 -6
View File
@@ -20,12 +20,13 @@ let _this
class Control {
constructor () {
_this = this
this.axios = axios
this.routeUtils = routeUtils
this.router = router
this.router.get('/', this.root)
this.router.get('/getNetworkInfo', this.getNetworkInfo)
_this.axios = axios
_this.routeUtils = routeUtils
_this.router = router
_this.router.get('/', _this.root)
_this.router.get('/getNetworkInfo', _this.getNetworkInfo)
}
root (req, res, next) {
@@ -65,7 +66,7 @@ class Control {
try {
// const response = await BitboxHTTP(requestConfig)
const response = await this.axios.request(options)
const response = await _this.axios.request(options)
return res.json(response.data.result)
} catch (error) {
+8 -7
View File
@@ -18,13 +18,14 @@ let _this
class Mining {
constructor () {
_this = this
this.axios = axios
this.routeUtils = routeUtils
this.router = router
this.router.get('/', this.root)
this.router.get('/getMiningInfo', this.getMiningInfo)
this.router.get('/getNetworkHashPS', this.getNetworkHashPS)
_this.axios = axios
_this.routeUtils = routeUtils
_this.router = router
_this.router.get('/', _this.root)
_this.router.get('/getMiningInfo', _this.getMiningInfo)
_this.router.get('/getNetworkHashPS', _this.getNetworkHashPS)
}
root (req, res, next) {
@@ -124,7 +125,7 @@ class Mining {
options.data.method = 'getnetworkhashps'
options.data.params = [nblocks, height]
const response = await this.axios.request(options)
const response = await _this.axios.request(options)
return res.json(response.data.result)
} catch (err) {