mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 13:57:58 +00:00
Allow pallet::call to return DispatchResult (#8241)
* allow dispatch result * remove custom error message * format * add forgotten UI test * fix test * fix tests
This commit is contained in:
committed by
GitHub
parent
4de4662480
commit
fb8da7ea92
@@ -161,6 +161,14 @@ pub mod pallet {
|
||||
|
||||
Ok(().into())
|
||||
}
|
||||
|
||||
// Test for DispatchResult return type
|
||||
#[pallet::weight(1)]
|
||||
fn foo_no_post_info(
|
||||
_origin: OriginFor<T>,
|
||||
) -> DispatchResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
@@ -425,7 +433,7 @@ fn call_expand() {
|
||||
assert_eq!(call_foo.get_call_name(), "foo");
|
||||
assert_eq!(
|
||||
pallet::Call::<Runtime>::get_call_names(),
|
||||
&["foo", "foo_transactional"],
|
||||
&["foo", "foo_transactional", "foo_no_post_info"],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -669,6 +677,11 @@ fn metadata() {
|
||||
" Doc comment put in metadata".to_string(),
|
||||
]),
|
||||
},
|
||||
FunctionMetadata {
|
||||
name: DecodeDifferent::Decoded("foo_no_post_info".to_string()),
|
||||
arguments: DecodeDifferent::Decoded(vec![]),
|
||||
documentation: DecodeDifferent::Decoded(vec![]),
|
||||
},
|
||||
])),
|
||||
event: Some(DecodeDifferent::Decoded(vec![
|
||||
EventMetadata {
|
||||
|
||||
Reference in New Issue
Block a user