Send sendUnsuccessful first

to have enough time between submission and search
This commit is contained in:
Simon Warta 2020-06-19 14:00:05 +02:00
parent ffecf9adff
commit 43d72f311c

View File

@ -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,
};
}
}
});