Issue with Running Tests on Local Node
Greetings Zama team,
I’m currently facing an issue while running tests on my local node, which is set up using Docker as per the provided instructions. The node is running perfectly, and deploying contracts works as expected. However, I’m encountering an issue when running tests.
Here is the relevant test code:
describe("Unit Tests", function () {
// We define a fixture to reuse the same setup in every test.
async function deploymentFixture() {
const [deployer, tester] = await ethers.getSigners();
const instance = await createInstance();
const erc20Factory = await ethers.getContractFactory("StableCoinMain");
const erc20Contract = await erc20Factory.connect(deployer).deploy();
// Deploying and setting up the event contract
const eventFactory = await ethers.getContractFactory("EventMain");
const eventContract = await eventFactory
.connect(deployer)
.deploy(deployer.address, eventData.uri, eventData.details._name, [], [], [], [], []);
console.log("Event Contract Address is:", eventContract.address);
priceData.priceBase[1].currencyAddress = erc20Contract.address;
return { instance, erc20Contract, eventContract, deployer, tester }
}
it("Main - Owner Role Checker", async () => {
const { instance, erc20Contract, eventContract, deployer, tester } = await deploymentFixture();
// Owner setup tests
const OWNER_ROLE = await eventContract.OWNER_ROLE();
expect(await eventContract.hasRole(OWNER_ROLE, deployer.address)).to.equal(true);
});
});
When running this test, I encounter the following error:
Error: data out-of-bounds (length=0, offset=32, code=BUFFER_OVERRUN, version=abi/5.7.0)
Interestingly, these same test cases run perfectly on the Inco testnet. I am under the assumption that fhEVM 0.3.0 and Inco testnet fhEVM are the same.
Could you please assist in resolving this issue?
Thank you for your help!