mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 07:58:00 +00:00
removed pallet::getter from example pallets (#3371)
part of #3326 @ggwpez @kianenigma @shawntabrizi --------- Signed-off-by: Matteo Muraca <mmuraca247@gmail.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -119,25 +119,25 @@ fn it_works_for_optional_value() {
|
||||
// Check that GenesisBuilder works properly.
|
||||
let val1 = 42;
|
||||
let val2 = 27;
|
||||
assert_eq!(Example::dummy(), Some(val1));
|
||||
assert_eq!(Dummy::<Test>::get(), Some(val1));
|
||||
|
||||
// Check that accumulate works when we have Some value in Dummy already.
|
||||
assert_ok!(Example::accumulate_dummy(RuntimeOrigin::signed(1), val2));
|
||||
assert_eq!(Example::dummy(), Some(val1 + val2));
|
||||
assert_eq!(Dummy::<Test>::get(), Some(val1 + val2));
|
||||
|
||||
// Check that accumulate works when we Dummy has None in it.
|
||||
<Example as OnInitialize<u64>>::on_initialize(2);
|
||||
assert_ok!(Example::accumulate_dummy(RuntimeOrigin::signed(1), val1));
|
||||
assert_eq!(Example::dummy(), Some(val1 + val2 + val1));
|
||||
assert_eq!(Dummy::<Test>::get(), Some(val1 + val2 + val1));
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn it_works_for_default_value() {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_eq!(Example::foo(), 24);
|
||||
assert_eq!(Foo::<Test>::get(), 24);
|
||||
assert_ok!(Example::accumulate_foo(RuntimeOrigin::signed(1), 1));
|
||||
assert_eq!(Example::foo(), 25);
|
||||
assert_eq!(Foo::<Test>::get(), 25);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ fn set_dummy_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let test_val = 133;
|
||||
assert_ok!(Example::set_dummy(RuntimeOrigin::root(), test_val.into()));
|
||||
assert_eq!(Example::dummy(), Some(test_val));
|
||||
assert_eq!(Dummy::<Test>::get(), Some(test_val));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user