Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils"

Index

Functions

Const assertEOSError

  • assertEOSError(operation: Promise<any>, eosErrorName: string, description: string): Promise<void>
  • Asserts EOS throws an error and validates the error output name matches the expected eosErrorName

    Parameters

    • operation: Promise<any>

      Operation promise

    • eosErrorName: string

      Expected EOS error name

    • description: string

      Output message description

    Returns Promise<void>

Const assertEOSErrorIncludesMessage

  • assertEOSErrorIncludesMessage(operation: Promise<any>, message: string, errorName?: undefined | string): Promise<void>
  • Asserts EOS throws an error and validates the error output name matches the expected 'eosio_assert_message_exception' and the error message includes description

    Parameters

    • operation: Promise<any>

      Operation promise

    • message: string

      Output message expected to be included

    • Optional errorName: undefined | string

    Returns Promise<void>

Const assertEOSException

  • assertEOSException(operation: Promise<any>): Promise<void>
  • Asserts operation throws an eosio_assert_message_exception error

    Parameters

    • operation: Promise<any>

      Operation promise

    Returns Promise<void>

Const assertExpectedEOSError

  • assertExpectedEOSError(operation: Promise<any>, eosErrorName: string, furtherErrorCheck?: undefined | ((err: any) => any)): Promise<boolean>
  • Asserts EOS throws an error and validates the error output name matches the expected eosErrorName Also asserts that other aspects of the error as checked through an optional passed in function.

    Parameters

    • operation: Promise<any>

      Operation promise

    • eosErrorName: string

      Expected EOS error name

    • Optional furtherErrorCheck: undefined | ((err: any) => any)

      function to run further assertions on a thrown error.

    Returns Promise<boolean>

    a Boolean of true if an error was thrown as is expected.

Const assertMissingAuthority

  • assertMissingAuthority(operation: Promise<any>): Promise<void>
  • Asserts operation is missing the required authority by throwing a missing_auth_exception error

    Parameters

    • operation: Promise<any>

      Operation promise

    Returns Promise<void>

Const assertRowCount

  • assertRowCount(getTableRowsResult: Promise<TableRowsResult<any>>, expectedRowCount: number): Promise<void>
  • Validates the number of rows returned is equal to the expected count

    Parameters

    • getTableRowsResult: Promise<TableRowsResult<any>>

      Get table rows result promise

    • expectedRowCount: number

      Expected number of table rows

    Returns Promise<void>

Const assertRowsContain

  • assertRowsContain<RowType>(getTableRowsResult: Promise<TableRowsResult<RowType>>, expected: RowType, strict?: boolean): Promise<void>
  • Compares table rows against expected rows irrespective of order

    Type parameters

    • RowType

    Parameters

    • getTableRowsResult: Promise<TableRowsResult<RowType>>

      Get table rows result promise

    • expected: RowType

      Expected table row query results

    • Default value strict: boolean = false

    Returns Promise<void>

Const assertRowsEqual

  • assertRowsEqual<RowType>(getTableRowsResult: Promise<TableRowsResult<RowType>>, expected: Array<RowType>, strict?: boolean): Promise<void>
  • Compares table rows against expected rows irrespective of order

    Type parameters

    • RowType

    Parameters

    • getTableRowsResult: Promise<TableRowsResult<RowType>>

      Get table rows result promise

    • expected: Array<RowType>

      Expected table row query results

    • Default value strict: boolean = false

      Strict comparison flag

    Returns Promise<void>

Const assertRowsEqualStrict

  • assertRowsEqualStrict<RowType>(getTableRowsResult: Promise<TableRowsResult<RowType>>, expected: Array<RowType>): Promise<void>
  • Performs a strict comparison of queried table rows against expected rows

    Type parameters

    • RowType

    Parameters

    • getTableRowsResult: Promise<TableRowsResult<RowType>>

      Get table rows result promise

    • expected: Array<RowType>

      Expected table row query results

    Returns Promise<void>

debugPromise

  • debugPromise<T>(promise: Promise<T>, successMessage: string, errorMessage?: undefined | string): Promise<T>
  • Type parameters

    • T

    Parameters

    • promise: Promise<T>
    • successMessage: string
    • Optional errorMessage: undefined | string

    Returns Promise<T>

Const nextBlock

  • nextBlock(): Promise<unknown>
  • Pauses the current process for the 500ms EOS block time

    Returns Promise<unknown>

Const sleep

  • sleep(delayInMs: number): Promise<unknown>
  • Pauses the current process for the specified duration

    Parameters

    • delayInMs: number

      Process sleep duration

    Returns Promise<unknown>

timer

  • timer(): { ms: any; seconds: any }
  • Simple timer

    Returns { ms: any; seconds: any }

    • ms:

      Milliseconds e.g. 2000ms etc.

    • seconds:

      s e.g 2s etc.

Const untilBlocknumber

  • untilBlocknumber(number: number): Promise<void>
  • Pauses the current process until the specified EOS block number occurs

    Parameters

    • number: number

      Process sleep duration

    Returns Promise<void>

Generated using TypeDoc