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

feat: ✨ BSP stop storing functionality and hooking up pallets in runtime #15

Merged
merged 20 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,24 @@ homepage = "https://moonsonglabs.com/"
panic = "unwind"

[workspace]
members = ["runtime", "pallets/*", "node", "bsp", "msp", "storage-kit", "support/*"]
members = [
"runtime",
"pallets/*",
"node",
"bsp",
"msp",
"storage-kit",
"support/*",
]
resolver = "2"

[workspace.dependencies]
storage-hub-traits = { path = "support/traits", default-features = false }

pallet-storage-providers = { path = "pallets/providers", default-features = false }
pallet-file-system = { path = "pallets/file-system", default-features = false }
pallet-proofs-dealer = { path = "pallets/proofs-dealer", default-features = false }

[workspace.lints.rust]
suspicious_double_ref_op = { level = "allow", priority = 2 }

Expand Down
15 changes: 14 additions & 1 deletion pallets/file-system/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pallet-file-system"
description = "FRAME pallet template for defining custom runtime logic."
description = "Pallet exposing storage related actions actors can execute within StorageHub."
version = "0.1.0"
homepage = { workspace = true }
license = { workspace = true }
Expand Down Expand Up @@ -28,6 +28,11 @@ frame-support = { git = "https://github.com/paritytech/polkadot-sdk.git", tag =
frame-system = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.5.0", default-features = false }

sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.5.0", default-features = false }
sp-std = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.5.0", default-features = false }

# Local
pallet-storage-providers = { workspace = true }
pallet-proofs-dealer = { workspace = true }

[dev-dependencies]
serde = { version = "1.0.193" }
Expand All @@ -36,19 +41,25 @@ serde = { version = "1.0.193" }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.5.0", default-features = false }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.5.0", default-features = false }

pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.5.0" }

[features]
default = ["std"]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-storage-providers/runtime-benchmarks",
"pallet-proofs-dealer/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
std = [
"codec/std",
"frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
"pallet-storage-providers/std",
"pallet-proofs-dealer/std",
"scale-info/std",
"sp-core/std",
"sp-io/std",
Expand All @@ -57,5 +68,7 @@ std = [
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-storage-providers/try-runtime",
"pallet-proofs-dealer/try-runtime",
"sp-runtime/try-runtime",
]
6 changes: 3 additions & 3 deletions pallets/file-system/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::Pallet as FileSystem;
use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, whitelisted_caller};
use frame_system::RawOrigin;

use crate::types::{FileLocation, Fingerprint, MultiAddress, StorageUnit};
use crate::types::{FileLocation, Fingerprint, MultiAddresses, StorageUnit};

benchmarks! {
issue_storage_request {
Expand All @@ -16,8 +16,8 @@ benchmarks! {
let location: FileLocation<T> = Default::default();
let fingerprint: Fingerprint<T> = Default::default();
let size: StorageUnit<T> = Default::default();
let user_multiaddr: MultiAddress<T> = Default::default();
}: _(RawOrigin::Signed(caller), location.clone(), fingerprint, size, user_multiaddr)
let multiaddresses: MultiAddresses<T> = Default::default();
}: _(RawOrigin::Signed(caller), location.clone(), fingerprint, size, multiaddresses)
verify {
assert!(FileSystem::<T>::storage_requests(location).is_some());
}
Expand Down
Loading
Loading