Skip to content

Commit

Permalink
review(josheleonard): fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
onyb committed Jan 8, 2024
1 parent 524047c commit 23e549a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/util.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const sharp = require("sharp")
const fetch = require("node-fetch")
const { extension } = require("mime-types")
const { https } = require("follow-redirects")
const trustedCoingeckoIds = require('../data/solana/trusted-coingecko-ids.json')
const trustedCoingeckoIdsByChainId = require("../data/solana/trusted-coingecko-ids.json")

const contractReplaceSvgToPng = (file) => {
const data = JSON.parse(fs.readFileSync(file))
Expand Down Expand Up @@ -664,7 +664,7 @@ const generateCoingeckoIds = async () => {
return acc
}, {})

const coingeckoIds = coinList.reduce((acc, coin) => {
const coingeckoIdsByChainId = coinList.reduce((acc, coin) => {
Object.entries(coin.platforms).forEach(([platform, contractAddress]) => {
const chainId = assetPlatformsMap[platform]
if (!chainId || !contractAddress) {
Expand All @@ -685,9 +685,12 @@ const generateCoingeckoIds = async () => {
}, {})

return Object.fromEntries(
Object.keys(coingeckoIds).map((chainId) => [
Object.keys(coingeckoIdsByChainId).map((chainId) => [
chainId,
{ ...coingeckoIds[chainId], ...trustedCoingeckoIds[chainId] }
{
...coingeckoIdsByChainId[chainId],
...trustedCoingeckoIdsByChainId[chainId],
},
])
)
}
Expand Down

0 comments on commit 23e549a

Please sign in to comment.