Skip to content

Commit

Permalink
fix tsc, linter & prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
goncer committed Oct 31, 2023
1 parent 60de12f commit 3f165c6
Show file tree
Hide file tree
Showing 8 changed files with 20,137 additions and 14,934 deletions.
7 changes: 4 additions & 3 deletions test/parallel/feeLock.API.unlocking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,21 @@ test.only("gasless- GIVEN some locked tokens and no more free MGX WHEN another t
saleAssetValue,
);
expect(isFree).toBeFalsy();
await testUser1.sellAssets(firstCurrency, secondCurrency, saleAssetValue);
await testUsers[0].sellAssets(firstCurrency, secondCurrency, saleAssetValue);
await expect(
sellAsset(
testUsers[0].keyRingPair,
firstCurrency,
secondCurrency,
saleAssetValue,
new BN(0),
).catch((reason) => {
)
.catch((reason) => {
throw new Error(reason.data);
})
.then(() => {
throw new Error("This should have failed!");
})
}),
).rejects.toThrow(feeLockErrors.FeeLockingFail);
await waitNewBlock();
});
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/xyk-pallet.MPL.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("MPL: Delegator", () => {
keyring = new Keyring({ type: "sr25519" });
const node = new Node(
getEnvironmentRequiredVars().chainUri,
await setupApi()
await setupApi(),
);
await node.connect();
// setup users
Expand Down Expand Up @@ -119,7 +119,7 @@ describe("MPL: Collators", () => {
keyring = new Keyring({ type: "sr25519" });
const node = new Node(
getEnvironmentRequiredVars().chainUri,
await setupApi()
await setupApi(),
);
await node.connect();
const api = await getApi();
Expand Down Expand Up @@ -215,7 +215,7 @@ describe("MPL: Collators - Activated liq", () => {
keyring = new Keyring({ type: "sr25519" });
const node = new Node(
getEnvironmentRequiredVars().chainUri,
await setupApi()
await setupApi(),
);
await node.connect();
const api = await getApi();
Expand Down
2 changes: 1 addition & 1 deletion test/sequential/xyk-SDK.nonce.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ beforeAll(async () => {
testUser = new User(keyring);
const node = new Node(
getEnvironmentRequiredVars().chainUri,
await setupApi()
await setupApi(),
);
await node.connect();
sudo = new SudoUser(keyring, node);
Expand Down
4 changes: 3 additions & 1 deletion utils/Framework/Node/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export class Node {
}

async connect(): Promise<void> {
if (!this.api) this.api = await initApi(this.wsPath);
if (!this.api) {
this.api = await initApi(this.wsPath);
}
}

async subscribeToHead(): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion utils/chopsticksHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function replaceByStateCall(
method: string,
params: RPCParam[],
module = "xyk",
returnType = "XYKRpcResult"
returnType = "XYKRpcResult",
) {
const api = await getApi();
let encodedStr = "0x";
Expand Down
2 changes: 1 addition & 1 deletion utils/eventListeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const waitNewBlock = () => {
unsubscribe();
resolve(true);
}
}
},
);
});
};
Expand Down
16 changes: 6 additions & 10 deletions utils/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,11 @@ export async function calculate_sell_price_rpc(
return new BN(result.price);
} else {
const mangata = await getMangataInstance();
const result = await mangata.rpc.calculateSellPrice({
return await mangata.rpc.calculateSellPrice({
amount: sell_amount,
inputReserve: input_reserve,
outputReserve: output_reserve,
});
return result;
}
}

Expand All @@ -207,12 +206,11 @@ export async function calculate_buy_price_rpc(
return new BN(result.price);
} else {
const mangata = await getMangataInstance();
const result = await mangata.rpc.calculateBuyPrice({
return await mangata.rpc.calculateBuyPrice({
inputReserve: inputReserve,
outputReserve: outputReserve,
amount: buyAmount,
});
return result;
}
}

Expand All @@ -231,12 +229,11 @@ export async function calculate_buy_price_id_rpc(
return new BN(result.price);
} else {
const mangata = await getMangataInstance();
const result = await mangata.rpc.calculateBuyPriceId(
return await mangata.rpc.calculateBuyPriceId(
soldTokenId.toString(),
boughtTokenId.toString(),
buyAmount
buyAmount,
);
return result;
}
}

Expand All @@ -255,12 +252,11 @@ export async function calculate_sell_price_id_rpc(
return new BN(result.price);
} else {
const mangata = await getMangataInstance();
const result = await mangata.rpc.calculateSellPriceId(
return await mangata.rpc.calculateSellPriceId(
soldTokenId.toString(),
boughtTokenId.toString(),
sellAmount
sellAmount,
);
return result;
}
}

Expand Down
Loading

0 comments on commit 3f165c6

Please sign in to comment.