A rule builder to allow defining rules that mock an Ethereum wallet balance.

Hierarchy

  • SingleValueRuleBuilder
    • BalanceRuleBuilder

Constructors

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

    Parameters

    • address: undefined | string
    • addRuleCallback: ((rule: RequestRuleData) => Promise<MockedEndpoint>)
        • (rule: RequestRuleData): Promise<MockedEndpoint>
        • Parameters

          • rule: RequestRuleData

          Returns Promise<MockedEndpoint>

    Returns BalanceRuleBuilder

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