Skip to content

Commit

Permalink
fix simulate swap (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
haunv3 authored Mar 1, 2024
1 parent a570f5f commit 5cfe20d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/universal-swap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oraichain/oraidex-universal-swap",
"version": "1.0.55",
"version": "1.0.56",
"main": "build/index.js",
"files": [
"build/"
Expand Down
2 changes: 1 addition & 1 deletion packages/universal-swap/src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export const simulateSwap = async (query: {
offerAmount: finalAmount,
operations
});
return { amount: data.amount.substring(0, data.amount.length - 1) };
return data;
} catch (error) {
throw new Error(`Error when trying to simulate swap using router v2: ${JSON.stringify(error)}`);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/universal-swap/tests/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ describe("test universal swap handler functions", () => {

it.each<[CoinGeckoId, CoinGeckoId, string, string]>([
["oraichain-token", "oraichain-token", "1000000", "1000000"],
["tron", "airight", "1000000", "100000"]
["tron", "airight", "100000", "100000"]
])(
"test simulateSwap-given-fromid-%s-toid-%s-input-amount-%d-returns-%d",
async (fromCoingeckoId, toCoingeckoId, amount, expectedSimulateData) => {
Expand Down

0 comments on commit 5cfe20d

Please sign in to comment.