-
Notifications
You must be signed in to change notification settings - Fork 1
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
#27 make TxMessage data members public #28
#27 make TxMessage data members public #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's worth giving up OOP or stability and security principles just because of tests.
What about just adding getter methods, which return immutable borrows?
This would also have the advantage that these methods may also be helpful outside of tests.
Yes probably a better idea, so as an example to get the buff member we could implement a fn like this: pub fn get_payload(&self) -> &Bytes {
&self.buff
} |
@@ -111,3 +111,15 @@ fn test_payload_greater_than_generic_type_args() { | |||
assert_eq!(message_2_0.unwrap_err(), MessageError::InvalidLength(5)); | |||
assert_eq!(message_fd.unwrap_err(), MessageError::InvalidLength(23)); | |||
} | |||
|
|||
#[test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even with unit test, nice :) 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
see #27