mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +00:00
Improve mock_impl_runtime_apis! (#7370)
* Improve `mock_impl_runtime_apis!` This adds a new attribute for functions being implemented in the `mock_impl_runtime_apis!` macro, the `advanced` attribute. When this attribute is given the user gets access to the `at` parameter and is able to return a `Result`, instead of letting the macro generate this stuff. * Use the `at_param_name` directly * Prevent clashing of `params`
This commit is contained in:
@@ -196,6 +196,13 @@ pub enum NativeOrEncoded<R> {
|
||||
Encoded(Vec<u8>)
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl<R> From<R> for NativeOrEncoded<R> {
|
||||
fn from(val: R) -> Self {
|
||||
Self::Native(val)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl<R: codec::Encode> sp_std::fmt::Debug for NativeOrEncoded<R> {
|
||||
fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
|
||||
|
||||
Reference in New Issue
Block a user