Class NameResolveRuleBuilder

A builder to allow defining rules that will mock IPNS name resolution requests.

Hierarchy

  • NameResolveRuleBuilder

Constructors

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

    Parameters

    • name: undefined | string
    • addRuleCallback: ((data: RequestRuleData) => Promise<void>)
        • (data: RequestRuleData): Promise<void>
        • Parameters

          • data: RequestRuleData

          Returns Promise<void>

    Returns NameResolveRuleBuilder

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<void>

  • Return a failing name resolution result, rejecting the request as if the name was not found.

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

    Returns Promise<void>

  • Return a successful name resolution result, resolving to the given IPFS path.

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

    Parameters

    • path: string

    Returns Promise<void>

  • 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<void>

Generated using TypeDoc