-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
@@ -51,15 +51,30 @@ export function inHash (hash) { | |||
return inHex(hash); | |||
} | |||
|
|||
export function pad (input, length) { | |||
export function padRight (input, length) { |
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.
Move to /api/util/format.js
? (pad{left,Right})
// Fetch all tokens every 2 minutes | ||
this.throttledTokensFetch = throttle( | ||
this.fetchTokens, | ||
2 * 60 * 1000, |
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.
Start at 60s
format: format.toString(), | ||
id: tokenId, | ||
image: hashToImageUrl(image), | ||
|
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.
extra line to be removed?
|
||
const initialState = { | ||
balances: {}, | ||
tokens: {} | ||
tokens: {}, | ||
|
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.
extra line to be removed?
} | ||
|
||
const balance = Object.assign({}, balances[address]); | ||
|
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.
extra blank (and 2 down as well, doesn't add much in terms of readability)
} | ||
|
||
if (this._manifests[manifestHash]) { | ||
return this._manifests[manifestHash]; |
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.
Promise.resolve?
@jacogr Should be ok now :) |
Closes #3590
This might also (hopefully) close #3240
Fetching balances is done smarter, in several ways:
It is likely that every token used will implement the correct Transfer event. Some implementations might differ, or for example when buying some GavCoin (tokens created). Thus all the balances are fetched every 2 minutes, just to be sure.