mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 17:11:02 +00:00
Tagged transaction queue integration (#893)
* Make the graph generic. * Adapting pool API for the graph. * Merge pool & graph. * Restructure. * Fix test of transaction pool. * Get rid of node/transaction-pool. * Compilation fixes. * Test7 * Fix compilation of tests. * Revert runtime changes. * Add validate_transaction to test-runtime. * Fix RPC tests. * Add clearing of the old transactions. * Trigger pool events. * Use new queue API. * Fix wasm build, re-export Hasher. * No warning if validate transaction fails. * Get rid of Into<u64> and use As
This commit is contained in:
@@ -224,11 +224,11 @@ impl<
|
||||
|
||||
/// Check a given transaction for validity. This doesn't execute any
|
||||
/// side-effects; it merely checks whether the transaction would panic if it were included or not.
|
||||
///
|
||||
///
|
||||
/// Changes made to the storage should be discarded.
|
||||
pub fn validate_transaction(uxt: Block::Extrinsic) -> TransactionValidity {
|
||||
let encoded_len = uxt.encode().len();
|
||||
|
||||
|
||||
let xt = match uxt.check(&Default::default()) {
|
||||
// Checks out. Carry on.
|
||||
Ok(xt) => xt,
|
||||
@@ -259,8 +259,13 @@ impl<
|
||||
deps.push((sender, expected_index).encode());
|
||||
expected_index = expected_index + One::one();
|
||||
}
|
||||
|
||||
TransactionValidity::Valid(encoded_len as TransactionPriority, deps, vec![(sender, *index).encode()], TransactionLongevity::max_value())
|
||||
|
||||
TransactionValidity::Valid(
|
||||
/*priority: */encoded_len as TransactionPriority,
|
||||
/*requires: */deps,
|
||||
/*provides: */vec![(sender, *index).encode()],
|
||||
/*longevity: */TransactionLongevity::max_value(),
|
||||
)
|
||||
} else {
|
||||
return TransactionValidity::Invalid
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user