Give more information why conversion between native and runtime failed (#3720)

* Give more information why conversion between native and runtime failed

This adds the SCALE error description to the error when the conversion
between native and runtime failed.

* Fixes tests
This commit is contained in:
Bastian Köcher
2019-09-30 18:03:13 +02:00
committed by GitHub
parent 98879a2bdb
commit f6c4c47b50
10 changed files with 28 additions and 25 deletions
+4 -4
View File
@@ -72,7 +72,7 @@ where
Result<NativeOrEncoded<R>, Self::Error>
) -> Result<NativeOrEncoded<R>, Self::Error>,
R: Encode + Decode + PartialEq,
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
NC: FnOnce() -> result::Result<R, String> + UnwindSafe,
>(
&self,
initialize_block_fn: IB,
@@ -104,7 +104,7 @@ where
Result<NativeOrEncoded<R>, Self::Error>
) -> Result<NativeOrEncoded<R>, Self::Error>,
R: Encode + Decode + PartialEq,
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
NC: FnOnce() -> result::Result<R, String> + UnwindSafe,
>(&self,
state: &S,
overlay: &mut OverlayedChanges,
@@ -234,7 +234,7 @@ where
Result<NativeOrEncoded<R>, Self::Error>
) -> Result<NativeOrEncoded<R>, Self::Error>,
R: Encode + Decode + PartialEq,
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
NC: FnOnce() -> result::Result<R, String> + UnwindSafe,
>(
&self,
initialize_block_fn: IB,
@@ -342,7 +342,7 @@ where
Result<NativeOrEncoded<R>, Self::Error>
) -> Result<NativeOrEncoded<R>, Self::Error>,
R: Encode + Decode + PartialEq,
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
NC: FnOnce() -> result::Result<R, String> + UnwindSafe,
>(&self,
state: &S,
changes: &mut OverlayedChanges,
+1 -1
View File
@@ -1419,7 +1419,7 @@ impl<B, E, Block, RA> CallRuntimeAt<Block> for Client<B, E, Block, RA> where
fn call_api_at<
'a,
R: Encode + Decode + PartialEq,
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
NC: FnOnce() -> result::Result<R, String> + UnwindSafe,
C: CoreApi<Block>,
>(
&self,
@@ -99,7 +99,7 @@ impl<Block, B, Local> CallExecutor<Block, Blake2Hasher> for
Result<NativeOrEncoded<R>, Self::Error>
) -> Result<NativeOrEncoded<R>, Self::Error>,
R: Encode + Decode + PartialEq,
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
NC: FnOnce() -> result::Result<R, String> + UnwindSafe,
>(
&self,
initialize_block_fn: IB,
@@ -160,7 +160,7 @@ impl<Block, B, Local> CallExecutor<Block, Blake2Hasher> for
Result<NativeOrEncoded<R>, Self::Error>
) -> Result<NativeOrEncoded<R>, Self::Error>,
R: Encode + Decode + PartialEq,
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
NC: FnOnce() -> result::Result<R, String> + UnwindSafe,
>(&self,
_state: &S,
_changes: &mut OverlayedChanges,
@@ -334,7 +334,7 @@ mod tests {
Result<NativeOrEncoded<R>, Self::Error>
) -> Result<NativeOrEncoded<R>, Self::Error>,
R: Encode + Decode + PartialEq,
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
NC: FnOnce() -> result::Result<R, String> + UnwindSafe,
>(
&self,
_initialize_block_fn: IB,
@@ -364,7 +364,7 @@ mod tests {
Result<NativeOrEncoded<R>, Self::Error>
) -> Result<NativeOrEncoded<R>, Self::Error>,
R: Encode + Decode + PartialEq,
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
NC: FnOnce() -> result::Result<R, String> + UnwindSafe,
>(&self,
_state: &S,
_overlay: &mut OverlayedChanges,
+1 -1
View File
@@ -136,7 +136,7 @@ pub trait CallRuntimeAt<Block: BlockT> {
fn call_api_at<
'a,
R: Encode + Decode + PartialEq,
NC: FnOnce() -> result::Result<R, &'static str> + UnwindSafe,
NC: FnOnce() -> result::Result<R, String> + UnwindSafe,
C: Core<Block>,
>(
&self,