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

adding channels for osmosis, fixing bug in name comparison #201

Merged
merged 1 commit into from
Jan 9, 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
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