Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

frame system: add event util functions for tests.#8734

Merged
4 commits merged into
paritytech:masterfrom
shaunxw:sw/event-tests-util
May 12, 2021
Merged

frame system: add event util functions for tests.#8734
4 commits merged into
paritytech:masterfrom
shaunxw:sw/event-tests-util

Conversation

@shaunxw
Copy link
Copy Markdown
Contributor

@shaunxw shaunxw commented May 5, 2021

Add two functions for frame system events assertion, to make it easier to check expected events in unit tests and benchmarking.

  • assert_has_event asserts the given event exists.
  • assert_last_event asserts the last event is equal to the given one.

@shaunxw shaunxw requested a review from kianenigma as a code owner May 5, 2021 08:54
Comment thread frame/balances/src/tests_reentrancy.rs Outdated
Comment thread frame/balances/src/tests_reentrancy.rs Outdated
Copy link
Copy Markdown
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much appreciated.

@kianenigma kianenigma added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit. and removed D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels May 6, 2021
@cla-bot-2021
Copy link
Copy Markdown

cla-bot-2021 Bot commented May 7, 2021

User @shaunxw, please sign the CLA here.

@gui1117
Copy link
Copy Markdown
Contributor

gui1117 commented May 12, 2021

bot merge

@ghost
Copy link
Copy Markdown

ghost commented May 12, 2021

Trying merge.

@ghost ghost merged commit 972e493 into paritytech:master May 12, 2021
@shaunxw shaunxw deleted the sw/event-tests-util branch May 12, 2021 20:37
@shawntabrizi
Copy link
Copy Markdown
Member

awesome, thanks :)

nazar-pc pushed a commit to autonomys/substrate that referenced this pull request Aug 8, 2021
* frame system: add event util functions for tests.

* URemove unused fn.

* Apply review suggestions.
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants