Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
May 28, 2021

Conversation

sept-en
Copy link
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).

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

None yet

2 participants