From d3f245300f2d42b83bc761c1e22950feeacd63db Mon Sep 17 00:00:00 2001 From: anilhelvaci Date: Sat, 5 Oct 2024 15:06:21 +0300 Subject: [PATCH] fix: improve type definitions and comment readability --- .../z:acceptance/test-lib/sync-tools.js | 19 +++++-------------- .../z:acceptance/test-lib/sync-tools.test.js | 4 ++-- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/a3p-integration/proposals/z:acceptance/test-lib/sync-tools.js b/a3p-integration/proposals/z:acceptance/test-lib/sync-tools.js index ad69b09741a6..bccc29a50cf6 100644 --- a/a3p-integration/proposals/z:acceptance/test-lib/sync-tools.js +++ b/a3p-integration/proposals/z:acceptance/test-lib/sync-tools.js @@ -85,9 +85,8 @@ const retryUntilCondition = async ( throw Error(`${message} condition failed after ${maxRetries} retries.`); }; -/** - * Making sure a core-eval resulted successfully deploying a contract - */ +///////////// Making sure a core-eval resulted successfully deploying a contract ///////////// + const makeGetInstances = follow => async () => { const instanceEntries = await follow( '-lF', @@ -122,12 +121,11 @@ export const waitUntilContractDeployed = ( getInstances, instanceObject => Object.keys(instanceObject).includes(contractName), errorMessage, - // @ts-ignore { maxRetries, retryIntervalMs, log, setTimeout }, ); }; -// Making sure an account is successfully funded with vbank assets like IST, BLD etc. +///////////// Making sure an account is successfully funded with vbank assets like IST, BLD etc. /////////////// const makeQueryCosmosBalance = queryCb => async dest => { const coins = await queryCb('bank', 'balances', dest); @@ -150,7 +148,6 @@ const checkCosmosBalance = (balances, threshold) => { * @param {{query: () => Promise, setTimeout: (object) => void}} ambientAuthority * @param {{denom: string, value: number}} threshold * @param {RetryOptions} options - * @returns */ export const waitUntilAccountFunded = ( destAcct, @@ -171,12 +168,11 @@ export const waitUntilAccountFunded = ( async () => queryCosmosBalance(destAcct), balances => checkCosmosBalance(balances, threshold), errorMessage, - // @ts-ignore { maxRetries, retryIntervalMs, log, setTimeout }, ); }; -// Making sure an offer is resulted +///////////// Making sure an offers get results ///////////// const makeQueryWallet = follow => async (/** @type {String} */ addr) => { const update = await follow('-lF', `:published.wallet.${addr}`); @@ -189,7 +185,6 @@ const makeQueryWallet = follow => async (/** @type {String} */ addr) => { * @param {object} offerStatus * @param {boolean} waitForPayouts * @param {string} offerId - * @returns */ const checkOfferState = (offerStatus, waitForPayouts, offerId) => { const { updated, status } = offerStatus; @@ -211,7 +206,6 @@ const checkOfferState = (offerStatus, waitForPayouts, offerId) => { * @param {boolean} waitForPayouts * @param {{follow: () => object, setTimeout: (object) => void}} ambientAuthority * @param {RetryOptions} options - * @returns */ export const waitUntilOfferResult = ( addr, @@ -233,12 +227,11 @@ export const waitUntilOfferResult = ( async () => queryWallet(addr), status => checkOfferState(status, waitForPayouts, offerId), errorMessage, - // @ts-ignore { maxRetries, retryIntervalMs, log, setTimeout }, ); }; -// Making sure a core-eval succesfully sent zoe invitations to committee members for governance +///////////// Making sure a core-eval successfully sent zoe invitations to committee members for governance ///////////// /** * @@ -259,7 +252,6 @@ const checkForInvitation = update => { * @param {string} addr * @param {{follow: () => object, setTimeout: (object) => void}} ambientAuthority * @param {RetryOptions} options - * @returns */ export const waitUntilInvitationReceived = ( addr, @@ -279,7 +271,6 @@ export const waitUntilInvitationReceived = ( async () => queryWallet(addr), checkForInvitation, errorMessage, - // @ts-ignore { maxRetries, retryIntervalMs, log, setTimeout }, ); }; diff --git a/a3p-integration/proposals/z:acceptance/test-lib/sync-tools.test.js b/a3p-integration/proposals/z:acceptance/test-lib/sync-tools.test.js index 3d12388b7388..d77ddf0b0cd0 100644 --- a/a3p-integration/proposals/z:acceptance/test-lib/sync-tools.test.js +++ b/a3p-integration/proposals/z:acceptance/test-lib/sync-tools.test.js @@ -261,7 +261,7 @@ test.serial('wait until offer result, do not wait for "payouts"', async t => { updated: 'offerStatus', }), 3000, - ); // First, offer is resulted + ); // Then offer got results await t.notThrowsAsync(waitP); }); @@ -298,7 +298,7 @@ test.serial('wait until offer result, wait for "payouts"', async t => { updated: 'offerStatus', }), 3000, - ); // Now, offer is resulted + ); // Now offer got results setTimeout( () => setValue({