there.
I'm coding kill function below:
function kill() public onlyOwner returns (bool) {
selfdestruct(msg.sender);
return true;
}
and my unit test code:
function testOwnerCanKillContract() public {
XToken xtn = XToken(DeployedAddresses.XToken());
bool isKilled = nmt.kill();
Assert.equal(isKilled, true, "Owner should have to kill contract with selfdestruct.");
}
However, test fails with revert error after $ truffle test:
Error: Returned error: VM Exception while processing transaction: revert
So does anyone know how to resolve this problem, or any idea?
and also, my enviromnent is here: Truffle v5.0.5 (core: 5.0.5) Solidity v0.5.0 (solc-js) Node v10.9.0
Thanks in advance!