mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 07:37:57 +00:00
Pass transaction source to validate_transaction (#5366)
* WiP * Support source in the runtime API. * Finish implementation in txpool. * Fix warning. * Fix tests. * Apply suggestions from code review Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-Authored-By: Nikolay Volf <nikvolf@gmail.com> * Extra changes. * Fix test and benches. * fix test * Fix test & benches again. * Fix tests. * Update bumpalo * Fix doc test. * Fix doctest. * Fix doctest. Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
This commit is contained in:
@@ -21,7 +21,7 @@ use crate::traits::{
|
||||
self, Member, MaybeDisplay, SignedExtension, Dispatchable,
|
||||
};
|
||||
use crate::traits::ValidateUnsigned;
|
||||
use crate::transaction_validity::TransactionValidity;
|
||||
use crate::transaction_validity::{TransactionValidity, TransactionSource};
|
||||
|
||||
/// Definition of something that the external world might want to say; its
|
||||
/// existence implies that it has been checked and is good, particularly with
|
||||
@@ -50,6 +50,9 @@ where
|
||||
|
||||
fn validate<U: ValidateUnsigned<Call = Self::Call>>(
|
||||
&self,
|
||||
// TODO [#5006;ToDr] should source be passed to `SignedExtension`s?
|
||||
// Perhaps a change for 2.0 to avoid breaking too much APIs?
|
||||
source: TransactionSource,
|
||||
info: Self::DispatchInfo,
|
||||
len: usize,
|
||||
) -> TransactionValidity {
|
||||
@@ -57,7 +60,7 @@ where
|
||||
Extra::validate(extra, id, &self.function, info.clone(), len)
|
||||
} else {
|
||||
let valid = Extra::validate_unsigned(&self.function, info, len)?;
|
||||
let unsigned_validation = U::validate_unsigned(&self.function)?;
|
||||
let unsigned_validation = U::validate_unsigned(source, &self.function)?;
|
||||
Ok(valid.combine_with(unsigned_validation))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user