Class NamePublishRuleBuilder

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

Hierarchy

  • NamePublishRuleBuilder

Constructors

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

    Parameters

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

          • data: RequestRuleData

          Returns Promise<void>

    Returns NamePublishRuleBuilder

Methods

  • Return a successful result, as if the IPNS name was published, returning a default mock IPNS result.

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

    Returns Promise<void>

  • Return a successful result, as if the IPNS name was published, returning a given IPNS name.

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

    Parameters

    • name: string

    Returns Promise<void>

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

  • 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