Add documentation to SubmitSignedTransaction and actually make it work (#4200)

* Add documentation to signed transactions and actually make them work.

* Fix naming and bounds.

* Forgotten import.

* Remove warning.

* Make accounts optional, fix logic.

* Split the method to avoid confusing type error message.

* Move executor tests to integration.

* Add submit transactions tests.

* Make `submit_transaction` tests compile

* Remove a file that was accidently committed

* Add can_sign helper function.

* Fix compilation.

* Add a key to keystore.

* Fix the tests.

* Remove env_logger.

* Fix sending multiple transactions.

* Remove commented code.

* Bring back criterion.

* Remove stray debug log.

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Make sure to initialize block correctly.

* Initialize block for offchain workers.

* Add test for transaction validity.

* Fix tests.

* Review suggestions.

* Remove redundant comment.

* Make sure to use correct block number of authoring.

* Change the runtime API.

* Support both versions.

* Bump spec version, fix RPC test.

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
Co-authored-by: Gavin Wood <github@gavwood.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Tomasz Drwięga
2020-01-10 01:46:55 +01:00
committed by Gavin Wood
parent a1e0076aa8
commit 74d6e660c6
29 changed files with 2096 additions and 1413 deletions
+17 -3
View File
@@ -571,14 +571,22 @@ mod tests {
inner: vec![seal_header(create_header(0, Default::default(), Default::default()), 999)],
};
let initialize_block = |number, hash: H256| System::initialize(
&number,
&hash,
&Default::default(),
&Default::default(),
Default::default()
);
for number in 1..8 {
System::initialize(&number, &canon_chain.best_hash(), &Default::default(), &Default::default());
initialize_block(number, canon_chain.best_hash());
let header = seal_header(System::finalize(), author_a);
canon_chain.push(header);
}
// initialize so system context is set up correctly.
System::initialize(&8, &canon_chain.best_hash(), &Default::default(), &Default::default());
initialize_block(8, canon_chain.best_hash());
// 2 of the same uncle at once
{
@@ -663,7 +671,13 @@ mod tests {
);
header.digest_mut().pop(); // pop the seal off.
System::initialize(&1, &Default::default(), &Default::default(), header.digest());
System::initialize(
&1,
&Default::default(),
&Default::default(),
header.digest(),
Default::default(),
);
assert_eq!(Authorship::author(), author);
});