You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Remix IDE with the Remix VM (Shanghai) environment.
In a Javascript unit test, I would like to send Ether from the main account to another account, but the sendTransaction() function times out.
Code Snippet
/* eslint-disable no-undef */
// Right click on the script name and hit "Run" to execute
const { expect } = require("chai");
const { ethers } = require("hardhat");
describe("Ether transaction", function() {
it("test transaction", async function() {
console.log(ethers.version);let [owner] = await ethers.getSigners();
let balance = (await owner.getBalance()).toBigInt();
console.log(`Current balance is: ${balance}`);let value = ethers.utils.parseEther("1.0");
expect(balance).to.be.at.least(value);let recipient = "<another address>";
console.log(`Sending some ETH to recipient ${recipient}`);
await owner.sendTransaction({
"to": recipient,
"value": value
});let newBalance = (await owner.getBalance()).toBigInt();
console.log(`New balance is: ${newBalance}`);
expect(newBalance - balance).to.be(value);
});
});
Contract ABI
No response
Errors
✘ test transaction (50738 ms)
Message: Timeout of 50000ms exceeded. For async tests and hooks, ensure "done()" is called;if returning a Promise, ensure it resolves.
Environment
Hardhat
Environment (Other)
Remix IDE
The text was updated successfully, but these errors were encountered:
How are you using Remix with ethers? Does it provide an EIP-1193 provider?
Have you tried ethers v6, which has much more flexibility for connecting to exotic environments?
Regardless, in v5 you can decrease the polling interval to increase the speed which the internals operated, scanning for new blocks, which on a test environment should occur quite quickly using provider.pollingInterval = 200 (which will poll every 200ms).
How are you using Remix with ethers? Does it provide an EIP-1193 provider?
I have written the script in tests/transaction.test.js and I am just running it. I don't know if it is an EIP-1193 provider.
Have you tried ethers v6, which has much more flexibility for connecting to exotic environments?
I don't know how to use another version. 5.7.1 is just the default version I get in Remix IDE. Sorry, I am quite new to Ethereum so I am a bit overwhelmed 😅
Regardless, in v5 you can decrease the polling interval to increase the speed which the internals operated, scanning for new blocks, which on a test environment should occur quite quickly using provider.pollingInterval = 200 (which will poll every 200ms).
I added the line owner.provider.pollingInterval = 200; after let [owner] = await ethers.getSigners(); but it did not help.
Ethers Version
5.7.1
Search Terms
transaction signer
Describe the Problem
I am using Remix IDE with the Remix VM (Shanghai) environment.
In a Javascript unit test, I would like to send Ether from the main account to another account, but the
sendTransaction()
function times out.Code Snippet
Contract ABI
No response
Errors
Environment
Hardhat
Environment (Other)
Remix IDE
The text was updated successfully, but these errors were encountered: