Skip to content

Commit

Permalink
chore: version 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
afsardo committed Dec 8, 2023
1 parent f6618df commit 57648dd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
9 changes: 3 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "math"
version = "1.0.0"
version = "1.0.1"
edition = "2021"
description = "A collection of math functions extractde from Astroport smart contracts to be used with WASM in TypeScript/NodeJS."
keywords = [
Expand Down
15 changes: 8 additions & 7 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,23 +402,21 @@ async function concentrated_swap_test(client: CosmWasmClient) {
const future_amp = pool_config.pool_state.future.amp;
const future_gamma = pool_config.pool_state.future.gamma;

let ask_ind = 0;
let offer_amount: BigNumber | null = null;
let simulation: SwapResult | null = null;
let pcl_result: SwapResult | null = null;
try {
for (let i = 3; i < 6; i++) {
for (let j = 0; j < 2; j++) {
ask_ind = j;
offer_amount = BigNumber(asset_amounts[1 - ask_ind])
let ask_ind = j;
let offer_amount = BigNumber(asset_amounts[ask_ind])
.dividedBy(i)
.decimalPlaces(0);

simulation = await client.queryContractSmart(PCL_POOL, {
simulation: {
offer_asset: {
amount: offer_amount,
info: pool_info.assets[1 - ask_ind].info,
info: pool_info.assets[ask_ind].info,
},
},
});
Expand All @@ -427,7 +425,7 @@ async function concentrated_swap_test(client: CosmWasmClient) {
concentrated_swap(
offer_amount.toString(),
"6", // offer_asset_prec,
String(ask_ind),
String(1 - ask_ind),
"6", // ask_asset_prec,
JSON.stringify(asset_amounts),
PCL_FEE,
Expand All @@ -445,6 +443,7 @@ async function concentrated_swap_test(client: CosmWasmClient) {
future_gamma
)
);

assert(
pcl_result.return_amount === simulation.return_amount &&
pcl_result.spread_amount === simulation.spread_amount &&
Expand Down Expand Up @@ -509,7 +508,9 @@ async function concentrated_withdraw_test(client: CosmWasmClient) {
}

(async function () {
const client = await CosmWasmClient.connect("https://pisco-rpc.terra.dev/");
const client = await CosmWasmClient.connect(
"https://terra-testnet-rpc.polkachu.com/"
);

const xyk_swap_test_result = await xyk_swap_test(client);
const xyk_provide_test_result = await xyk_provide_test();
Expand Down
2 changes: 1 addition & 1 deletion test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 57648dd

Please sign in to comment.