forked from paritytech/substrate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add function 'verify_transaction' * Add the transaction status function * Add function 'verify_transaction' * Add the transaction status function * Add function 'verify_transaction' * Add the transaction status function * Add function 'verify_transaction' * Adjust the format
- Loading branch information
Showing
11 changed files
with
342 additions
and
153 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
use chainx_runtime::{Address, UncheckedExtrinsic}; | ||
use chainx_primitives::Hash; | ||
use extrinsic_pool; | ||
use chainx_api; | ||
|
||
|
||
error_chain! { | ||
links { | ||
Pool(extrinsic_pool::Error, extrinsic_pool::ErrorKind); | ||
Api(chainx_api::Error, chainx_api::ErrorKind); | ||
} | ||
errors { | ||
/// Unexpected extrinsic format submitted | ||
InvalidExtrinsicFormat { | ||
description("Invalid extrinsic format."), | ||
display("Invalid extrinsic format."), | ||
} | ||
/// Attempted to queue an inherent transaction. | ||
IsInherent(xt: UncheckedExtrinsic) { | ||
description("Inherent transactions cannot be queued."), | ||
display("Inherent transactions cannot be queued."), | ||
} | ||
/// Attempted to queue a transaction with bad signature. | ||
BadSignature(e: &'static str) { | ||
description("Transaction had bad signature."), | ||
display("Transaction had bad signature: {}", e), | ||
} | ||
/// Attempted to queue a transaction that is already in the pool. | ||
AlreadyImported(hash: Hash) { | ||
description("Transaction is already in the pool."), | ||
display("Transaction {:?} is already in the pool.", hash), | ||
} | ||
/// Import error. | ||
Import(err: Box<::std::error::Error + Send>) { | ||
description("Error importing transaction"), | ||
display("Error importing transaction: {}", err.description()), | ||
} | ||
/// Runtime failure. | ||
UnrecognisedAddress(who: Address) { | ||
description("Unrecognised address in extrinsic"), | ||
display("Unrecognised address in extrinsic: {}", who), | ||
} | ||
/// Extrinsic too large | ||
TooLarge(got: usize, max: usize) { | ||
description("Extrinsic too large"), | ||
display("Extrinsic is too large ({} > {})", got, max), | ||
} | ||
} | ||
} | ||
|
||
impl extrinsic_pool::IntoPoolError for Error { | ||
fn into_pool_error(self) -> ::std::result::Result<extrinsic_pool::Error, Self> { | ||
match self { | ||
Error(ErrorKind::Pool(e), c) => Ok(extrinsic_pool::Error(e, c)), | ||
e => Err(e), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
// Copyright 2018 Chainpool. | ||
|
||
extern crate substrate_codec as codec; | ||
extern crate substrate_runtime_primitives as runtime_primitives; | ||
extern crate substrate_primitives as substrate_primitives; | ||
extern crate substrate_extrinsic_pool as extrinsic_pool; | ||
extern crate substrate_codec as codec; | ||
extern crate substrate_client_db; | ||
extern crate chainx_primitives; | ||
extern crate chainx_runtime; | ||
extern crate substrate_network; | ||
extern crate chainx_executor; | ||
extern crate substrate_executor; | ||
extern crate substrate_extrinsic_pool as extrinsic_pool; | ||
extern crate substrate_network; | ||
extern crate substrate_client; | ||
extern crate chainx_primitives; | ||
extern crate chainx_executor; | ||
extern crate chainx_runtime; | ||
extern crate chainx_api; | ||
extern crate ed25519; | ||
|
||
#[macro_use] | ||
extern crate error_chain; | ||
#[macro_use] | ||
extern crate log; | ||
|
||
mod pool; | ||
mod error; | ||
|
||
pub use pool::TransactionPool; | ||
pub use pool::PoolApi; | ||
|
Oops, something went wrong.