Make Test Helpers no_std Compatible (#823)

* Use `sp-application-crypto` when generating test justifications

* Try to justifications tests compiling

* Try using `ed25519_dalek` for justification creation

* Small cleanup

* Correctly generate a Keypair

The public key didn't correspond to what would be derived
with the given private key.

* Remove enum index hack

* Clean up test account helper functions

* Fix tests in `pallet-finality-verifier`

* Get `pallet-substrate-bridge` tests compiling again

* Use the correct keyring in justification tests

* Clean up Keyring related code a bit

* Appease Clippy

* Remove unused import

* Use keyring variants directly

* Remove unecessary From implementation
This commit is contained in:
Hernando Castano
2021-03-18 16:46:52 -04:00
committed by Bastian Köcher
parent 401d3847d1
commit eb7c96ba14
7 changed files with 128 additions and 86 deletions
@@ -23,12 +23,7 @@ use codec::Encode;
type TestHeader = sp_runtime::testing::Header;
fn make_justification_for_header_1() -> GrandpaJustification<TestHeader> {
make_justification_for_header(
&test_header(1),
TEST_GRANDPA_ROUND,
TEST_GRANDPA_SET_ID,
&authority_list(),
)
make_justification_for_header(&test_header(1), TEST_GRANDPA_ROUND, TEST_GRANDPA_SET_ID, &keyring())
}
#[test]