Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8879 add umee #9500

Merged
merged 4 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Binary file not shown.
22 changes: 16 additions & 6 deletions packages/orchestration/scripts/fetch-chain-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const chainNames = [
'secretnetwork',
'stargaze',
'stride',
'umee',
];

const client = new ChainRegistryClient({
Expand All @@ -57,6 +58,16 @@ function toConnectionEntry(ibcInfo: IBCInfo, name: string) {
// @ts-expect-error tags does not specify keys
c.tags?.preferred,
);
if (transferChannels.length === 0) {
console.warn(
'no transfer channel for [',
from.chain_name,
to.chain_name,
']',
'(skipping)',
);
return [];
}
if (transferChannels.length > 1) {
console.warn(
'multiple preferred transfer channels [',
Expand Down Expand Up @@ -94,7 +105,7 @@ function toConnectionEntry(ibcInfo: IBCInfo, name: string) {
},
} as IBCConnectionInfo;
const destChainId = chainInfo[to.chain_name].chainId;
return [destChainId, record];
return [destChainId, record] as const;
}

for (const name of chainNames) {
Expand All @@ -104,10 +115,10 @@ for (const name of chainNames) {
chainInfo[name] = {
chainId: chain.chain_id,
stakingTokens: chain.staking?.staking_tokens,
// UNTIL https://github.com/Agoric/agoric-sdk/issues/9326
icqEnabled: name === 'osmosis',
};
}
// UNTIL https://github.com/Agoric/agoric-sdk/issues/9326
chainInfo.osmosis = { ...chainInfo.osmosis, icqEnabled: true };

// iterate this after chainInfo is filled out
for (const name of chainNames) {
Expand All @@ -117,9 +128,8 @@ for (const name of chainNames) {
const connections = Object.fromEntries(
ibcData
.map(datum => toConnectionEntry(datum, name))
// sort alphbetically for consistency
// eslint-disable-next-line no-nested-ternary
.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)),
// sort alphabetically for consistency
.sort(([a], [b]) => a?.localeCompare(b)),
);
chainInfo[name] = { ...chainInfo[name], connections };
}
Expand Down
Loading
Loading