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:
Tomasz Drwięga
2020-03-25 14:09:23 +01:00
committed by GitHub
parent 601ac11e52
commit 04ccb179e9
37 changed files with 414 additions and 163 deletions
+3 -2
View File
@@ -239,6 +239,7 @@ mod tests {
BasicPool::new(Default::default(), Arc::new(FullChainApi::new(client.clone()))).0
);
let source = sp_runtime::transaction_validity::TransactionSource::External;
let new_transaction = |nonce: u64| {
let t = Transfer {
from: AccountKeyring::Alice.into(),
@@ -250,9 +251,9 @@ mod tests {
};
// Populate the pool
let ext0 = new_transaction(0);
block_on(pool.submit_one(&BlockId::number(0), ext0)).unwrap();
block_on(pool.submit_one(&BlockId::number(0), source, ext0)).unwrap();
let ext1 = new_transaction(1);
block_on(pool.submit_one(&BlockId::number(0), ext1)).unwrap();
block_on(pool.submit_one(&BlockId::number(0), source, ext1)).unwrap();
let accounts = FullSystem::new(client, pool);