From 30dcace5d1bbc2096396de7a8416ac0b29871c90 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2020 09:27:23 +0000 Subject: [PATCH 1/2] Update ethabi requirement from 9.0.0 to 11.0.0 Updates the requirements on [ethabi](https://github.com/paritytech/ethabi) to permit the latest version. - [Release notes](https://github.com/paritytech/ethabi/releases) - [Changelog](https://github.com/paritytech/ethabi/blob/master/CHANGELOG.md) - [Commits](https://github.com/paritytech/ethabi/compare/v9.0.0...v11.0.0) Signed-off-by: dependabot-preview[bot] --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index f9c4e907..ab72dd0b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" [dependencies] arrayvec = "0.5.0" -ethabi = "9.0.0" +ethabi = "11.0.0" ethereum-types = "0.8.0" futures = "0.1.26" jsonrpc-core = "14.0.0" From 3d80baa101878527d37c9f67aac6d074888f20ce Mon Sep 17 00:00:00 2001 From: Nicholas Rodrigues Lordello Date: Wed, 5 Feb 2020 18:04:48 +0100 Subject: [PATCH 2/2] update ethabi error API --- src/contract/deploy.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/contract/deploy.rs b/src/contract/deploy.rs index 1f2cd41f..55776ebd 100644 --- a/src/contract/deploy.rs +++ b/src/contract/deploy.rs @@ -113,21 +113,21 @@ impl Builder { for (lib, address) in self.linker { if lib.len() > 38 { - return Err( - ethabi::ErrorKind::Msg(String::from("The library name should be under 39 characters.")).into(), - ); + return Err(ethabi::Error::Other( + "The library name should be under 39 characters.".into(), + )); } let replace = format!("__{:_<38}", lib); // This makes the required width 38 characters and will pad with `_` to match it. let address: String = address.as_ref().to_hex(); code_hex = code_hex.replacen(&replace, &address, 1); } code_hex = code_hex.replace("\"", "").replace("0x", ""); // This is to fix truffle + serde_json redundant `"` and `0x` - let code = code_hex.from_hex().map_err(ethabi::ErrorKind::Hex)?; + let code = code_hex.from_hex().map_err(ethabi::Error::Hex)?; let params = params.into_tokens(); let data = match (abi.constructor(), params.is_empty()) { (None, false) => { - return Err(ethabi::ErrorKind::Msg("Constructor is not defined in the ABI.".into()).into()); + return Err(ethabi::Error::Other("Constructor is not defined in the ABI.".into())); } (None, true) => code, (Some(constructor), _) => constructor.encode_input(code, ¶ms)?,