Skip to content

Commit

Permalink
adding channels for osmosis, fixing bug in name comparison (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnjamin authored Jan 9, 2024
1 parent 9506279 commit ce2596b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion platforms/cosmwasm/protocols/ibc/src/ibc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ export class CosmwasmIbcBridge<N extends Network, C extends CosmwasmChains>

// Fetches the local channel for the given chain
async fetchTransferChannel(chain: CosmwasmChains): Promise<string> {
if (this.chain !== Gateway.name)
if (this.chain !== Gateway.chain)
throw new Error("Cannot query the transfer channels from a non-gateway chain");

const { channel } = await this.rpc.queryContractSmart(this.gatewayAddress, {
Expand Down
8 changes: 7 additions & 1 deletion platforms/cosmwasm/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,13 @@ export type IbcChannels = Partial<Record<CosmwasmChains, string>>;

// For each chain, add the channel id for each other chain
const gatewayConnections = [
["Mainnet", [["Wormchain", { Cosmoshub: "channel-5", Osmosis: "channel-4" }]]],
[
"Mainnet",
[
["Wormchain", { Cosmoshub: "channel-5", Osmosis: "channel-3" }],
["Osmosis", { Wormchain: "channel-6" }],
],
],
[
"Testnet",
[
Expand Down
2 changes: 1 addition & 1 deletion platforms/cosmwasm/src/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class Gateway<N extends Network> extends ChainContext<
): string {
const channels = CosmwasmPlatform.getIbcChannels(network, chain);
if (!channels) throw new Error("No channels configured for chain " + chain);
if (!(Gateway.name in channels)) throw new Error("No channel configured for chain " + chain);
if (!(Gateway.chain in channels)) throw new Error("No channel configured for chain " + chain);
return channels[Gateway.chain]!;
}

Expand Down

0 comments on commit ce2596b

Please sign in to comment.