[dependencies]: unify rustc-hex (#11506)

* [dependency]: unify `rustc-hex`

* [private tx]: fix upgrade to `rustc hex 2.1.0`
This commit is contained in:
Niklas Adolfsson
2020-02-21 15:10:00 +01:00
committed by GitHub
parent bec867be03
commit 2018f5b0ab
52 changed files with 355 additions and 357 deletions

View File

@@ -31,7 +31,6 @@ use hash::keccak;
use bytes::Bytes;
use ethereum_types::{U256, U512, H256, Address, BigEndianHash};
use vm::{
self, ActionParams, ParamsType, ActionValue, ActionType, MessageCallResult,
ContractCreateResult, CreateContractAddress, ReturnData, GasLeft, Schedule,
@@ -556,11 +555,11 @@ impl<Cost: CostType> Interpreter<Cost> {
let contract_code = self.mem.read_slice(init_off, init_size);
let create_result = ext.create(
&create_gas.as_u256(),
&endowment,
contract_code,
&self.params.code_version,
address_scheme,
&create_gas.as_u256(),
&endowment,
contract_code,
&self.params.code_version,
address_scheme,
true,
);
return match create_result {
@@ -1221,7 +1220,6 @@ fn address_to_u256(value: Address) -> U256 {
#[cfg(test)]
mod tests {
use std::sync::Arc;
use rustc_hex::FromHex;
use factory::Factory;
use vm::{self, Exec, ActionParams, ActionValue};
use vm::tests::{FakeExt, test_finalize};
@@ -1233,7 +1231,7 @@ mod tests {
#[test]
fn should_not_fail_on_tracing_mem() {
let code = "7feeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526000620f120660406000601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f1600055".from_hex().unwrap();
let code = hex!("7feeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526000620f120660406000601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f1600055").to_vec();
let mut params = ActionParams::default();
params.address = Address::from_low_u64_be(5);
@@ -1256,7 +1254,7 @@ mod tests {
#[test]
fn should_not_overflow_returndata() {
let code = "6001600160000360003e00".from_hex().unwrap();
let code = hex!("6001600160000360003e00").to_vec();
let mut params = ActionParams::default();
params.address = Address::from_low_u64_be(5);

View File

@@ -101,9 +101,8 @@ impl Default for SharedCache {
#[test]
fn test_find_jump_destinations() {
use rustc_hex::FromHex;
// given
let code = "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b01600055".from_hex().unwrap();
let code = hex!("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b01600055");
// when
let valid_jump_destinations = SharedCache::find_jump_destinations(&code);

View File

@@ -32,8 +32,7 @@ extern crate lazy_static;
extern crate log;
#[cfg(test)]
extern crate rustc_hex;
#[cfg(test)]
#[macro_use]
extern crate hex_literal;
pub mod evm;