Skip to content

Eth-Connector tests: improvements and minor refactoring.#108

Merged
sept-en merged 2 commits into
eth-connectorfrom
eth-connector-tests-improvements
May 28, 2021
Merged

Eth-Connector tests: improvements and minor refactoring.#108
sept-en merged 2 commits into
eth-connectorfrom
eth-connector-tests-improvements

Conversation

@sept-en
Copy link
Copy Markdown
Contributor

@sept-en sept-en commented May 28, 2021

  • Rename check_execution_status_failure() method to assert_execution_status_failure();

  • assert_execution_status_failure(): accept panic message as an arg.

  • Explicitly specify the panic message for each assert_execution_status_failure() if the promise didn't fail with the provided error message.

  • Usually the converted to string has either of the following two messages formats:

    1. "Action #0: Smart contract panicked: ERR_MSG [src/some_file.rs:LINE_NUMBER:COLUMN_NUMBER]";
    2. "right: 'MISMATCHED_DATA': ERR_MSG [src/some_file.rs:LINE_NUMBER:COLUMN_NUMBER]".

    So the ": ERR_MSG [" pattern should catch all invariants of error, even if one of the errors message is a subset of another one (e.g. ERR_MSG_FAILED is a subset of ERR_MSG_FAILED_FOO).

sept-en added 2 commits May 28, 2021 02:51
* Rename `check_execution_status_failure()` method to
  `assert_execution_status_failure()`;
* `assert_execution_status_failure()`: accept panic message as an arg.
* Explicitly specify the panic message for each
  `assert_execution_status_failure()` if the promise didn't fail with
  the provided error message.
* Usually the converted to string has either of following two messages formats:
  "Action #0: Smart contract panicked: ERR_MSG [src/some_file.rs:LINE_NUMBER:COLUMN_NUMBER]"
  "right: 'MISMATCHED_DATA': ERR_MSG [src/some_file.rs:LINE_NUMBER:COLUMN_NUMBER]"
  So the ": ERR_MSG [" pattern should catch all invariants of error,
  even if one of the errors message is a subset of another one
  (e.g. `ERR_MSG_FAILED` is a subset of `ERR_MSG_FAILED_FOO`).
@sept-en sept-en added the tests label May 28, 2021
@sept-en sept-en changed the base branch from master to eth-connector May 28, 2021 00:16
@sept-en sept-en merged commit ef24c7f into eth-connector May 28, 2021
@sept-en sept-en deleted the eth-connector-tests-improvements branch May 28, 2021 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants