I have create a truffle project with this command:
truffle unbox react
Here is my smartcontract contracts/SimpleStorage.sol :
contract SimpleStorage {
enum MyEnum {
step1,
step2,
step3,
step4
}
MyEnum private var1 = MyEnum.step3;
function myfunction() external view returns (MyEnum) {
return var1;
}
}
Here is my test file: test/simplestorage.js
const SimpleStorage = artifacts.require("./SimpleStorage.sol");
contract("SimpleStorage", accounts => {
it("my test", async () => {
const simpleStorageInstance = await SimpleStorage.deployed();
const ret = await simpleStorageInstance.myfunction();
assert.equal(ret, 2);
});
});
My question is: Is there a way to access to Enum Structure in the test file. I would like to write something like that:
assert.equal(ret, MyEnum.step3);
Thanks