From 43d72f311c65c6c87f5a2464c1010a1888c074b5 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Fri, 19 Jun 2020 14:00:05 +0200 Subject: [PATCH] Send sendUnsuccessful first to have enough time between submission and search --- .../sdk38/src/cosmosclient.searchtx.spec.ts | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/sdk38/src/cosmosclient.searchtx.spec.ts b/packages/sdk38/src/cosmosclient.searchtx.spec.ts index 39eb8a30..cc55d221 100644 --- a/packages/sdk38/src/cosmosclient.searchtx.spec.ts +++ b/packages/sdk38/src/cosmosclient.searchtx.spec.ts @@ -26,8 +26,8 @@ interface TestTxSend { } describe("CosmosClient.searchTx", () => { - let sendSuccessful: TestTxSend | undefined; let sendUnsuccessful: TestTxSend | undefined; + let sendSuccessful: TestTxSend | undefined; beforeAll(async () => { if (wasmdEnabled()) { @@ -36,24 +36,6 @@ describe("CosmosClient.searchTx", () => { pen.sign(signBytes), ); - { - const recipient = makeRandomAddress(); - const transferAmount: Coin = { - denom: "ucosm", - amount: "1234567", - }; - const result = await client.sendTokens(recipient, [transferAmount]); - await sleep(75); // wait until tx is indexed - const txDetails = await new RestClient(wasmd.endpoint).txById(result.transactionHash); - sendSuccessful = { - sender: faucet.address, - recipient: recipient, - hash: result.transactionHash, - height: Number.parseInt(txDetails.height, 10), - tx: txDetails.tx, - }; - } - { const memo = "Sending more than I can afford"; const recipient = makeRandomAddress(); @@ -107,6 +89,24 @@ describe("CosmosClient.searchTx", () => { }; } } + + { + const recipient = makeRandomAddress(); + const transferAmount: Coin = { + denom: "ucosm", + amount: "1234567", + }; + const result = await client.sendTokens(recipient, [transferAmount]); + await sleep(75); // wait until tx is indexed + const txDetails = await new RestClient(wasmd.endpoint).txById(result.transactionHash); + sendSuccessful = { + sender: faucet.address, + recipient: recipient, + hash: result.transactionHash, + height: Number.parseInt(txDetails.height, 10), + tx: txDetails.tx, + }; + } } });