Crypto primitives removed from ethkey (#11174)

* Crypto utils removed from ethkey

* Fix ethkey lib

* Switch ethsore to new crypto

* Accounts crate fixed

* Secret store crate switched to new crypto

* Ethcore builtin fixed

* Accounts crate fixed

* Ethcore crate fixed

* Util network fixed

* Util network-devp2p fixed

* Private tx fixed

* Ethcore sync fixed

* Secret store fixed

* Rpc fixed

* Parity fixed

* Ethkey cli fixed

* Local store fixed

* Ethcore blockchain fixed

* Cargo.lock pushed; doc comment added for reversed nonce

* Ethstore tests fixed

* Ethstore cli fixed

* Miner fixed

* Snapshot tests are fixed

* Single brackets removed

* Machine fixed

* Verification fixed

* Executive state fixed

* More single brackets removed

* Update version of parity-crypto

* Use published version 0.4.2 of parity-crypto

* New test in tx_filter fixed
This commit is contained in:
Anton Gavrilov
2019-10-23 13:03:46 +02:00
committed by GitHub
parent 81ca599f2a
commit 834585d61b
176 changed files with 579 additions and 2376 deletions

View File

@@ -1233,7 +1233,7 @@ mod tests {
errors::ExecutionError,
transaction::{Action, Transaction},
};
use ethkey::{Generator, Random};
use parity_crypto::publickey::{Generator, Random};
use evm::{Factory, VMType, evm_test, evm_test_ignore};
use macros::vec_into;
use vm::{ActionParams, ActionValue, CallType, EnvInfo, CreateContractAddress};

View File

@@ -435,7 +435,7 @@ mod tests {
header.set_number(15);
let res = machine.verify_transaction_basic(&transaction, &header);
assert_eq!(res, Err(transaction::Error::InvalidSignature("Crypto error (Invalid EC signature)".into())));
assert_eq!(res, Err(transaction::Error::InvalidSignature("invalid EC signature".into())));
}
#[test]

View File

@@ -178,7 +178,7 @@ mod test {
miner::Miner,
test_helpers,
};
use ethkey::{Secret, KeyPair};
use parity_crypto::publickey::{Secret, KeyPair};
use ethcore_io::IoChannel;
use spec::Spec;
@@ -200,13 +200,13 @@ mod test {
Arc::new(Miner::new_for_tests(&spec, None)),
IoChannel::disconnected(),
).unwrap();
let key1 = KeyPair::from_secret(Secret::from("0000000000000000000000000000000000000000000000000000000000000001")).unwrap();
let key2 = KeyPair::from_secret(Secret::from("0000000000000000000000000000000000000000000000000000000000000002")).unwrap();
let key3 = KeyPair::from_secret(Secret::from("0000000000000000000000000000000000000000000000000000000000000003")).unwrap();
let key4 = KeyPair::from_secret(Secret::from("0000000000000000000000000000000000000000000000000000000000000004")).unwrap();
let key5 = KeyPair::from_secret(Secret::from("0000000000000000000000000000000000000000000000000000000000000005")).unwrap();
let key6 = KeyPair::from_secret(Secret::from("0000000000000000000000000000000000000000000000000000000000000006")).unwrap();
let key7 = KeyPair::from_secret(Secret::from("0000000000000000000000000000000000000000000000000000000000000007")).unwrap();
let key1 = KeyPair::from_secret(Secret::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap()).unwrap();
let key2 = KeyPair::from_secret(Secret::from_str("0000000000000000000000000000000000000000000000000000000000000002").unwrap()).unwrap();
let key3 = KeyPair::from_secret(Secret::from_str("0000000000000000000000000000000000000000000000000000000000000003").unwrap()).unwrap();
let key4 = KeyPair::from_secret(Secret::from_str("0000000000000000000000000000000000000000000000000000000000000004").unwrap()).unwrap();
let key5 = KeyPair::from_secret(Secret::from_str("0000000000000000000000000000000000000000000000000000000000000005").unwrap()).unwrap();
let key6 = KeyPair::from_secret(Secret::from_str("0000000000000000000000000000000000000000000000000000000000000006").unwrap()).unwrap();
let key7 = KeyPair::from_secret(Secret::from_str("0000000000000000000000000000000000000000000000000000000000000007").unwrap()).unwrap();
let filter = TransactionFilter::from_params(spec.params()).unwrap();
let mut basic_tx = Transaction::default();
@@ -279,7 +279,7 @@ mod test {
Arc::new(Miner::new_for_tests(&spec, None)),
IoChannel::disconnected(),
).unwrap();
let key1 = KeyPair::from_secret(Secret::from("0000000000000000000000000000000000000000000000000000000000000001")).unwrap();
let key1 = KeyPair::from_secret(Secret::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap()).unwrap();
// The only difference to version 2 is that the contract now knows the transaction's gas price and data.
// So we only test those: The contract allows only transactions with either nonzero gas price or short data.
@@ -321,10 +321,10 @@ mod test {
Arc::new(Miner::new_for_tests(&spec, None)),
IoChannel::disconnected(),
).unwrap();
let key1 = KeyPair::from_secret(Secret::from("0000000000000000000000000000000000000000000000000000000000000001")).unwrap();
let key2 = KeyPair::from_secret(Secret::from("0000000000000000000000000000000000000000000000000000000000000002")).unwrap();
let key3 = KeyPair::from_secret(Secret::from("0000000000000000000000000000000000000000000000000000000000000003")).unwrap();
let key4 = KeyPair::from_secret(Secret::from("0000000000000000000000000000000000000000000000000000000000000004")).unwrap();
let key1 = KeyPair::from_secret(Secret::from_str("0000000000000000000000000000000000000000000000000000000000000001").unwrap()).unwrap();
let key2 = KeyPair::from_secret(Secret::from_str("0000000000000000000000000000000000000000000000000000000000000002").unwrap()).unwrap();
let key3 = KeyPair::from_secret(Secret::from_str("0000000000000000000000000000000000000000000000000000000000000003").unwrap()).unwrap();
let key4 = KeyPair::from_secret(Secret::from_str("0000000000000000000000000000000000000000000000000000000000000004").unwrap()).unwrap();
let filter = TransactionFilter::from_params(spec.params()).unwrap();
let mut basic_tx = Transaction::default();