Skip to content

Commit

Permalink
fix: change rpc of injective for fixing error case start from inj
Browse files Browse the repository at this point in the history
  • Loading branch information
perfogic committed Jun 12, 2024
1 parent 3f37252 commit 2e435a3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
14 changes: 7 additions & 7 deletions packages/ibc-routing/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// dotenv.config();

// Test then use this
// export const config = {
// ORAIBRIDGE_RPC_URL: process.env.ORAIBRIDGE_RPC_URL ?? "https://bridge-v2.rpc.orai.io",
// ORAICHAIN_RPC_URL: process.env.ORAICHAIN_RPC_URL ?? "https://rpc.orai.io"
// };

export const config = {
ORAIBRIDGE_RPC_URL: "https://bridge-v2.rpc.orai.io",
ORAICHAIN_RPC_URL: "https://rpc.orai.io/"
ORAIBRIDGE_RPC_URL: process.env.ORAIBRIDGE_RPC_URL ?? "https://bridge-v2.rpc.orai.io",
ORAICHAIN_RPC_URL: process.env.ORAICHAIN_RPC_URL ?? "https://rpc.orai.io"
};

// export const config = {
// ORAIBRIDGE_RPC_URL: "https://bridge-v2.rpc.orai.io",
// ORAICHAIN_RPC_URL: "https://rpc.orai.io/"
// };
16 changes: 4 additions & 12 deletions packages/ibc-routing/src/managers/intepreter.manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,11 @@ class IntepreterManager {
public transitionInterpreters(type: string, payload: any): any {
this.mutex
.runExclusive(() => {
this.intepreters = [
...this.intepreters.filter((intepreter) => {
if (intepreter._inner.status === InterpreterStatus.Stopped) {
console.log("Remove one of intepreters");
return false;
}

intepreter._inner.send({ type, payload });
return true;
})
];

this.intepreters = [...this.intepreters.filter((item) => item._inner.status !== InterpreterStatus.Stopped)];
this.saveIntepreters();
this.intepreters.forEach((item) => {
item._inner.send({ type, payload });
});
})
.then(() => {
this.mutex.release();
Expand Down
12 changes: 10 additions & 2 deletions packages/ibc-routing/src/utils/events.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TxEvent } from "@cosmjs/tendermint-rpc";
import { Event } from "@cosmjs/tendermint-rpc/build/tendermint37";
import { chainInfos, EvmChainPrefix, Gravity__factory } from "@oraichain/oraidex-common";
import { ChainIdEnum, chainInfos, EvmChainPrefix, Gravity__factory } from "@oraichain/oraidex-common";
import axios from "axios";
import { ethers } from "ethers";
import { EvmRpcs, GravityAddress } from "../constants";
Expand Down Expand Up @@ -71,15 +71,23 @@ export const getSendToCosmosEvent = async (txHash: string, evmChainPrefix: EvmCh
};

export const getCosmosTxEvent = async (txHash: any, chainId: string): Promise<TxEvent> => {
console.log(txHash, chainId);
let chainMetadata = chainInfos.find((item) => item.chainId === chainId);

if (chainId === "cosmoshub-4") {
if (chainId === ChainIdEnum.CosmosHub) {
chainMetadata = {
...chainMetadata,
rpc: "https://rpc-cosmoshub.keplr.app"
};
}

if (chainId === "injective-1") {
chainMetadata = {
...chainMetadata,
rpc: "https://sentry.tm.injective.network"
};
}

if (!chainMetadata) {
throw new Error("chain id does not exist!");
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ibc-routing/test/search-tx.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("Testing searchTx using rpc", () => {
const queryTags: QueryTag[] = [
{
key: `recv_packet.packet_sequence`,
value: `${"18501"}`
value: `${"19320"}`
},
{
key: `recv_packet.packet_src_channel`,
Expand Down

0 comments on commit 2e435a3

Please sign in to comment.