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

increase coverage of ddc-nodes to 90% #175

Merged
merged 4 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions pallets/ddc-nodes/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@ benchmarks! {
p2p_port: 65000u16,
});
}

impl_benchmark_test_suite!(
DdcNodes,
crate::mock::ExtBuilder.build(),
crate::mock::Test,
);
}
1 change: 1 addition & 0 deletions pallets/ddc-nodes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ pub mod pallet {
fn delete(node_pub_key: NodePubKey) -> Result<(), NodeRepositoryError>;
}

#[derive(Debug, PartialEq)]
pub enum NodeRepositoryError {
StorageNodeAlreadyExists,
CDNNodeAlreadyExists,
Expand Down
2 changes: 1 addition & 1 deletion pallets/ddc-nodes/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub(crate) type TestRuntimeCall = <Test as frame_system::Config>::RuntimeCall;
pub struct ExtBuilder;

impl ExtBuilder {
fn build(self) -> TestExternalities {
pub fn build(self) -> TestExternalities {
sp_tracing::try_init_simple();
let mut storage = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();

Expand Down
1 change: 1 addition & 0 deletions pallets/ddc-nodes/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ impl<T: frame_system::Config> NodeTrait<T> for Node<T> {
}
}

#[derive(Debug, PartialEq)]
pub enum NodeError {
InvalidStorageNodePubKey,
InvalidCDNNodePubKey,
Expand Down
Loading
Loading