mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
Improve Dispatch Errors (#878)
* better dispatch errors * dry_run to use same DispatchError * fix dry_run_fails; use correct transfer amount * Hide ModuleError impl and avoid pulling details from metadata unless user needs them * fix tests * actually fix the tests (hopefully..) * Add a couple more DispatchError test cases * Add a comment about where the error was copied from * Also expose a way to obtain the raw module error data * Remove redundant variant prefixes * explicit lifetime on From<str> for clarity * fmt
This commit is contained in:
@@ -72,7 +72,7 @@ where
|
||||
let block_hash = self.header.hash();
|
||||
let block_details = match self.client.rpc().block(Some(block_hash)).await? {
|
||||
Some(block) => block,
|
||||
None => return Err(BlockError::block_hash_not_found(block_hash).into()),
|
||||
None => return Err(BlockError::not_found(block_hash).into()),
|
||||
};
|
||||
|
||||
Ok(BlockBody::new(
|
||||
|
||||
@@ -66,7 +66,7 @@ where
|
||||
|
||||
let block_header = match client.rpc().header(Some(block_hash)).await? {
|
||||
Some(header) => header,
|
||||
None => return Err(BlockError::block_hash_not_found(block_hash).into()),
|
||||
None => return Err(BlockError::not_found(block_hash).into()),
|
||||
};
|
||||
|
||||
Ok(Block::new(block_header, client))
|
||||
|
||||
Reference in New Issue
Block a user