fix(ethabi): breaking changes and force enable serialize for eth-types (#448)

* fix(ethabi): breaking changes and force enable serialize for eth-types

* chore(ethereum-types) enable rlp
This commit is contained in:
Georgios Konstantopoulos 2021-09-13 20:43:54 +03:00 committed by GitHub
parent f2e41c0500
commit a6918aed2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 6 deletions

3
Cargo.lock generated
View File

@ -805,7 +805,7 @@ dependencies = [
[[package]]
name = "ethabi"
version = "14.1.0"
source = "git+https://github.com/rust-ethereum/ethabi/?branch=master#506f6cc364cdb458ac09f2be4f300779da256b08"
source = "git+https://github.com/rust-ethereum/ethabi/?branch=master#8bd90d13956edf18bb47c6e39dcf7ab99bf264c7"
dependencies = [
"anyhow",
"ethereum-types",
@ -923,6 +923,7 @@ dependencies = [
"ecdsa",
"elliptic-curve",
"ethabi",
"ethereum-types",
"futures-util",
"generic-array 0.14.4",
"glob",

View File

@ -8,7 +8,12 @@ use ethers_core::{
};
use ethers_providers::Middleware;
use std::{collections::HashMap, fmt::Debug, hash::Hash, sync::Arc};
use std::{
collections::{BTreeMap, HashMap},
fmt::Debug,
hash::Hash,
sync::Arc,
};
use thiserror::Error;
#[derive(Error, Debug)]
@ -175,7 +180,7 @@ pub fn decode_function_data<D: Detokenize, T: AsRef<[u8]>>(
/// Utility function for creating a mapping between a unique signature and a
/// name-index pair for accessing contract ABI items.
fn create_mapping<T, S, F>(
elements: &HashMap<String, Vec<T>>,
elements: &BTreeMap<String, Vec<T>>,
signature: F,
) -> HashMap<S, (String, usize)>
where

View File

@ -13,6 +13,7 @@ keywords = ["ethereum", "web3", "celo", "ethers"]
rlp = { version = "0.5.0", default-features = false }
# ethabi = { version = "14.1.0", default-features = false }
ethabi = { git = "https://github.com/rust-ethereum/ethabi/", branch = "master" }
ethereum-types = { version = "0.12.0", default-features = false, features = ["serialize", "rlp"] }
arrayvec = { version = "0.7.1", default-features = false }
rlp-derive = { version = "0.1.0", default-features = false }

View File

@ -1,4 +1,4 @@
use std::collections::{HashMap, VecDeque};
use std::collections::{BTreeMap, HashMap, VecDeque};
use crate::abi::error::{bail, format_err, ParseError, Result};
use crate::abi::struct_def::{FieldType, StructFieldType};
@ -52,8 +52,8 @@ impl AbiParser {
// parse struct first
let mut abi = Abi {
constructor: None,
functions: HashMap::new(),
events: HashMap::new(),
functions: BTreeMap::new(),
events: BTreeMap::new(),
receive: false,
fallback: false,
};