Skip to content

Commit

Permalink
fix: add nextState when go from orai to cosmos
Browse files Browse the repository at this point in the history
  • Loading branch information
perfogic committed May 15, 2024
1 parent 2266579 commit 3f85f0b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ export const handleStoreOnRecvPacketOraichain = async (
const existEvmPath = Object.values(EvmChainPrefix).find((prefix) =>
nextPacketData.nextDestinationDenom.includes(prefix)
);
nextState = existEvmPath ? "OraiBridgeState" : "";
nextState = existEvmPath ? "OraiBridgeState" : nextPacketData.nextReceiver == "" ? "" : "CosmosState";

const oraiBridgeData = await ctx.db.select(DatabaseEnum.OraiBridge, {
where: {
Expand Down Expand Up @@ -1125,7 +1125,7 @@ export const handleStoreOnTransferBackToRemoteChain = async (
const existEvmPath = Object.values(EvmChainPrefix).find((prefix) =>
nextPacketData.nextDestinationDenom.includes(prefix)
);
nextState = existEvmPath ? "OraiBridgeState" : "";
nextState = existEvmPath ? "OraiBridgeState" : nextPacketData.nextReceiver == "" ? "" : "OraichainState";

// we don't have previous packetSequence, so we save it as nextPacketSequence
let transferBackToRemoteChainData = {
Expand Down
8 changes: 4 additions & 4 deletions packages/ibc-routing/test/integration-batch-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ describe("test-batch-integration", () => {
height: 19508309,
prevState: "OraiBridgeState",
prevTxHash: "3E6E9DFCF7560FFD9EF0AE4D7AF5D5B0D617D85AA82242C693C7CDA80297DB30",
nextState: "",
nextState: "CosmosState",
packetSequence: 19401,
packetAck: "MQ==",
sender: "orai1rchnkdpsxzhquu63y6r4j4t57pnc9w8ehdhedx",
Expand Down Expand Up @@ -601,7 +601,7 @@ describe("test-batch-integration", () => {
height: 19508309,
prevState: "OraiBridgeState",
prevTxHash: "3E6E9DFCF7560FFD9EF0AE4D7AF5D5B0D617D85AA82242C693C7CDA80297DB30",
nextState: "",
nextState: "CosmosState",
packetSequence: 19402,
packetAck: "MQ==",
amount: "3000000000000000000",
Expand Down Expand Up @@ -2283,7 +2283,7 @@ describe.skip("test-batch-integration-timeout", () => {
height: 19508309,
prevState: "OraiBridgeState",
prevTxHash: "3E6E9DFCF7560FFD9EF0AE4D7AF5D5B0D617D85AA82242C693C7CDA80297DB30",
nextState: "",
nextState: "CosmosState",
packetSequence: 19401,
packetAck: "MQ==",
sender: "orai1rchnkdpsxzhquu63y6r4j4t57pnc9w8ehdhedx",
Expand Down Expand Up @@ -2313,7 +2313,7 @@ describe.skip("test-batch-integration-timeout", () => {
height: 19508309,
prevState: "OraiBridgeState",
prevTxHash: "3E6E9DFCF7560FFD9EF0AE4D7AF5D5B0D617D85AA82242C693C7CDA80297DB30",
nextState: "",
nextState: "CosmosState",
packetSequence: 19402,
packetAck: "MQ==",
amount: "3000000000000000000",
Expand Down
4 changes: 2 additions & 2 deletions packages/ibc-routing/test/integration-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ describe("test-integration", () => {
height: 17519455,
prevState: "OraiBridgeState",
prevTxHash: "7B1817348D6629758A56F2EDC45677F2E77A99850A60D363606E6ABC92A71428",
nextState: "",
nextState: "CosmosState",
packetSequence: 18434,
packetAck: "MQ==",
sender: "orai1ehmhqcn8erf3dgavrca69zgp4rtxj5kqgtcnyd",
Expand Down Expand Up @@ -1341,7 +1341,7 @@ describe.skip("test-integration time-out", () => {
height: 17519455,
prevState: "OraiBridgeState",
prevTxHash: "7B1817348D6629758A56F2EDC45677F2E77A99850A60D363606E6ABC92A71428",
nextState: "",
nextState: "CosmosState",
packetSequence: 18434,
packetAck: "MQ==",
sender: "orai1ehmhqcn8erf3dgavrca69zgp4rtxj5kqgtcnyd",
Expand Down

0 comments on commit 3f85f0b

Please sign in to comment.