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

imp(ibc-testkit): remove field access of MockContext #1043

Closed
rnbguy opened this issue Jan 18, 2024 · 0 comments · Fixed by #1046
Closed

imp(ibc-testkit): remove field access of MockContext #1043

rnbguy opened this issue Jan 18, 2024 · 0 comments · Fixed by #1046
Assignees
Labels
O: testing Objective: aims to improve testing coverage
Milestone

Comments

@rnbguy
Copy link
Collaborator

rnbguy commented Jan 18, 2024

Bug Summary

Some of the tests are written while accessing MockContext fields. Field access is discouraged over associated methods.

Details

The following should be refactored to use an associated method, e.g., MockContext::ibc_events(&self).

assert_eq!(ctx.events.len(), 2);
assert!(matches!(
ctx.events[0],
IbcEvent::Message(MessageEvent::Channel)
));
assert!(matches!(ctx.events[1], IbcEvent::TimeoutPacket(_)));

Version

till v0.49.1

@rnbguy rnbguy self-assigned this Jan 18, 2024
@rnbguy rnbguy changed the title refactor(ibc-testkit): remove field access of MockContext imp(ibc-testkit): remove field access of MockContext Jan 18, 2024
@github-project-automation github-project-automation bot moved this to 📥 To Do in ibc-rs Jan 19, 2024
@Farhad-Shabani Farhad-Shabani added this to the 0.50.0 milestone Jan 19, 2024
@Farhad-Shabani Farhad-Shabani added the O: testing Objective: aims to improve testing coverage label Jan 19, 2024
@rnbguy rnbguy moved this from 📥 To Do to ✅ Done in ibc-rs Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O: testing Objective: aims to improve testing coverage
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants