@@ -4,9 +4,7 @@ import {Test} from "forge-std/Test.sol";
44import {RISCV} from "src/RISCV.sol " ;
55import {PreimageOracle} from "@optimism/src/cannon/PreimageOracle.sol " ;
66import {CommonTest} from "./CommonTest.sol " ;
7- // FIXME: somehow this import gives a multiple declaration error
8- // This import is for the VMStatus
9- // import "@optimism/src/libraries/DisputeTypes.sol";
7+ import "@optimism/src/libraries/DisputeTypes.sol " ;
108
119contract RISCV_Test is CommonTest {
1210 /// @notice Stores the VM state.
@@ -2385,22 +2383,21 @@ contract RISCV_Test is CommonTest {
23852383 /// 1. Exited with success (Invalid)
23862384 /// 2. Exited with failure (Panic)
23872385 /// 3. Unfinished
2388- // TODO: import DisputeTypes.sol. For some reason, import is not working
2389- function vmStatus (State memory state ) internal pure returns (uint8 out_ ) {
2386+ function vmStatus (State memory state ) internal pure returns (VMStatus out_ ) {
23902387 if (! state.exited) {
2391- return 3 ; // VMStatuses.UNFINISHED
2388+ return VMStatuses.UNFINISHED;
23922389 } else if (state.exitCode == 0 ) {
2393- return 0 ; // VMStatuses.VALID
2390+ return VMStatuses.VALID;
23942391 } else if (state.exitCode == 1 ) {
2395- return 1 ; // VMStatuses.INVALID
2392+ return VMStatuses.INVALID;
23962393 } else {
2397- return 2 ; // VMStatuses.PANIC
2394+ return VMStatuses.PANIC;
23982395 }
23992396 }
24002397
24012398 function outputState (State memory state ) internal pure returns (bytes32 out_ ) {
24022399 bytes memory enc = encodeState (state);
2403- uint8 status = vmStatus (state);
2400+ VMStatus status = vmStatus (state);
24042401 assembly {
24052402 out_ := keccak256 (add (enc, 0x20 ), 362 )
24062403 out_ := or (and (not (shl (248 , 0xFF )), out_), shl (248 , status))
0 commit comments