diff --git a/ethcontract-common/Cargo.toml b/ethcontract-common/Cargo.toml index dff97bd7..d26461be 100644 --- a/ethcontract-common/Cargo.toml +++ b/ethcontract-common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethcontract-common" -version = "0.25.3" +version = "0.25.4" authors = ["Gnosis developers "] edition = "2021" license = "MIT OR Apache-2.0" diff --git a/ethcontract-derive/Cargo.toml b/ethcontract-derive/Cargo.toml index bab96b6e..588b4a82 100644 --- a/ethcontract-derive/Cargo.toml +++ b/ethcontract-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethcontract-derive" -version = "0.25.3" +version = "0.25.4" authors = ["Gnosis developers "] edition = "2021" license = "MIT OR Apache-2.0" @@ -20,8 +20,8 @@ proc-macro = true [dependencies] anyhow = "1.0" -ethcontract-common = { version = "0.25.3", path = "../ethcontract-common" } -ethcontract-generate = { version = "0.25.3", path = "../ethcontract-generate", default-features = false } +ethcontract-common = { version = "0.25.4", path = "../ethcontract-common" } +ethcontract-generate = { version = "0.25.4", path = "../ethcontract-generate", default-features = false } proc-macro2 = "1.0" quote = "1.0" syn = "2.0" diff --git a/ethcontract-generate/Cargo.toml b/ethcontract-generate/Cargo.toml index 0d8e63d7..23b345f7 100644 --- a/ethcontract-generate/Cargo.toml +++ b/ethcontract-generate/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethcontract-generate" -version = "0.25.3" +version = "0.25.4" authors = ["Gnosis developers "] edition = "2021" license = "MIT OR Apache-2.0" @@ -18,7 +18,7 @@ http = ["curl"] [dependencies] anyhow = "1.0" curl = { version = "0.4", optional = true } -ethcontract-common = { version = "0.25.3", path = "../ethcontract-common" } +ethcontract-common = { version = "0.25.4", path = "../ethcontract-common" } Inflector = "0.11" proc-macro2 = "1.0" quote = "1.0" diff --git a/ethcontract-mock/Cargo.toml b/ethcontract-mock/Cargo.toml index 60a1fa06..52e16768 100644 --- a/ethcontract-mock/Cargo.toml +++ b/ethcontract-mock/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethcontract-mock" -version = "0.25.3" +version = "0.25.4" authors = ["Gnosis developers "] edition = "2021" license = "MIT OR Apache-2.0" @@ -12,7 +12,7 @@ Tools for mocking ethereum contracts. """ [dependencies] -ethcontract = { version = "0.25.3", path = "../ethcontract", default-features = false, features = ["derive"] } +ethcontract = { version = "0.25.4", path = "../ethcontract", default-features = false, features = ["derive"] } hex = "0.4" mockall = "0.11" rlp = "0.5" @@ -20,4 +20,4 @@ predicates = "3.0" [dev-dependencies] tokio = { version = "1.6", features = ["macros", "rt"] } -ethcontract-derive = { version = "0.25.3", path = "../ethcontract-derive", default-features = false } +ethcontract-derive = { version = "0.25.4", path = "../ethcontract-derive", default-features = false } diff --git a/ethcontract/Cargo.toml b/ethcontract/Cargo.toml index 1b2bb3bc..ac7bc652 100644 --- a/ethcontract/Cargo.toml +++ b/ethcontract/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethcontract" -version = "0.25.3" +version = "0.25.4" authors = ["Gnosis developers "] edition = "2021" license = "MIT OR Apache-2.0" @@ -35,8 +35,8 @@ ws-tokio = ["web3/ws-tokio"] aws-config = { version = "0.55", optional = true } aws-sdk-kms = { version = "0.28", optional = true } arrayvec = "0.7" -ethcontract-common = { version = "0.25.3", path = "../ethcontract-common" } -ethcontract-derive = { version = "0.25.3", path = "../ethcontract-derive", optional = true, default-features = false } +ethcontract-common = { version = "0.25.4", path = "../ethcontract-common" } +ethcontract-derive = { version = "0.25.4", path = "../ethcontract-derive", optional = true, default-features = false } futures = "0.3" futures-timer = "3.0" hex = "0.4" diff --git a/ethcontract/src/contract.rs b/ethcontract/src/contract.rs index 055f4c58..10736c23 100644 --- a/ethcontract/src/contract.rs +++ b/ethcontract/src/contract.rs @@ -10,7 +10,7 @@ use crate::{ errors::{DeployError, LinkError}, tokens::Tokenize, }; -use ethcontract_common::abi::{Error as AbiError, Result as AbiResult}; +use ethcontract_common::abi::{encode, Error as AbiError, Result as AbiResult}; use ethcontract_common::abiext::FunctionExt; use ethcontract_common::hash::H32; use ethcontract_common::{Abi, Bytecode, Contract, DeploymentInformation}; @@ -202,17 +202,17 @@ impl Instance { R: Tokenize, { let signature = signature.into().into_inner(); - let signature = signature.as_ref(); let function = self .methods - .get(signature) + .get(&signature) .map(|(name, index)| &self.abi.functions[name][*index]) .ok_or_else(|| AbiError::InvalidName(hex::encode(signature)))?; let tokens = match params.into_token() { ethcontract_common::abi::Token::Tuple(tokens) => tokens, _ => unreachable!("function arguments are always tuples"), }; - let data = function.encode_input(&tokens)?; + + let data = signature.iter().copied().chain(encode(&tokens)).collect(); // take ownership here as it greatly simplifies dealing with futures // lifetime as it would require the contract Instance to live until