Skip to content

Commit

Permalink
prepare testing for pallet-oracle-data-collection
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm committed Dec 4, 2023
1 parent f398ba9 commit 5a1509a
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pallets/oracle-data-collection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#[cfg(test)]
mod mock;

#[cfg(test)]
mod tests;

pub use pallet::*;

#[frame_support::pallet]
Expand Down
3 changes: 1 addition & 2 deletions pallets/oracle-data-collection/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ use frame_support::{
traits::{ConstU16, ConstU32, ConstU64},
};
use sp_runtime::{
testing::Header,
testing::{Header, H256},
traits::{BlakeTwo256, IdentityLookup},
testing::H256;
};

use crate::pallet as pallet_oracle_data_collection;
Expand Down
59 changes: 59 additions & 0 deletions pallets/oracle-data-collection/src/tests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
use frame_support::{assert_err, assert_ok};

use crate::{mock::*, pallet::Error};

#[test]
fn updating_feeders() {
new_test_ext().execute_with(|| {
//TODO
});
}

#[test]
fn updating_feeders_wrong_admin() {
new_test_ext().execute_with(|| {
//TODO
});
}

#[test]
fn register() {
new_test_ext().execute_with(|| {
//TODO
});
}

#[test]
fn unregister() {
new_test_ext().execute_with(|| {
//TODO
});
}

#[test]
fn update_collection() {
new_test_ext().execute_with(|| {
//TODO
});
}

#[test]
fn update_collection_with_no_feeders() {
new_test_ext().execute_with(|| {
//TODO
});
}

#[test]
fn update_collection_with_feeders_but_no_values() {
new_test_ext().execute_with(|| {
//TODO
});
}

#[test]
fn update_collection_with_feeders_and_values_but_no_registers() {
new_test_ext().execute_with(|| {
//TODO
});
}

0 comments on commit 5a1509a

Please sign in to comment.