Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
Prev Previous commit
Next Next commit
Add another describe block and add check to test
  • Loading branch information
eggplantzzz committed Feb 16, 2021
commit 3164ae4c52b7153341c936aa8d71b3638357eec8
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,29 @@ describe("api", () => {
assert.strictEqual(result, null);
});

it("logs a warning if the transaction hasn't been mined yet", async () => {
const [from] = await provider.send("eth_accounts");
describe("legacy instamine detection and warning", () => {
it("logs a warning if the transaction hasn't been mined yet", async () => {
const [from] = await provider.send("eth_accounts");

const hash = await provider.send("eth_sendTransaction", [
{
from,
to: from
}
]);
const hash = await provider.send("eth_sendTransaction", [
{
from,
to: from
}
]);

// do not wait for the tx to be mined which will create a warning
const result = await provider.send("eth_getTransactionReceipt", [
hash
]);

// do not wait for the tx to be mined which will create a warning
await provider.send("eth_getTransactionReceipt", [hash]);
assert(
logger.loggedStuff.includes(
"Ganache `eth_getTransactionReceipt` warning"
)
);
assert.strictEqual(result, null);
assert(
logger.loggedStuff.includes(
"Ganache `eth_getTransactionReceipt` warning"
)
);
});
});
});
});
Expand Down