Skip to content

[A02-1] [MEDIUM] UnsupportedFlowInputs has no test coverage #310

@thedavidmeister

Description

@thedavidmeister

Gap

UnsupportedFlowInputs (declared at src/error/ErrFlow.sol:30) is reverted at src/concrete/Flow.sol:204 when the deployer reports any nonzero number of inputs in the IO byte string for a flow expression. No test asserts this revert path. Grep for UnsupportedFlowInputs in test/ returns zero matches.

Proposed test

Add to test/src/concrete/Flow.construction.t.sol:

import {UnsupportedFlowInputs} from "src/error/ErrFlow.sol";

/// Reverts with the `UnsupportedFlowInputs` selector when the deployer reports
/// any nonzero flow input count via the IO byte string.
function testFlowConstructionUnsupportedFlowInputs(
    address expression,
    bytes memory bytecode,
    uint256[] memory constants
) external {
    // IO layout: byte(0) = inputs, byte(1) = outputs. Set inputs=1 to trip the check.
    expressionDeployerDeployExpression2MockCall(expression, bytes(hex"01060001"));

    EvaluableConfigV3[] memory flowConfig = new EvaluableConfigV3[](1);
    flowConfig[0] = EvaluableConfigV3(DEPLOYER, bytecode, constants);

    vm.expectRevert(abi.encodeWithSelector(UnsupportedFlowInputs.selector));
    I_CLONE_FACTORY.clone(deployFlowImplementation(), abi.encode(flowConfig));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditAudit findingmediumSeverity: mediumpass2Audit Pass 2: Test Coverage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions