-
-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We were needlessly ignoring .js files in our eslint and prettier configs.
- Loading branch information
Showing
4 changed files
with
31 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
const { | ||
TokenRatesController | ||
} = require('./dist'); | ||
const { TokenRatesController } = require('./dist'); | ||
|
||
const assets = new TokenRatesController({ | ||
disabled: false, | ||
interval: 1000, | ||
nativeCurrency: 'usd', | ||
tokens: [ | ||
{ address: '0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359' }, | ||
{ address: '0x960b236A07cf122663c4303350609A66A7B288C0' }, | ||
{ address: '0xB8c77482e45F1F44dE1745F52C74426C631bDD52' }, | ||
{ address: '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2' } | ||
] | ||
disabled: false, | ||
interval: 1000, | ||
nativeCurrency: 'usd', | ||
tokens: [ | ||
{ address: '0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359' }, | ||
{ address: '0x960b236A07cf122663c4303350609A66A7B288C0' }, | ||
{ address: '0xB8c77482e45F1F44dE1745F52C74426C631bDD52' }, | ||
{ address: '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2' }, | ||
], | ||
}); | ||
|
||
assets.subscribe(console.log); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
const sinon = require('sinon') | ||
const sinon = require('sinon'); | ||
|
||
const mockHex = '0xabcdef0123456789' | ||
const mockKey = Buffer.alloc(32) | ||
let cacheVal | ||
const mockHex = '0xabcdef0123456789'; | ||
const mockKey = Buffer.alloc(32); | ||
let cacheVal; | ||
|
||
module.exports = { | ||
encrypt: sinon.stub().callsFake(function (_password, dataObj) { | ||
cacheVal = dataObj | ||
return Promise.resolve(mockHex) | ||
cacheVal = dataObj; | ||
return Promise.resolve(mockHex); | ||
}), | ||
|
||
decrypt (_password, _text) { | ||
return Promise.resolve(cacheVal || {}) | ||
decrypt(_password, _text) { | ||
return Promise.resolve(cacheVal || {}); | ||
}, | ||
|
||
encryptWithKey (key, dataObj) { | ||
return this.encrypt(key, dataObj) | ||
encryptWithKey(key, dataObj) { | ||
return this.encrypt(key, dataObj); | ||
}, | ||
|
||
decryptWithKey (key, text) { | ||
return this.decrypt(key, text) | ||
decryptWithKey(key, text) { | ||
return this.decrypt(key, text); | ||
}, | ||
|
||
keyFromPassword (_password) { | ||
return Promise.resolve(mockKey) | ||
keyFromPassword(_password) { | ||
return Promise.resolve(mockKey); | ||
}, | ||
|
||
generateSalt () { | ||
return 'WHADDASALT!' | ||
generateSalt() { | ||
return 'WHADDASALT!'; | ||
}, | ||
} | ||
}; |