A rule builder to allow defining rules that mock the current gas price.

Hierarchy

  • SingleValueRuleBuilder
    • GasPriceRuleBuilder

Constructors

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

    Parameters

    • addRuleCallback: ((rule: RequestRuleData) => Promise<MockedEndpoint>)
        • (rule: RequestRuleData): Promise<MockedEndpoint>
        • Parameters

          • rule: RequestRuleData

          Returns Promise<MockedEndpoint>

    Returns GasPriceRuleBuilder

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 once the rule is active.

    Returns Promise<MockedEndpoint>

  • Fail and return an error message.

    Parameters

    • message: string

    Returns Promise<MockedEndpoint>

  • Successfully return a given value.

    Parameters

    • value: number

    Returns Promise<MockedEndpoint>

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

    This method completes the rule definition, and returns a promise that resolves once the rule is active.

    Returns Promise<MockedEndpoint>

Generated using TypeDoc