From 20d0ffb682a100384edce66ea72a0b7fa63e1550 Mon Sep 17 00:00:00 2001 From: Gabe Rodriguez Date: Mon, 6 May 2024 09:57:12 +0200 Subject: [PATCH] Add counter party channels to registry --- input/penumbra-testnet-deimos-6.json | 6 +- input/penumbra-testnet-deimos-7.json | 6 +- npm/CHANGELOG.md | 6 + npm/package.json | 2 +- npm/src/registry.test.ts | 3 +- npm/src/registry.ts | 3 +- registry/penumbra-testnet-deimos-6.json | 243 ++++++++++++------------ registry/penumbra-testnet-deimos-7.json | 6 +- tools/compiler/src/parser.rs | 3 +- tools/compiler/src/processor.rs | 8 +- tools/compiler/tests/test_processor.rs | 3 +- 11 files changed, 155 insertions(+), 134 deletions(-) diff --git a/input/penumbra-testnet-deimos-6.json b/input/penumbra-testnet-deimos-6.json index f7a17c8..7a15ee6 100644 --- a/input/penumbra-testnet-deimos-6.json +++ b/input/penumbra-testnet-deimos-6.json @@ -15,7 +15,8 @@ { "displayName": "Osmosis", "chainId": "osmo-test-5", - "ibcChannel": "channel-3", + "channelId": "channel-4", + "counterpartyChannelId": "channel-7780", "addressPrefix": "osmo", "cosmosRegistryDir": "testnets/osmosistestnet", "images": [ @@ -27,7 +28,8 @@ { "displayName": "Noble", "chainId": "grand-1", - "ibcChannel": "channel-2", + "channelId": "channel-3", + "counterpartyChannelId": "channel-164", "addressPrefix": "noble", "cosmosRegistryDir": "testnets/nobletestnet", "images": [ diff --git a/input/penumbra-testnet-deimos-7.json b/input/penumbra-testnet-deimos-7.json index f3fd5b0..4e69414 100644 --- a/input/penumbra-testnet-deimos-7.json +++ b/input/penumbra-testnet-deimos-7.json @@ -15,7 +15,8 @@ { "displayName": "Osmosis", "chainId": "osmo-test-5", - "ibcChannel": "channel-4", + "channelId": "channel-4", + "counterpartyChannelId": "channel-7780", "addressPrefix": "osmo", "cosmosRegistryDir": "testnets/osmosistestnet", "images": [ @@ -27,7 +28,8 @@ { "displayName": "Noble", "chainId": "grand-1", - "ibcChannel": "channel-3", + "channelId": "channel-3", + "counterpartyChannelId": "channel-164", "addressPrefix": "noble", "cosmosRegistryDir": "testnets/nobletestnet", "images": [ diff --git a/npm/CHANGELOG.md b/npm/CHANGELOG.md index 843d578..1a7ddf4 100644 --- a/npm/CHANGELOG.md +++ b/npm/CHANGELOG.md @@ -1,5 +1,11 @@ # @penumbra-labs/registry +## 6.0.0 + +### Major Changes + +- Counterparty chain id added + renamed ibcChannel to channelId + ## 5.2.0 ### Minor Changes diff --git a/npm/package.json b/npm/package.json index b6fe192..8289b53 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,6 +1,6 @@ { "name": "@penumbra-labs/registry", - "version": "5.2.0", + "version": "6.0.0", "description": "Chain and asset registry for Penumbra", "main": "./dist/index.js", "module": "./dist/index.mjs", diff --git a/npm/src/registry.test.ts b/npm/src/registry.test.ts index caa3a4a..a047c1c 100644 --- a/npm/src/registry.test.ts +++ b/npm/src/registry.test.ts @@ -10,7 +10,8 @@ const testRegistry: GithubRegistryResponse = { { addressPrefix: 'osmo', chainId: 'osmo-test-5', - ibcChannel: 'channel-3', + channelId: 'channel-4', + counterpartyChannelId: 'channel-7780', displayName: 'Osmosis', images: [ { diff --git a/npm/src/registry.ts b/npm/src/registry.ts index b3b589f..19f5475 100644 --- a/npm/src/registry.ts +++ b/npm/src/registry.ts @@ -10,7 +10,8 @@ export type Base64AssetId = Stringified; export interface Chain { addressPrefix: string; chainId: string; - ibcChannel: string; + channelId: string; + counterpartyChannelId: string; images: Image[]; displayName: string; } diff --git a/registry/penumbra-testnet-deimos-6.json b/registry/penumbra-testnet-deimos-6.json index 14fd768..5d47dd2 100644 --- a/registry/penumbra-testnet-deimos-6.json +++ b/registry/penumbra-testnet-deimos-6.json @@ -4,7 +4,8 @@ { "addressPrefix": "osmo", "chainId": "osmo-test-5", - "ibcChannel": "channel-3", + "channelId": "channel-4", + "counterpartyChannelId": "channel-7780", "displayName": "Osmosis", "images": [ { @@ -15,7 +16,8 @@ { "addressPrefix": "noble", "chainId": "grand-1", - "ibcChannel": "channel-2", + "channelId": "channel-3", + "counterpartyChannelId": "channel-164", "displayName": "Noble", "images": [ { @@ -36,24 +38,30 @@ } ], "assetById": { - "2l5fLuem6wiMOhuIqDF3XGFa20EfBV7XAYmTvKN55Q4=": { - "description": "Love is a test tokenfactory asset controlled by the Strangelove Team", + "+jDercxZxs90BjC91PrWyA53/p7uN3ZcSJj3N0mHjhI=": { + "description": "USDLR is a fiat-backed stablecoin issued by Stable. Stable pays DeFi protocols who distribute USDLR.", "denomUnits": [ { - "denom": "transfer/channel-2/ulove" + "denom": "transfer/channel-3/uusdlr" }, { - "denom": "transfer/channel-2/love", + "denom": "transfer/channel-3/usdlr", "exponent": 6 } ], - "base": "transfer/channel-2/ulove", - "display": "transfer/channel-2/love", - "name": "Love", - "symbol": "LOVE", + "base": "transfer/channel-3/uusdlr", + "display": "transfer/channel-3/usdlr", + "name": "USDLR by Stable", + "symbol": "USDLR", "penumbraAssetId": { - "inner": "2l5fLuem6wiMOhuIqDF3XGFa20EfBV7XAYmTvKN55Q4=" - } + "inner": "+jDercxZxs90BjC91PrWyA53/p7uN3ZcSJj3N0mHjhI=" + }, + "images": [ + { + "png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/testnets/nobletestnet/images/usdlr.png", + "svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/testnets/nobletestnet/images/usdlr.svg" + } + ] }, "6KBVsPINa8gWSHhfH+kAFJC4afEJA3EtuB2HyCqJUws=": { "denomUnits": [ @@ -68,54 +76,53 @@ "inner": "6KBVsPINa8gWSHhfH+kAFJC4afEJA3EtuB2HyCqJUws=" } }, - "CwpUYIdQ9H5Dnf3oQ1l7ISeVMVahWbVNNvMA0dBSdwI=": { + "CKBQapu+DkQpsKyTfKESLTV19/NPWR5sNZtvQsd3Hw8=": { + "description": "USD Coin", "denomUnits": [ { - "denom": "delegation_penumbravalid18nkv0r3sfp2seleq6du5kt3mhfce3k6cqm77kj2e7mhakmyw9v9qx42a20", - "exponent": 6 - }, - { - "denom": "mdelegation_penumbravalid18nkv0r3sfp2seleq6du5kt3mhfce3k6cqm77kj2e7mhakmyw9v9qx42a20", - "exponent": 3 + "denom": "transfer/channel-3/uusdc" }, { - "denom": "udelegation_penumbravalid18nkv0r3sfp2seleq6du5kt3mhfce3k6cqm77kj2e7mhakmyw9v9qx42a20" + "denom": "transfer/channel-3/usdc", + "exponent": 6 } ], - "base": "udelegation_penumbravalid18nkv0r3sfp2seleq6du5kt3mhfce3k6cqm77kj2e7mhakmyw9v9qx42a20", - "display": "delegation_penumbravalid18nkv0r3sfp2seleq6du5kt3mhfce3k6cqm77kj2e7mhakmyw9v9qx42a20", - "symbol": "Delegation (Penumbra Labs CI 1)", + "base": "transfer/channel-3/uusdc", + "display": "transfer/channel-3/usdc", + "name": "USD Coin", + "symbol": "USDC", "penumbraAssetId": { - "inner": "CwpUYIdQ9H5Dnf3oQ1l7ISeVMVahWbVNNvMA0dBSdwI=" + "inner": "CKBQapu+DkQpsKyTfKESLTV19/NPWR5sNZtvQsd3Hw8=" }, "images": [ { - "png": "https://raw.githubusercontent.com/prax-wallet/registry/main/images/penumbra-favicon.png" + "svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/ethereum/images/usdc.svg" } ] }, - "FQo69KceOETEAvrREa1+GAoesN44ISBMleaEz43HCgA=": { - "description": "USDLR is a fiat-backed stablecoin issued by Stable. Stable pays DeFi protocols who distribute USDLR.", + "CwpUYIdQ9H5Dnf3oQ1l7ISeVMVahWbVNNvMA0dBSdwI=": { "denomUnits": [ { - "denom": "transfer/channel-2/uusdlr" + "denom": "delegation_penumbravalid18nkv0r3sfp2seleq6du5kt3mhfce3k6cqm77kj2e7mhakmyw9v9qx42a20", + "exponent": 6 }, { - "denom": "transfer/channel-2/usdlr", - "exponent": 6 + "denom": "mdelegation_penumbravalid18nkv0r3sfp2seleq6du5kt3mhfce3k6cqm77kj2e7mhakmyw9v9qx42a20", + "exponent": 3 + }, + { + "denom": "udelegation_penumbravalid18nkv0r3sfp2seleq6du5kt3mhfce3k6cqm77kj2e7mhakmyw9v9qx42a20" } ], - "base": "transfer/channel-2/uusdlr", - "display": "transfer/channel-2/usdlr", - "name": "USDLR by Stable", - "symbol": "USDLR", + "base": "udelegation_penumbravalid18nkv0r3sfp2seleq6du5kt3mhfce3k6cqm77kj2e7mhakmyw9v9qx42a20", + "display": "delegation_penumbravalid18nkv0r3sfp2seleq6du5kt3mhfce3k6cqm77kj2e7mhakmyw9v9qx42a20", + "symbol": "Delegation (Penumbra Labs CI 1)", "penumbraAssetId": { - "inner": "FQo69KceOETEAvrREa1+GAoesN44ISBMleaEz43HCgA=" + "inner": "CwpUYIdQ9H5Dnf3oQ1l7ISeVMVahWbVNNvMA0dBSdwI=" }, "images": [ { - "png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/testnets/nobletestnet/images/usdlr.png", - "svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/testnets/nobletestnet/images/usdlr.svg" + "png": "https://raw.githubusercontent.com/prax-wallet/registry/main/images/penumbra-favicon.png" } ] }, @@ -140,147 +147,118 @@ "inner": "HW2Eq3UZVSBttoUwUi/MUtE7rr2UU7/UH500byp7OAc=" } }, - "KeqcLzNx9qSH5+lcJHBB9KNW+YPrBk5dKzvPMiypahA=": { + "Hqn6gTCqE7mCBsVa4agsTFmrO0Rip5xmLcipnGKH9AI=": { + "description": "Love is a test tokenfactory asset controlled by the Strangelove Team", "denomUnits": [ { - "denom": "penumbra", - "exponent": 6 + "denom": "transfer/channel-3/ulove" }, { - "denom": "mpenumbra", - "exponent": 3 - }, - { - "denom": "upenumbra" + "denom": "transfer/channel-3/love", + "exponent": 6 } ], - "base": "upenumbra", - "display": "penumbra", - "symbol": "UM", + "base": "transfer/channel-3/ulove", + "display": "transfer/channel-3/love", + "name": "Love", + "symbol": "LOVE", "penumbraAssetId": { - "inner": "KeqcLzNx9qSH5+lcJHBB9KNW+YPrBk5dKzvPMiypahA=" - }, - "images": [ - { - "svg": "https://raw.githubusercontent.com/prax-wallet/registry/main/images/um.svg" - } - ] + "inner": "Hqn6gTCqE7mCBsVa4agsTFmrO0Rip5xmLcipnGKH9AI=" + } }, - "L9R9m9YsAZvGRjGXogRmLJ8n/VUQxHNiNT6dYnuG2QI=": { + "KSOgqHs6JCHxZcyFPb9zqb2vtdoNlIVktgWcsCF8RAc=": { + "description": "The native token of Osmosis", "denomUnits": [ { - "denom": "transfer/channel-3/factory/osmo1zlkzu72774ynac53necz46u4ycqtp36wedrar0/willyz" + "denom": "transfer/channel-4/uosmo" }, { - "denom": "transfer/channel-3/willyz", + "denom": "transfer/channel-4/osmo", "exponent": 6 } ], - "base": "transfer/channel-3/factory/osmo1zlkzu72774ynac53necz46u4ycqtp36wedrar0/willyz", - "display": "transfer/channel-3/willyz", - "name": "Willyz", - "symbol": "WILLYZ", + "base": "transfer/channel-4/uosmo", + "display": "transfer/channel-4/osmo", + "name": "Osmosis Testnet", + "symbol": "OSMO", "penumbraAssetId": { - "inner": "L9R9m9YsAZvGRjGXogRmLJ8n/VUQxHNiNT6dYnuG2QI=" + "inner": "KSOgqHs6JCHxZcyFPb9zqb2vtdoNlIVktgWcsCF8RAc=" }, "images": [ { - "png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/testnets/osmosistestnet/images/willyz.png", - "svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/testnets/osmosistestnet/images/willyz.svg" + "png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/osmo.png", + "svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/osmo.svg" } ] }, - "N6cjbF+9/ztCnmEb035XRlDJCgxwm4Q+apv5m73ZGgA=": { - "description": "The controlled staking asset for Noble Chain", + "KeqcLzNx9qSH5+lcJHBB9KNW+YPrBk5dKzvPMiypahA=": { "denomUnits": [ { - "denom": "transfer/channel-2/ustake" - }, - { - "denom": "transfer/channel-2/stake", + "denom": "penumbra", "exponent": 6 - } - ], - "base": "transfer/channel-2/ustake", - "display": "transfer/channel-2/stake", - "name": "Stake", - "symbol": "STAKE", - "penumbraAssetId": { - "inner": "N6cjbF+9/ztCnmEb035XRlDJCgxwm4Q+apv5m73ZGgA=" - } - }, - "drPksQaBNYwSOzgfkGOEdrd4kEDkeALeh58Ps+7cjQs=": { - "description": "USD Coin", - "denomUnits": [ + }, { - "denom": "transfer/channel-2/uusdc" + "denom": "mpenumbra", + "exponent": 3 }, { - "denom": "transfer/channel-2/usdc", - "exponent": 6 + "denom": "upenumbra" } ], - "base": "transfer/channel-2/uusdc", - "display": "transfer/channel-2/usdc", - "name": "USD Coin", - "symbol": "USDC", + "base": "upenumbra", + "display": "penumbra", + "symbol": "UM", "penumbraAssetId": { - "inner": "drPksQaBNYwSOzgfkGOEdrd4kEDkeALeh58Ps+7cjQs=" + "inner": "KeqcLzNx9qSH5+lcJHBB9KNW+YPrBk5dKzvPMiypahA=" }, "images": [ { - "svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/ethereum/images/usdc.svg" + "svg": "https://raw.githubusercontent.com/prax-wallet/registry/main/images/um.svg" } ] }, - "fLgjA/jT2EN7SFFeKUgZkL8UePmcz5qvNO/CyDBSwQE=": { - "description": "The native token of Osmosis", + "ZPcze3Lhpgavnk2eQ/N49hJGttezr+Gl3TiJeL6MvhE=": { "denomUnits": [ { - "denom": "transfer/channel-3/uosmo" + "denom": "transfer/channel-4/factory/osmo1zlkzu72774ynac53necz46u4ycqtp36wedrar0/willyz" }, { - "denom": "transfer/channel-3/osmo", + "denom": "transfer/channel-4/willyz", "exponent": 6 } ], - "base": "transfer/channel-3/uosmo", - "display": "transfer/channel-3/osmo", - "name": "Osmosis Testnet", - "symbol": "OSMO", + "base": "transfer/channel-4/factory/osmo1zlkzu72774ynac53necz46u4ycqtp36wedrar0/willyz", + "display": "transfer/channel-4/willyz", + "name": "Willyz", + "symbol": "WILLYZ", "penumbraAssetId": { - "inner": "fLgjA/jT2EN7SFFeKUgZkL8UePmcz5qvNO/CyDBSwQE=" + "inner": "ZPcze3Lhpgavnk2eQ/N49hJGttezr+Gl3TiJeL6MvhE=" }, "images": [ { - "png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/osmo.png", - "svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/osmo.svg" + "png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/testnets/osmosistestnet/images/willyz.png", + "svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/testnets/osmosistestnet/images/willyz.svg" } ] }, - "jDzeCQh7I0QAuojFcbiG8oSZswf2FwcUUAH57zdMfgk=": { + "hGwO3SuE1/D05ooLMUVVe7XvYbAFnxAUbIRIZdG3TwI=": { + "description": "The controlled staking asset for Noble Chain", "denomUnits": [ { - "denom": "transfer/channel-3/uion" + "denom": "transfer/channel-3/ustake" }, { - "denom": "transfer/channel-3/ion", + "denom": "transfer/channel-3/stake", "exponent": 6 } ], - "base": "transfer/channel-3/uion", - "display": "transfer/channel-3/ion", - "name": "Ion", - "symbol": "ION", + "base": "transfer/channel-3/ustake", + "display": "transfer/channel-3/stake", + "name": "Stake", + "symbol": "STAKE", "penumbraAssetId": { - "inner": "jDzeCQh7I0QAuojFcbiG8oSZswf2FwcUUAH57zdMfgk=" - }, - "images": [ - { - "png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/ion.png", - "svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/ion.svg" - } - ] + "inner": "hGwO3SuE1/D05ooLMUVVe7XvYbAFnxAUbIRIZdG3TwI=" + } }, "nDjzm+ldIrNMJha1anGMDVxpA5cLCPnUYQ1clmHF1gw=": { "denomUnits": [ @@ -368,10 +346,35 @@ "svg": "https://raw.githubusercontent.com/prax-wallet/registry/main/images/test-usd.svg" } ] + }, + "xNdg/Pc2CvrtawUX41EBLTlgj83RTenRJaBFXxsSTwk=": { + "denomUnits": [ + { + "denom": "transfer/channel-4/uion" + }, + { + "denom": "transfer/channel-4/ion", + "exponent": 6 + } + ], + "base": "transfer/channel-4/uion", + "display": "transfer/channel-4/ion", + "name": "Ion", + "symbol": "ION", + "penumbraAssetId": { + "inner": "xNdg/Pc2CvrtawUX41EBLTlgj83RTenRJaBFXxsSTwk=" + }, + "images": [ + { + "png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/ion.png", + "svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/ion.svg" + } + ] } }, "stakingAssetId": "KeqcLzNx9qSH5+lcJHBB9KNW+YPrBk5dKzvPMiypahA=", "numeraires": [ - "reum7wQmk/owgvGMWMZn/6RFPV24zIKq3W6In/WwZgg=" + "reum7wQmk/owgvGMWMZn/6RFPV24zIKq3W6In/WwZgg=", + "CKBQapu+DkQpsKyTfKESLTV19/NPWR5sNZtvQsd3Hw8=" ] } \ No newline at end of file diff --git a/registry/penumbra-testnet-deimos-7.json b/registry/penumbra-testnet-deimos-7.json index a7db39f..86348ba 100644 --- a/registry/penumbra-testnet-deimos-7.json +++ b/registry/penumbra-testnet-deimos-7.json @@ -4,7 +4,8 @@ { "addressPrefix": "osmo", "chainId": "osmo-test-5", - "ibcChannel": "channel-4", + "channelId": "channel-4", + "counterpartyChannelId": "channel-7780", "displayName": "Osmosis", "images": [ { @@ -15,7 +16,8 @@ { "addressPrefix": "noble", "chainId": "grand-1", - "ibcChannel": "channel-3", + "channelId": "channel-3", + "counterpartyChannelId": "channel-164", "displayName": "Noble", "images": [ { diff --git a/tools/compiler/src/parser.rs b/tools/compiler/src/parser.rs index 713ee54..b27ba8e 100644 --- a/tools/compiler/src/parser.rs +++ b/tools/compiler/src/parser.rs @@ -35,7 +35,8 @@ pub struct Image { #[serde(rename_all = "camelCase")] pub struct IbcInput { pub chain_id: String, - pub ibc_channel: String, + pub channel_id: String, + pub counterparty_channel_id: String, pub address_prefix: String, pub cosmos_registry_dir: String, pub display_name: String, diff --git a/tools/compiler/src/processor.rs b/tools/compiler/src/processor.rs index 57e06cf..377b4ec 100644 --- a/tools/compiler/src/processor.rs +++ b/tools/compiler/src/processor.rs @@ -21,7 +21,8 @@ use crate::querier::query_github_assets; pub struct Chain { pub address_prefix: String, pub chain_id: String, - pub ibc_channel: String, + pub channel_id: String, + pub counterparty_channel_id: String, pub display_name: String, pub images: Vec, } @@ -31,7 +32,8 @@ impl From for Chain { Chain { address_prefix: config.address_prefix, chain_id: config.chain_id, - ibc_channel: config.ibc_channel, + channel_id: config.channel_id, + counterparty_channel_id: config.counterparty_channel_id, display_name: config.display_name, images: config.images, } @@ -83,7 +85,7 @@ pub fn transport_metadata_along_channel( tracing::debug!(?pb_metadata, "original"); let prefix_channel = |x: &mut String| { - *x = format!("transfer/{}/{}", ibc_data.ibc_channel, x); + *x = format!("transfer/{}/{}", ibc_data.channel_id, x); }; // Prefix the channel to the base denom. diff --git a/tools/compiler/tests/test_processor.rs b/tools/compiler/tests/test_processor.rs index ab31380..1375ec3 100644 --- a/tools/compiler/tests/test_processor.rs +++ b/tools/compiler/tests/test_processor.rs @@ -22,7 +22,8 @@ fn base64_id_extracts_correctly() { #[test] fn test_transport_metadata_along_channel() { let ibc_data = IbcInput { - ibc_channel: "channel-123".to_string(), + channel_id: "channel-123".to_string(), + counterparty_channel_id: "channel-456".to_string(), chain_id: "love-999".to_string(), address_prefix: "love".to_string(), cosmos_registry_dir: "love-124".to_string(),