mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 05:11:09 +00:00
Make transaction pool prune transactions only of canonical blocks (#6123)
* Make tx pool aware of retracted fork blocks * Make it compile * Update client/transaction-pool/src/lib.rs Co-authored-by: Nikolay Volf <nikvolf@gmail.com> * Fix doc test * Simplify the implementation * Send tree route as arc to prevent heavy clones * Switch to use `ExtrinsicHash` to make it more clear * Fix benchmark Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
This commit is contained in:
@@ -51,7 +51,6 @@ fn to_tag(nonce: u64, from: AccountId) -> Tag {
|
||||
|
||||
impl ChainApi for TestApi {
|
||||
type Block = Block;
|
||||
type Hash = H256;
|
||||
type Error = sp_transaction_pool::error::Error;
|
||||
type ValidationFuture = Ready<sp_transaction_pool::error::Result<TransactionValidity>>;
|
||||
type BodyFuture = Ready<sp_transaction_pool::error::Result<Option<Vec<Extrinsic>>>>;
|
||||
@@ -107,7 +106,7 @@ impl ChainApi for TestApi {
|
||||
})
|
||||
}
|
||||
|
||||
fn hash_and_length(&self, uxt: &ExtrinsicFor<Self>) -> (Self::Hash, usize) {
|
||||
fn hash_and_length(&self, uxt: &ExtrinsicFor<Self>) -> (H256, usize) {
|
||||
let encoded = uxt.encode();
|
||||
(blake2_256(&encoded).into(), encoded.len())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user