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

Refactor Runtime #44

Merged
merged 8 commits into from
Jul 10, 2024
Merged

Refactor Runtime #44

merged 8 commits into from
Jul 10, 2024

Conversation

dr-orlovsky
Copy link
Member

@dr-orlovsky dr-orlovsky commented Jun 30, 2024

Runtime is misleading since there might be many different runtimes for different purposes. This one is quite simple one - it just reads and writes wallet to a file.

To use it one will also need an update in RGB wallet: RGB-WG/rgb#216

@zoedberg there is nothing to review actually, I set you as a reviewer to inform about the name change if you are using this type (I assume you are not).

UPD: I found a bug in the implementation of StoredWallet which doesn't automatically save the data upon modification. As a part of the solution, I have refactored StoredWallet into Wallet itself.

UPD2: I ended up with some larger refactoring due to the discovery of a bug when the wallet data are not always saved to the disk. Thus, I have refactored all FS-related workflows to ensure the data are always saved. As a side-effect, I got rid of a few types and traits which became redundant, thus the APIs and namings have become clearer and simpler.

This PR has two counterparts:

@dr-orlovsky dr-orlovsky added the enhancement New feature or request label Jun 30, 2024
@dr-orlovsky dr-orlovsky added this to the v0.11.0 milestone Jun 30, 2024
@dr-orlovsky dr-orlovsky requested a review from zoedberg June 30, 2024 18:08
@dr-orlovsky dr-orlovsky self-assigned this Jun 30, 2024
@zoedberg
Copy link
Contributor

zoedberg commented Jul 1, 2024

@dr-orlovsky I agree that the term Runtime is misleading since it's already used. But the term StoredWallet is also already used in rgb (https://github.com/RGB-WG/rgb/blob/master/src/store.rs#L130), so I think it's better to find another name

@dr-orlovsky
Copy link
Member Author

Yes, that was a thought to get things in line with RGB naming. Both are StoredWallets - they are differentiated by their crate prefix. Users of one will not use the other - and wise verse

@zoedberg
Copy link
Contributor

zoedberg commented Jul 2, 2024

Users of one will not use the other - and wise verse

I don't think this is the case. Check the integration tests PR where we use both the bpwallet::Runtime and rgb::StoredWallet

@dr-orlovsky dr-orlovsky changed the title Rename Runtime to StoredWallet Refactor Runtime Jul 2, 2024
@dr-orlovsky dr-orlovsky marked this pull request as draft July 2, 2024 21:34
@dr-orlovsky dr-orlovsky marked this pull request as ready for review July 6, 2024 08:58
@dr-orlovsky
Copy link
Member Author

I ended up with some larger refactoring due to discovery of a bug when the wallet data are not always saved to the disk. Thus, I have refactored all FS-related workflows to ensure that the data are always saved. As a side-effect, I got rid of few types and traits which become redundant, thus the APIs and namings have become clearer and simpler.

This PR has two counterparts:

@zoedberg
Copy link
Contributor

it seems there's an error with features usage:

error[E0433]: failed to resolve: could not find `cli` in `bpwallet`
  --> rgb/src/errors.rs:88:18
   |
88 |     Bp(bpwallet::cli::ExecError),
   |                  ^^^ could not find `cli` in `bpwallet`
   |
note: found an item that was configured out
  --> /mnt/dmc/zoe/work/bitfinex/rgb-integration-tests/bp-wallet/src/lib.rs:42:9
   |
42 | pub mod cli;
   |         ^^^
   = note: the item is gated behind the `cli` feature

For more information about this error, try `rustc --explain E0433`.
error: could not compile `rgb-runtime` (lib) due to 1 previous error

by adding the cli feature to bp-wallet this error disappears, but I think we need to fix feature gates

Copy link
Contributor

@zoedberg zoedberg left a comment

Choose a reason for hiding this comment

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

tACK 30ae979

@dr-orlovsky dr-orlovsky merged commit 418bf29 into master Jul 10, 2024
19 of 22 checks passed
@dr-orlovsky dr-orlovsky deleted the runtime branch September 5, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants