Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
akru committed Mar 11, 2024
1 parent d0b5369 commit bb0377c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
22 changes: 8 additions & 14 deletions frame/digital-twin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,14 @@ mod tests {
use crate::{self as digital_twin, *};

use frame_support::{assert_err, assert_ok, parameter_types};
use sp_runtime::{testing::Header, traits::IdentityLookup, DispatchError};
use sp_runtime::{traits::IdentityLookup, BuildStorage, DispatchError};

type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Runtime>;
type Block = frame_system::mocking::MockBlock<Runtime>;

frame_support::construct_runtime!(
pub enum Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
DigitalTwin: digital_twin::{Pallet, Call, Storage, Event<T>},
pub enum Runtime {
System: frame_system,
DigitalTwin: digital_twin,
}
);

Expand All @@ -136,14 +131,13 @@ mod tests {

impl frame_system::Config for Runtime {
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u64;
type Nonce = u64;
type Block = Block;
type RuntimeCall = RuntimeCall;
type Hash = sp_core::H256;
type Hashing = sp_runtime::traits::BlakeTwo256;
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type Version = ();
Expand All @@ -166,8 +160,8 @@ mod tests {
}

fn new_test_ext() -> sp_io::TestExternalities {
let storage = frame_system::GenesisConfig::default()
.build_storage::<Runtime>()
let storage = frame_system::GenesisConfig::<Runtime>::default()
.build_storage()
.unwrap();
storage.into()
}
Expand Down
6 changes: 1 addition & 5 deletions runtime/main/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,11 +628,7 @@ impl pallet_robonomics_liability::Config for Runtime {
}

construct_runtime! {
pub enum Runtime where
Block = Block,
NodeBlock = robonomics_primitives::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
pub enum Runtime {
// Basic stuff.
System: frame_system = 10,
Utility: pallet_utility = 11,
Expand Down
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ with llvmPackages;

mkShell {
buildInputs = [
libz
clang
toolchain
] ++ lib.optionals stdenv.isDarwin [
Expand Down

0 comments on commit bb0377c

Please sign in to comment.