Hierarchy

  • ContractRuleBuilder
    • CallRuleBuilder

Constructors

  • This builder should not be constructed directly. Call mockNode.forCall() instead.

    Parameters

    • targetAddress: undefined | `0x${string}`
    • addRuleCallback: ((rule: RequestRuleData) => Promise<MockedEndpoint>)
        • (rule: RequestRuleData): Promise<MockedEndpoint>
        • Parameters

          • rule: RequestRuleData

          Returns Promise<MockedEndpoint>

    Returns CallRuleBuilder

Methods

  • Close the connection immediately after receiving the matching request, without sending any response.

    This method completes the rule definition, and returns a promise that resolves to a MockedContract once the rule is active. The MockedContract can be used later to query the seen requests that this rule has matched.

    Returns Promise<MockedContract>

  • Return one or more values from the contract call. You must provide both a types and a values array, unless you've already called forFunction() and provided a function signature there that includes return types.

    This method completes the rule definition, and returns a promise that resolves to a MockedContract once the rule is active. The MockedContract can be used later to query the seen requests that this rule has matched.

    Parameters

    • outputType: string
    • value: unknown

    Returns Promise<MockedContract>

  • Parameters

    • values: unknown[]

    Returns Promise<MockedContract>

  • Parameters

    • value: unknown

    Returns Promise<MockedContract>

  • Parameters

    • outputTypes: string[]
    • values: unknown[]

    Returns Promise<MockedContract>

  • Return an error, rejecting the contract call with the provided error message.

    This method completes the rule definition, and returns a promise that resolves to a MockedContract once the rule is active. The MockedContract can be used later to query the seen requests that this rule has matched.

    Parameters

    • errorMessage: string

    Returns Promise<MockedContract>

  • Timeout, accepting the request but never returning a response.

    This method completes the rule definition, and returns a promise that resolves to a MockedContract once the rule is active. The MockedContract can be used later to query the seen requests that this rule has matched.

    Returns Promise<MockedContract>

  • Only match requests that send certain parameters. You must provide both a types and a parameters array, unless you've already called forFunction() and provided the function signature there.

    Parameters

    • params: unknown[]

    Returns CallRuleBuilder

  • Parameters

    • types: string[]
    • params: unknown[]

    Returns CallRuleBuilder

Generated using TypeDoc