Skip to content

Commit

Permalink
Update ddc-pallet
Browse files Browse the repository at this point in the history
  • Loading branch information
MRamanenkau committed Jul 5, 2023
1 parent 1a8d998 commit 6fd2610
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pallets/ddc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mod tests;
/// Configure the pallet by specifying the parameters and types on which it depends.
pub trait Config: frame_system::Config {
/// Because this pallet emits events, it depends on the runtime's definition of an event.
type Event: From<Event<Self>> + Into<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + Into<<Self as frame_system::Config>::RuntimeEvent>;

/// The minimum length a name may be.
type MinLength: Get<usize>;
Expand Down Expand Up @@ -73,7 +73,7 @@ decl_error! {
// Dispatchable functions must be annotated with a weight and must return a DispatchResult.
decl_module! {
/// CereDDCModule declaration.
pub struct Module<T: Config> for enum Call where origin: T::Origin {
pub struct Module<T: Config> for enum Call where origin: T::RuntimeOrigin {
// Errors must be initialized if they are used by the pallet.
type Error = Error<T>;

Expand Down
8 changes: 4 additions & 4 deletions pallets/ddc/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ impl system::Config for Test {
type BaseCallFilter = Everything;
type BlockWeights = ();
type BlockLength = ();
type Origin = Origin;
type Call = Call;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type Index = u64;
type BlockNumber = u64;
type Hash = H256;
type Hashing = BlakeTwo256;
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type Event = ();
type RuntimeEvent = ();
type BlockHashCount = BlockHashCount;
type DbWeight = ();
type Version = ();
Expand All @@ -62,7 +62,7 @@ parameter_types! {
}

impl pallet_cere_ddc::Config for Test {
type Event = ();
type RuntimeEvent = ();
type MinLength = MinLength;
type MaxLength = MaxLength;
}
Expand Down
6 changes: 3 additions & 3 deletions pallets/ddc/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const BOB: u64 = 2;
fn send_data_works_valid_input() {
new_test_ext().execute_with(|| {
// Dispatch a signed extrinsic.
assert_ok!(CereDDCModule::send_data(Origin::signed(1), BOB, b"12345678".to_vec()));
assert_ok!(CereDDCModule::send_data(RuntimeOrigin::signed(1), BOB, b"12345678".to_vec()));
});
}

Expand All @@ -16,7 +16,7 @@ fn send_data_error_too_long() {
new_test_ext().execute_with(|| {
// Ensure the expected error is thrown when no value is present.
assert_noop!(
CereDDCModule::send_data(Origin::signed(1), BOB, b"TestTooLongString".to_vec()),
CereDDCModule::send_data(RuntimeOrigin::signed(1), BOB, b"TestTooLongString".to_vec()),
Error::<Test>::TooLong
);
});
Expand All @@ -27,7 +27,7 @@ fn send_data_error_too_short() {
new_test_ext().execute_with(|| {
// Ensure the expected error is thrown when no value is present.
assert_noop!(
CereDDCModule::send_data(Origin::signed(1), BOB, b"Short".to_vec()),
CereDDCModule::send_data(RuntimeOrigin::signed(1), BOB, b"Short".to_vec()),
Error::<Test>::TooShort
);
});
Expand Down

0 comments on commit 6fd2610

Please sign in to comment.