Skip to content

Commit

Permalink
suppress unused warning in kitchensink example (paritytech#14417)
Browse files Browse the repository at this point in the history
* suppress unused warning in kitchensink example

* Adds test

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: Nikhil Gupta <17176722+gupnik@users.noreply.github.com>
Co-authored-by: command-bot <>
  • Loading branch information
2 people authored and nathanwhit committed Jul 19, 2023
1 parent c69d0bb commit 2fc7218
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion frame/examples/kitchensink/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Tests for pallet-example-kitchensink.

use crate::*;
use frame_support::{derive_impl, parameter_types, traits::ConstU64};
use frame_support::{assert_ok, derive_impl, parameter_types, traits::ConstU64};
use sp_runtime::BuildStorage;
// Reexport crate as its pallet name for construct_runtime.
use crate as pallet_example_kitchensink;
Expand Down Expand Up @@ -100,3 +100,14 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
.unwrap();
t.into()
}

#[test]
fn set_foo_works() {
new_test_ext().execute_with(|| {
assert_eq!(Foo::<Test>::get(), Some(24)); // From genesis config.

let val1 = 42;
assert_ok!(Kitchensink::set_foo(RuntimeOrigin::root(), val1, 2));
assert_eq!(Foo::<Test>::get(), Some(val1));
});
}

0 comments on commit 2fc7218

Please sign in to comment.