-
Notifications
You must be signed in to change notification settings - Fork 167
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
Add unit test for saving wallet with pending blobs #2679
Add unit test for saving wallet with pending blobs #2679
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @andresilva91 and the rest of your teammates on Graphite |
6851b18
to
626545a
Compare
7d98ce6
to
f727975
Compare
626545a
to
cd36336
Compare
f727975
to
b71383e
Compare
cd36336
to
072e716
Compare
072e716
to
d985546
Compare
b71383e
to
6f44b9f
Compare
d985546
to
648f7be
Compare
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.
Thanks!
A much more lightweight alternative would be to just serialize and deserialize a Wallet
with blobs in it. (Without actually saving to disk.) But I'm fine with either! 👍
linera-client/src/unit_tests/mod.rs
Outdated
#[cfg(test)] | ||
mod util; | ||
|
||
#[cfg(test)] | ||
mod chain_listener; | ||
|
||
#[cfg(test)] | ||
mod wallet; |
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.
Isn't the whole module already cfg(test)
?
#[cfg(test)] | |
mod util; | |
#[cfg(test)] | |
mod chain_listener; | |
#[cfg(test)] | |
mod wallet; | |
mod util; | |
mod chain_listener; | |
mod wallet; |
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.
Good point 😅 Will fix
That's a great point 🤔 I went with it like this because I thought that we might as well test the full flow of saving a wallet with pending blobs, as that wasn't triggered by any other test it seems |
648f7be
to
f060ff1
Compare
linera-client/src/client_context.rs
Outdated
@@ -185,6 +185,41 @@ where | |||
} | |||
} | |||
|
|||
#[cfg(with_testing)] | |||
pub fn new_test(storage: S, wallet: W) -> Self { |
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.
{create,make,new}_test_client_context
?
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 thought the client_context
suffix was redundant, since we're calling it from a ClientContext
struct 🤔 but I can change it
f060ff1
to
c5e6324
Compare
c5e6324
to
3d43078
Compare
Motivation
CI was failing on PR #2646 with a JSON serialization failure. That was fixed by PR #2668 but we realized none of our tests covered this case.
Proposal
Create a test that tries to save a wallet with pending blobs in it. Verified that before #2668 this test fails, and now it succeeds.
Test Plan
CI
Release Plan