I am trying to test an enum value from a test. This is simplified version of the contract:
pragma solidity >=0.5.0 <0.7.0;
contract Foo {
enum State {
StateA,
StateB
}
State internal state;
function getState()
public view
returns (State)
{
return state;
}
}
Now running the test just like this:
contract("Foo", async accounts => {
it("requires a project to create", async () => {
let instance = await Foo.new()
console.log(await instance.getState())
})
})
I am getting output like this
BN { negative: 0, words: [ 1, <1 empty item> ], length: 1, red: null }
I've read that enums are still not supported from the ABI but shouldn't this then just return the index? What is BN
? negative
? red
?