mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-09 19:57:34 +00:00
Only return an error if the extrinsic failed. (#156)
This commit is contained in:
@@ -112,6 +112,7 @@ mod tests {
|
||||
use crate::{
|
||||
error::{
|
||||
Error,
|
||||
ModuleError,
|
||||
RuntimeError,
|
||||
},
|
||||
events::EventsDecoder,
|
||||
@@ -193,8 +194,8 @@ mod tests {
|
||||
let res = client
|
||||
.transfer_and_watch(&hans, alice.account_id(), 100_000_000_000)
|
||||
.await;
|
||||
if let Err(Error::Runtime(error)) = res {
|
||||
let error2 = RuntimeError {
|
||||
if let Err(Error::Runtime(RuntimeError::Module(error))) = res {
|
||||
let error2 = ModuleError {
|
||||
module: "Balances".into(),
|
||||
error: "InsufficientBalance".into(),
|
||||
};
|
||||
|
||||
+5
-2
@@ -43,7 +43,10 @@ pub struct SudoCall<'a, T: Sudo> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{
|
||||
error::Error,
|
||||
error::{
|
||||
Error,
|
||||
RuntimeError,
|
||||
},
|
||||
extrinsic::PairSigner,
|
||||
frame::balances::TransferCall,
|
||||
tests::{
|
||||
@@ -68,7 +71,7 @@ mod tests {
|
||||
|
||||
let res = client.sudo_and_watch(&alice, &call).await;
|
||||
assert!(
|
||||
if let Err(Error::BadOrigin) = res {
|
||||
if let Err(Error::Runtime(RuntimeError::BadOrigin)) = res {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user