Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Update default and minimum plot size to 2GB
Browse files Browse the repository at this point in the history
* update default and mininum plot size to 2GB

* fix cargo fmt

* increment version

---------

Co-authored-by: Jeremy Frank <[email protected]>
Co-authored-by: Parth Desai <[email protected]>
  • Loading branch information
3 people authored Jul 3, 2023
1 parent d63c7c6 commit 184a88b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subspace-cli"
version = "0.5.0"
version = "0.5.1"
edition = "2021"

[dependencies]
Expand Down
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use tracing::instrument;
use crate::utils::{cache_directory_getter, provider_storage_dir_getter, IntoEyre};

/// defaults for the user config file
pub(crate) const DEFAULT_PLOT_SIZE: ByteSize = ByteSize::gb(1);
pub(crate) const MIN_PLOT_SIZE: ByteSize = ByteSize::mib(32);
pub(crate) const DEFAULT_PLOT_SIZE: ByteSize = ByteSize::gb(2);
pub(crate) const MIN_PLOT_SIZE: ByteSize = ByteSize::gb(2);

/// structure of the config toml file
#[derive(Deserialize, Serialize, Debug)]
Expand Down
5 changes: 3 additions & 2 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ fn reward_address_checker() {

#[test]
fn size_checker() {
assert!(size_parser("800MB").is_ok());
assert!(size_parser("103gjie").is_err());
assert!(size_parser("2GB").is_ok());
assert!(size_parser("12GB").is_ok());
assert!(size_parser("103gjie").is_err());
assert!(size_parser("1.2GB").is_err());
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub(crate) fn size_parser(size: &str) -> Result<ByteSize> {
return Err(eyre!("could not parse the value!"));
};
if size < MIN_PLOT_SIZE {
Err(eyre!("size could not be smaller than 1GB"))
Err(eyre!(format!("plot size cannot be smaller than {}", MIN_PLOT_SIZE)))
} else {
Ok(size)
}
Expand Down

0 comments on commit 184a88b

Please sign in to comment.