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): 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

    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 | function): 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 | function

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

Const nextBlock

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

    Returns Promise<Object>

Const sleep

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

    Parameters

    • delayInMs: number

      Process sleep duration

    Returns Promise<Object>

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