Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Add event checks to tests #7

Closed
ansermino opened this issue Mar 20, 2020 · 0 comments · Fixed by #18
Closed

Add event checks to tests #7

ansermino opened this issue Mar 20, 2020 · 0 comments · Fixed by #18
Assignees

Comments

@ansermino
Copy link
Member

ansermino commented Mar 20, 2020

Presently there is no event checks in the tests. These should be added.

Some useful code here: https://github.com/centrifuge/substrate-pallet-multi-account/blob/3a40d9a1107816ee28989bf4bbbe3f0ab6a1822d/src/lib.rs#L833-L842

The issue I was facing was when multiple events fire in a single call, only the last is returned by expect_event. We should extend the functionality to support n most recent events.

Events can be collected like this:

let events: Vec<Event> = system::Module::<Test>::events().iter().map(|e| e.event.clone()).collect();
@ansermino ansermino mentioned this issue Mar 20, 2020
13 tasks
@Polycarpik Polycarpik assigned Polycarpik and ansermino and unassigned Polycarpik Mar 23, 2020
@Polycarpik Polycarpik added this to the Centrifuge Deadline milestone Mar 23, 2020
ansermino added a commit that referenced this issue Mar 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants