mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 19:17:58 +00:00
Simplify runtime api error handling (#8114)
* Ahh * Work work work * Fix all the compilation errors * Fix test * More fixes...
This commit is contained in:
@@ -392,7 +392,7 @@ mod execution {
|
||||
bool,
|
||||
) where
|
||||
R: Decode + Encode + PartialEq,
|
||||
NC: FnOnce() -> result::Result<R, String> + UnwindSafe,
|
||||
NC: FnOnce() -> result::Result<R, Box<dyn std::error::Error + Send + Sync>> + UnwindSafe,
|
||||
{
|
||||
let mut cache = StorageTransactionCache::default();
|
||||
|
||||
@@ -449,7 +449,7 @@ mod execution {
|
||||
) -> CallResult<R, Exec::Error>
|
||||
where
|
||||
R: Decode + Encode + PartialEq,
|
||||
NC: FnOnce() -> result::Result<R, String> + UnwindSafe,
|
||||
NC: FnOnce() -> result::Result<R, Box<dyn std::error::Error + Send + Sync>> + UnwindSafe,
|
||||
Handler: FnOnce(
|
||||
CallResult<R, Exec::Error>,
|
||||
CallResult<R, Exec::Error>,
|
||||
@@ -485,7 +485,7 @@ mod execution {
|
||||
) -> CallResult<R, Exec::Error>
|
||||
where
|
||||
R: Decode + Encode + PartialEq,
|
||||
NC: FnOnce() -> result::Result<R, String> + UnwindSafe,
|
||||
NC: FnOnce() -> result::Result<R, Box<dyn std::error::Error + Send + Sync>> + UnwindSafe,
|
||||
{
|
||||
self.overlay.start_transaction();
|
||||
let (result, was_native) = self.execute_aux(
|
||||
@@ -522,7 +522,7 @@ mod execution {
|
||||
) -> Result<NativeOrEncoded<R>, Box<dyn Error>>
|
||||
where
|
||||
R: Decode + Encode + PartialEq,
|
||||
NC: FnOnce() -> result::Result<R, String> + UnwindSafe,
|
||||
NC: FnOnce() -> result::Result<R, Box<dyn std::error::Error + Send + Sync>> + UnwindSafe,
|
||||
Handler: FnOnce(
|
||||
CallResult<R, Exec::Error>,
|
||||
CallResult<R, Exec::Error>,
|
||||
@@ -869,7 +869,7 @@ mod tests {
|
||||
map, traits::{Externalities, RuntimeCode}, testing::TaskExecutor,
|
||||
};
|
||||
use sp_runtime::traits::BlakeTwo256;
|
||||
use std::{result, collections::HashMap};
|
||||
use std::{result, collections::HashMap, panic::UnwindSafe};
|
||||
use codec::Decode;
|
||||
use sp_core::{
|
||||
storage::ChildInfo, NativeOrEncoded, NeverNativeValue,
|
||||
@@ -891,7 +891,7 @@ mod tests {
|
||||
|
||||
fn call<
|
||||
R: Encode + Decode + PartialEq,
|
||||
NC: FnOnce() -> result::Result<R, String>,
|
||||
NC: FnOnce() -> result::Result<R, Box<dyn std::error::Error + Send + Sync>> + UnwindSafe,
|
||||
>(
|
||||
&self,
|
||||
ext: &mut dyn Externalities,
|
||||
|
||||
Reference in New Issue
Block a user