Skip to content

Commit

Permalink
fix ibc-routing receiver when go from src to EVM
Browse files Browse the repository at this point in the history
  • Loading branch information
perfogic committed May 21, 2024
1 parent 20e5f22 commit 3f37252
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 31 deletions.
1 change: 1 addition & 0 deletions packages/ibc-routing/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// import dotenv from "dotenv";
// 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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ export const handleOnRecvPacketOnOraiBridge = async (ctx: ContextIntepreter, eve
amount: packetData.amount,
denom: packetData.denom,
memo: packetData.memo,
receiver: packetData.receiver,
receiver: packetData.memo.split(evmChainPrefix)[1],
sender: packetData.sender,
srcPort,
srcChannel,
Expand Down
2 changes: 1 addition & 1 deletion packages/ibc-routing/test/data/backup.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions packages/ibc-routing/test/integration-batch-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ describe("test-batch-integration", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/eth-mainnet0xdAC17F958D2ee523a2206206994597C13D831ec7",
memo: "eth-mainnet0xb1ADE84566dB117B4B241fC446ceb1c46616e172",
receiver: "oraib1rchnkdpsxzhquu63y6r4j4t57pnc9w8eqvn4u9",
receiver: "0xb1ADE84566dB117B4B241fC446ceb1c46616e172",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -1018,7 +1018,7 @@ describe("test-batch-integration", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/eth-mainnet0xdAC17F958D2ee523a2206206994597C13D831ec7",
memo: "eth-mainnet0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -1337,7 +1337,7 @@ describe("test-batch-integration", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -1369,7 +1369,7 @@ describe("test-batch-integration", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0xb1ADE84566dB117B4B241fC446ceb1c46616e172",
receiver: "oraib1rchnkdpsxzhquu63y6r4j4t57pnc9w8eqvn4u9",
receiver: "0xb1ADE84566dB117B4B241fC446ceb1c46616e172",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -1606,7 +1606,7 @@ describe("test-batch-integration", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0x8163B6142d701E671a7c39aD9C14eB2c0A51aa00",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x8163B6142d701E671a7c39aD9C14eB2c0A51aa00",
sender: "orai1zzdhs7cmfxrpx9mgxysncvpzn3h6tagy39cx0lq6ykz8s29007wq8sxd0t",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -1638,7 +1638,7 @@ describe("test-batch-integration", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0x8163B6142d701E671a7c39aD9C14eB2c0A51aa00",
receiver: "oraib1hvr9d72r5um9lvt0rpkd4r75vrsqtw6ytnnvpf",
receiver: "0x8163B6142d701E671a7c39aD9C14eB2c0A51aa00",
sender: "orai1zzdhs7cmfxrpx9mgxysncvpzn3h6tagy39cx0lq6ykz8s29007wq8sxd0t",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -1712,7 +1712,7 @@ describe("test-batch-integration", () => {
});
});

describe.skip("test-batch-integration-timeout", () => {
describe("test-batch-integration-timeout", () => {
let duckDb: DuckDbNode;
let evmHandler: EvmEventHandler;
let oraibridgeHandler: OraiBridgeHandler;
Expand Down Expand Up @@ -2035,7 +2035,7 @@ describe.skip("test-batch-integration-timeout", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0x8163B6142d701E671a7c39aD9C14eB2c0A51aa00",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x8163B6142d701E671a7c39aD9C14eB2c0A51aa00",
sender: "orai1zzdhs7cmfxrpx9mgxysncvpzn3h6tagy39cx0lq6ykz8s29007wq8sxd0t",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -2067,7 +2067,7 @@ describe.skip("test-batch-integration-timeout", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0x8163B6142d701E671a7c39aD9C14eB2c0A51aa00",
receiver: "oraib1hvr9d72r5um9lvt0rpkd4r75vrsqtw6ytnnvpf",
receiver: "0x8163B6142d701E671a7c39aD9C14eB2c0A51aa00",
sender: "orai1zzdhs7cmfxrpx9mgxysncvpzn3h6tagy39cx0lq6ykz8s29007wq8sxd0t",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -2549,7 +2549,7 @@ describe.skip("test-batch-integration-timeout", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -2581,7 +2581,7 @@ describe.skip("test-batch-integration-timeout", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0xb1ADE84566dB117B4B241fC446ceb1c46616e172",
receiver: "oraib1rchnkdpsxzhquu63y6r4j4t57pnc9w8eqvn4u9",
receiver: "0xb1ADE84566dB117B4B241fC446ceb1c46616e172",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -2869,7 +2869,7 @@ describe.skip("test-batch-integration-timeout", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/eth-mainnet0xdAC17F958D2ee523a2206206994597C13D831ec7",
memo: "eth-mainnet0xb1ADE84566dB117B4B241fC446ceb1c46616e172",
receiver: "oraib1rchnkdpsxzhquu63y6r4j4t57pnc9w8eqvn4u9",
receiver: "0xb1ADE84566dB117B4B241fC446ceb1c46616e172",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -2901,7 +2901,7 @@ describe.skip("test-batch-integration-timeout", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/eth-mainnet0xdAC17F958D2ee523a2206206994597C13D831ec7",
memo: "eth-mainnet0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down
14 changes: 7 additions & 7 deletions packages/ibc-routing/test/integration-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ describe("test-integration", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/eth-mainnet0xdAC17F958D2ee523a2206206994597C13D831ec7",
memo: "eth-mainnet0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -789,7 +789,7 @@ describe("test-integration", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -936,7 +936,7 @@ describe("test-integration", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai1ehmhqcn8erf3dgavrca69zgp4rtxj5kqgtcnyd",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -978,7 +978,7 @@ describe("test-integration", () => {
});
});

describe.skip("test-integration time-out", () => {
describe("test-integration time-out", () => {
let duckDb: DuckDbNode;
let evmHandler: EvmEventHandler;
let oraibridgeHandler: OraiBridgeHandler;
Expand Down Expand Up @@ -1111,7 +1111,7 @@ describe.skip("test-integration time-out", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/eth-mainnet0xdAC17F958D2ee523a2206206994597C13D831ec7",
memo: "eth-mainnet0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -1478,7 +1478,7 @@ describe.skip("test-integration time-out", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -1578,7 +1578,7 @@ describe.skip("test-integration time-out", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai1ehmhqcn8erf3dgavrca69zgp4rtxj5kqgtcnyd",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down
14 changes: 7 additions & 7 deletions packages/ibc-routing/test/intepreters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe("test recover case", () => {
});

const [owner] = getSigners(1);
xit("[ORAICHAIN->EVM] try to test recover state of one intepreter after server down", async () => {
it("[ORAICHAIN->EVM] try to test recover state of one intepreter after server down", async () => {
const oraiBridgeEvent = new OraiBridgeEvent(oraibridgeHandler, "localhost:26657");
oraiBridgeEvent.connectCosmosSocket([autoForwardTag, requestBatchTag, batchSendToEthClaimTag]);
const oraiEvent = new OraichainEvent(oraichainHandler, "localhost:26657");
Expand Down Expand Up @@ -143,7 +143,7 @@ describe("test recover case", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai1ehmhqcn8erf3dgavrca69zgp4rtxj5kqgtcnyd",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -184,7 +184,7 @@ describe("test recover case", () => {
expect(intepreterCount.status).eql(InterpreterStatus.Stopped);
}).timeout(30000);

xit("[EVM->EVM] try to test recover state of one intepreter after server down", async () => {
it("[EVM->EVM] try to test recover state of one intepreter after server down", async () => {
const ethEvent = new EthEvent(evmHandler);
const gravity = ethEvent.listenToEthEvent(
owner.provider,
Expand Down Expand Up @@ -320,7 +320,7 @@ describe("test recover case", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/eth-mainnet0xdAC17F958D2ee523a2206206994597C13D831ec7",
memo: "eth-mainnet0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -506,7 +506,7 @@ describe("test recover case", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/eth-mainnet0xdAC17F958D2ee523a2206206994597C13D831ec7",
memo: "eth-mainnet0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -589,7 +589,7 @@ describe("test recover case", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai1ehmhqcn8erf3dgavrca69zgp4rtxj5kqgtcnyd",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down Expand Up @@ -706,7 +706,7 @@ describe("test recover case", () => {
denom:
"wasm.orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm/channel-29/oraib0x55d398326f99059fF775485246999027B3197955",
memo: "oraib0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
receiver: "oraib1ehmhqcn8erf3dgavrca69zgp4rtxj5kql2ul4w",
receiver: "0x0deB52499C2e9F3921c631cb6Ad3522C576d5484",
sender: "orai195269awwnt5m6c843q6w7hp8rt0k7syfu9de4h0wz384slshuzps8y7ccm",
srcPort: "transfer",
srcChannel: "channel-1",
Expand Down
4 changes: 2 additions & 2 deletions packages/ibc-routing/test/search-tx.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { StargateClient } from "@cosmjs/stargate";
import { QueryTag } from "@cosmjs/tendermint-rpc/build/tendermint37";
import { buildQuery } from "@cosmjs/tendermint-rpc/build/tendermint37/requests";

describe.skip("Testing searchTx using rpc", () => {
describe("Testing searchTx using rpc", () => {
it("Try testing stargate-client query", async () => {
const queryTags: QueryTag[] = [
{
Expand All @@ -21,7 +21,7 @@ describe.skip("Testing searchTx using rpc", () => {
const query = buildQuery({
tags: queryTags
});
const stargateClient = await StargateClient.connect("https://rpc.orai.io");
const stargateClient = await StargateClient.connect("http://3.14.142.99:26657");
const txs = await stargateClient.searchTx(query);

console.log(txs);
Expand Down

0 comments on commit 3f37252

Please sign in to comment.