Skip to content

Commit

Permalink
Update script to log and then ignore unregistered assets (#2079)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyParish69 authored Nov 22, 2024
1 parent d3e1306 commit 182dd36
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 24 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/utility/generate_assetlist.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ import { getAssetsPricing } from "./getPools.mjs";
import { getAllRelatedAssets } from "./getRelatedAssets.mjs";
import * as assetlist from "./generate_assetlist_functions.mjs";
import * as localization from "./localization.mjs";

import * as state from "./update_assetlist_state.mjs";


//-- Flags --
const getPools = true;
const getRelatedAssets = false; //not implemented


//-- Functions --

async function asyncForEach(array, callback) {
Expand All @@ -33,9 +37,11 @@ const generateAssets = async (

//--Get Pool Data--
let pool_assets;
pool_assets = await getAssetsPricing(chainName);
if (!pool_assets) {
return;
if (getPools) {
pool_assets = await getAssetsPricing(chainName);
if (!pool_assets) {
return;
}
}
const pool_data = pool_assets;

Expand All @@ -60,6 +66,12 @@ const generateAssets = async (
//source_asset (the most recent ibc transfer source (not necessarily the origin))
assetlist.setSourceAsset(asset_data);

//make usre it exists
if (!chain_reg.getAssetProperty(asset_data.source_asset.chain_name, asset_data.source_asset.base_denom, "base")) {
console.log(`Asset does not exist! ${asset_data.source_asset.chain_name}, ${asset_data.source_asset.base_denom}`);
return;
}

//local_asset (e.g., uosmo, ibc/27..., factory/.../milkTIA, ...)
await assetlist.setLocalAsset(asset_data);

Expand Down
2 changes: 1 addition & 1 deletion osmosis-1/generated/asset_detail/assetlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -2822,7 +2822,7 @@
"name": "Spice",
"symbol": "SPICE",
"description": "The Spice memecoin",
"twitterURL": "https://x.com/spice_coin_"
"twitterURL": "https://x.com/spiceoncosmos"
},
{
"name": "Yum",
Expand Down
22 changes: 13 additions & 9 deletions osmosis-1/generated/chain_registry/assetlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -18035,10 +18035,10 @@
"description": "The token of Crowdpunk DAO",
"denom_units": [
{
"denom": "ibc/B87F0F5255CC658408F167C2F7B987A8D914622E1F73BCC267406360588F2B1E",
"denom": "ibc/5EC896BED3EBCB2CB6F1C167582E4EFA3F6FA3385F28BA5EA92D4A489DA010C5",
"exponent": 0,
"aliases": [
"erc20/0xfbf4318d24a93753f11d365a6dcf8b830e98ab0f"
"erc20/0xfbF4318d24a93753F11d365A6dcF8b830e98Ab0F"
]
},
{
Expand All @@ -18047,7 +18047,7 @@
}
],
"type_asset": "ics20",
"base": "ibc/B87F0F5255CC658408F167C2F7B987A8D914622E1F73BCC267406360588F2B1E",
"base": "ibc/5EC896BED3EBCB2CB6F1C167582E4EFA3F6FA3385F28BA5EA92D4A489DA010C5",
"name": "Crowdpunk DAO",
"display": "crowdp",
"symbol": "CROWDP",
Expand All @@ -18056,12 +18056,12 @@
"type": "ibc",
"counterparty": {
"chain_name": "evmos",
"base_denom": "erc20/0xfbf4318d24a93753f11d365a6dcf8b830e98ab0f",
"base_denom": "erc20/0xfbF4318d24a93753F11d365A6dcF8b830e98Ab0F",
"channel_id": "channel-0"
},
"chain": {
"channel_id": "channel-204",
"path": "transfer/channel-204/erc20/0xfbf4318d24a93753f11d365a6dcf8b830e98ab0f"
"path": "transfer/channel-204/erc20/0xfbF4318d24a93753F11d365A6dcF8b830e98Ab0F"
}
}
],
Expand All @@ -18073,7 +18073,7 @@
{
"image_sync": {
"chain_name": "evmos",
"base_denom": "erc20/0xfbf4318d24a93753f11d365a6dcf8b830e98ab0f"
"base_denom": "erc20/0xfbF4318d24a93753F11d365A6dcF8b830e98Ab0F"
},
"png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/evmos/images/crowdp.png",
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/evmos/images/crowdp.svg",
Expand Down Expand Up @@ -21994,10 +21994,14 @@
}
],
"logo_URIs": {
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/tron/images/trx.svg",
"png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/tron/images/trx.png"
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/trx.rt.svg",
"png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/trx.rt.png"
},
"images": [
{
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/trx.rt.svg",
"png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/trx.rt.png"
},
{
"image_sync": {
"chain_name": "tron",
Expand Down Expand Up @@ -25343,7 +25347,7 @@
"meme"
],
"socials": {
"twitter": "https://x.com/spice_coin_"
"twitter": "https://x.com/spiceoncosmos"
}
},
{
Expand Down
20 changes: 12 additions & 8 deletions osmosis-1/generated/frontend/assetlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -19401,14 +19401,18 @@
},
{
"chainName": "evmos",
"sourceDenom": "erc20/0xfbf4318d24a93753f11d365a6dcf8b830e98ab0f",
"coinMinimalDenom": "ibc/B87F0F5255CC658408F167C2F7B987A8D914622E1F73BCC267406360588F2B1E",
"sourceDenom": "erc20/0xfbF4318d24a93753F11d365A6dcF8b830e98Ab0F",
"coinMinimalDenom": "ibc/5EC896BED3EBCB2CB6F1C167582E4EFA3F6FA3385F28BA5EA92D4A489DA010C5",
"symbol": "CROWDP",
"decimals": 18,
"logoURIs": {
"png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/evmos/images/crowdp.png",
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/evmos/images/crowdp.svg"
},
"price": {
"poolId": "1682",
"denom": "ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4"
},
"categories": [],
"transferMethods": [
{
Expand All @@ -19422,21 +19426,21 @@
"counterparty": {
"chainName": "evmos",
"chainId": "evmos_9001-2",
"sourceDenom": "erc20/0xfbf4318d24a93753f11d365a6dcf8b830e98ab0f",
"sourceDenom": "erc20/0xfbF4318d24a93753F11d365A6dcF8b830e98Ab0F",
"port": "transfer",
"channelId": "channel-0"
},
"chain": {
"port": "transfer",
"channelId": "channel-204",
"path": "transfer/channel-204/erc20/0xfbf4318d24a93753f11d365a6dcf8b830e98ab0f"
"path": "transfer/channel-204/erc20/0xfbF4318d24a93753F11d365A6dcF8b830e98Ab0F"
}
}
],
"counterparty": [
{
"chainName": "evmos",
"sourceDenom": "erc20/0xfbf4318d24a93753f11d365a6dcf8b830e98ab0f",
"sourceDenom": "erc20/0xfbF4318d24a93753F11d365A6dcF8b830e98Ab0F",
"chainType": "cosmos",
"chainId": "evmos_9001-2",
"symbol": "CROWDP",
Expand All @@ -19447,7 +19451,7 @@
}
}
],
"variantGroupKey": "ibc/B87F0F5255CC658408F167C2F7B987A8D914622E1F73BCC267406360588F2B1E",
"variantGroupKey": "ibc/5EC896BED3EBCB2CB6F1C167582E4EFA3F6FA3385F28BA5EA92D4A489DA010C5",
"name": "Crowdpunk DAO",
"isAlloyed": false,
"verified": false,
Expand Down Expand Up @@ -23370,8 +23374,8 @@
"symbol": "TRX.rt",
"decimals": 6,
"logoURIs": {
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/tron/images/trx.svg",
"png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/tron/images/trx.png"
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/trx.rt.svg",
"png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/trx.rt.png"
},
"categories": [],
"transferMethods": [
Expand Down
4 changes: 2 additions & 2 deletions osmosis-1/osmosis.zone_assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -3606,8 +3606,8 @@
},
{
"chain_name": "evmos",
"base_denom": "erc20/0xfbf4318d24a93753f11d365a6dcf8b830e98ab0f",
"path": "transfer/channel-204/erc20/0xfbf4318d24a93753f11d365a6dcf8b830e98ab0f",
"base_denom": "erc20/0xfbF4318d24a93753F11d365A6dcF8b830e98Ab0F",
"path": "transfer/channel-204/erc20/0xfbF4318d24a93753F11d365A6dcF8b830e98Ab0F",
"osmosis_verified": false,
"transfer_methods": [
{
Expand Down

0 comments on commit 182dd36

Please sign in to comment.