Skip to content

Commit

Permalink
feat: check that networks staking currency is valid
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Meier <[email protected]>
  • Loading branch information
n0izn0iz committed Apr 17, 2024
1 parent 5f51d8e commit 1508958
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/networks/cosmos-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ const banList = [
"coreum",
"seitestnet2",
"lavatestnet2",
"celestiatestnet2",
"babylontestnet",
"bitcannadevnet",
"bitcannadevnet2",
"celestiatestnet",
"chain4energy",
"cheqdtestnet",
"chimba",
"chimbatestnet",
"chronicnetwork",
];

export const networksFromCosmosRegistry = (): CosmosNetworkInfo[] => {
Expand Down
8 changes: 8 additions & 0 deletions packages/scripts/validateNetworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ for (const net of allNetworks) {
}
}
}
// check staking currency
if (net.kind === NetworkKind.Cosmos) {
if (!net.currencies.find((c) => c.denom === net.stakeCurrency)) {
throw new Error(
`staking currency '${net.stakeCurrency}' of network '${net.id}' is not a currency of this network`,
);
}
}

// check features
const features: { [key: string]: boolean } = {};
Expand Down

0 comments on commit 1508958

Please sign in to comment.