Skip to content

Commit

Permalink
Merge pull request #740 from matter-labs/jazzandrock/explorer
Browse files Browse the repository at this point in the history
Use id to token mapping instead of array
  • Loading branch information
popzxc authored Jun 17, 2020
2 parents 208641d + 41a8af1 commit ae97091
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions js/explorer/src/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ export class Client {
window.syncProvider = await zksync.Provider.newHttpProvider(config.HTTP_RPC_API_ADDR);
const tokensPromise = window.syncProvider.getTokens()
.then(tokens => {
return Object.values(tokens)
.map(token => {
const symbol = token.symbol || `${token.id.toString().padStart(3, '0')}`;
const syncSymbol = `${symbol}`;
return {
...token,
symbol,
syncSymbol,
};
})
.sort((a, b) => a.id - b.id);
const res = {};
for (const token of Object.values(tokens)) {
const symbol = token.symbol || `${token.id.toString().padStart(3, '0')}`;
const syncSymbol = `${symbol}`;
res[token.id] = {
...token,
symbol,
syncSymbol,
};
}
return res;
});
const blockExplorerClient = new BlockExplorerClient(config.API_SERVER);
const ethersProvider = config.ETH_NETWORK == 'localhost'
Expand Down

0 comments on commit ae97091

Please sign in to comment.