SOLUTION BELOW
How do I go about testing the following fallback function:
function () public payable {
revert();
}
being that the function does not have a function name, what do I need to do to test it? I tried using a function name that does not exist like this:
it("should not accept ETH deposits", async function() {
let xferAmt = web3.toWei(0.5, "ether");
await contract.dummyfunction({value: xferAmt}).should.be.rejectedWith(EVMThrow);
})
But truffle complains about the dummyfunction not being a function.
Thanks. A.
SOLUTION
function () public {}
test:
it("should not accept ETH deposits", async function() {
let xferAmt = 1;
await contract.sendTransaction({value: xferAmt}).should.be.rejectedWith(EVMThrow);
});
new BigNumber() not a number: [object Object]
which is odd. as there is a only a revert – adam Jun 15 '18 at 12:02