### Question:
SStoreOperation extends AbstractOperation { @Override public OperationResult execute(final MessageFrame frame, final EVM evm) { final UInt256 key = UInt256.fromBytes(frame.popStackItem()); final UInt256 value = UInt256.fromBytes(frame.popStackItem()); final MutableAccount account = frame.getWorldState().getAccount(frame.getRecipientAddress()).getMutable(); if (account == null) { return ILLEGAL_STATE_CHANGE; } final Address address = account.getAddress(); final boolean slotIsWarm = frame.warmUpStorage(address, key.toBytes()); final Gas cost = gasCalculator() .calculateStorageCost(account, key, value) .plus(slotIsWarm ? Gas.ZERO : gasCalculator().getColdSloadCost()); final Optional<Gas> optionalCost = Optional.of(cost); final Gas remainingGas = frame.getRemainingGas(); if (frame.isStatic()) { return new OperationResult( optionalCost, Optional.of(ExceptionalHaltReason.ILLEGAL_STATE_CHANGE)); } else if (remainingGas.compareTo(cost) < 0) { return new OperationResult(optionalCost, Optional.of(ExceptionalHaltReason.INSUFFICIENT_GAS)); } else if (remainingGas.compareTo(minumumGasRemaining) <= 0) { return new OperationResult( Optional.of(minumumGasRemaining), Optional.of(ExceptionalHaltReason.INSUFFICIENT_GAS)); } frame.incrementGasRefund(gasCalculator().calculateStorageRefundAmount(account, key, value)); account.setStorageValue(key, value); frame.storageWasUpdated(key, value.toBytes()); return new OperationResult(optionalCost, Optional.empty()); } SStoreOperation(final GasCalculator gasCalculator, final Gas minumumGasRemaining); Gas getMinumumGasRemaining(); @Override OperationResult execute(final MessageFrame frame, final EVM evm); static final Gas FRONTIER_MINIMUM; static final Gas EIP_1706_MINIMUM; }### Answer:
@Test public void storeOperation() { final SStoreOperation operation = new SStoreOperation(gasCalculator, minimumGasAvailable); final MessageFrame frame = createMessageFrame(Address.fromHexString("0x18675309"), initialGas, remainingGas); frame.pushStackItem(Bytes32.ZERO); frame.pushStackItem(Bytes32.fromHexString("0x01")); final OperationResult result = operation.execute(frame, null); assertThat(result.getHaltReason()).isEqualTo(expectedHalt); }