In a Buidler/Hardhat test I have:
const { expect } = require("chai");
describe("SumOfTokens", function() {
it("Checks correct transfers", async function() {
const SumOfTokens = await ethers.getContractFactory("SumOfTokens");
const sumOfTokens = await SumOfTokens.deploy();
await sumOfTokens.deployed();
console.log(await sumOfTokens.newToken());
});
});
It prints some nonsense instead of the return value (that should be 1
) of the external non-view function newToken
.
How to obtain the return value of newToken
after its call?