diff --git a/ethcontract-common/Cargo.toml b/ethcontract-common/Cargo.toml index 5c9db59d..e7037441 100644 --- a/ethcontract-common/Cargo.toml +++ b/ethcontract-common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethcontract-common" -version = "0.11.0" +version = "0.11.1" authors = ["Nicholas Rodrigues Lordello "] edition = "2018" license = "MIT OR Apache-2.0" diff --git a/ethcontract-derive/Cargo.toml b/ethcontract-derive/Cargo.toml index a8d025e2..f00a112a 100644 --- a/ethcontract-derive/Cargo.toml +++ b/ethcontract-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethcontract-derive" -version = "0.11.0" +version = "0.11.1" authors = ["Nicholas Rodrigues Lordello "] edition = "2018" license = "MIT OR Apache-2.0" @@ -15,8 +15,8 @@ Proc macro for generating type-safe bindings to Ethereum smart contracts. proc-macro = true [dependencies] -ethcontract-common = { version = "0.11.0", path = "../ethcontract-common" } -ethcontract-generate = { version = "0.11.0", path = "../ethcontract-generate" } +ethcontract-common = { version = "0.11.1", path = "../ethcontract-common" } +ethcontract-generate = { version = "0.11.1", path = "../ethcontract-generate" } proc-macro2 = "1.0" quote = "1.0" syn = "1.0.12" diff --git a/ethcontract-generate/Cargo.toml b/ethcontract-generate/Cargo.toml index ac8b464e..81daaee7 100644 --- a/ethcontract-generate/Cargo.toml +++ b/ethcontract-generate/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethcontract-generate" -version = "0.11.0" +version = "0.11.1" authors = ["Nicholas Rodrigues Lordello "] edition = "2018" license = "MIT OR Apache-2.0" @@ -14,7 +14,7 @@ Code generation for type-safe bindings to Ethereum smart contracts. [dependencies] anyhow = "1.0" curl = "0.4" -ethcontract-common = { version = "0.11.0", path = "../ethcontract-common" } +ethcontract-common = { version = "0.11.1", path = "../ethcontract-common" } Inflector = "0.11" proc-macro2 = "1.0" quote = "1.0" diff --git a/ethcontract-generate/src/contract/common.rs b/ethcontract-generate/src/contract/common.rs index b43eb1dd..d878c939 100644 --- a/ethcontract-generate/src/contract/common.rs +++ b/ethcontract-generate/src/contract/common.rs @@ -185,7 +185,7 @@ fn expand_transaction_hash(hash: Option) -> TokenStream { let bytes = hash.as_bytes().iter().copied().map(Literal::u8_unsuffixed); quote! { - self::ethcontract::TransactionHash([#( #bytes ),*]) + Some(self::ethcontract::TransactionHash([#( #bytes ),*])) } } @@ -219,7 +219,7 @@ mod tests { assert_quote!( expand_transaction_hash(Some("000102030405060708090a0b0c0d0e0f10111213000000000000000000000000".parse().unwrap())), { - self::ethcontract::TransactionHash([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) + Some(self::ethcontract::TransactionHash([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])) }, ); } diff --git a/ethcontract/Cargo.toml b/ethcontract/Cargo.toml index 566d7c7d..7fdd7a4a 100644 --- a/ethcontract/Cargo.toml +++ b/ethcontract/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethcontract" -version = "0.11.0" +version = "0.11.1" authors = ["Nicholas Rodrigues Lordello "] edition = "2018" license = "MIT OR Apache-2.0" @@ -25,8 +25,8 @@ ws-tokio = ["web3/ws-tokio"] ws-tls-tokio = ["web3/ws-tls-tokio"] [dependencies] -ethcontract-common = { version = "0.11.0", path = "../ethcontract-common" } -ethcontract-derive = { version = "0.11.0", path = "../ethcontract-derive", optional = true} +ethcontract-common = { version = "0.11.1", path = "../ethcontract-common" } +ethcontract-derive = { version = "0.11.1", path = "../ethcontract-derive", optional = true} futures = "0.3" futures-timer = "3.0" hex = "0.4" diff --git a/examples/generate/build.rs b/examples/generate/build.rs index eab10d96..e974aa97 100644 --- a/examples/generate/build.rs +++ b/examples/generate/build.rs @@ -1,10 +1,11 @@ -use ethcontract_generate::Builder; +use ethcontract_generate::{Address, Builder, TransactionHash}; use std::env; use std::path::Path; fn main() { let dest = env::var("OUT_DIR").unwrap(); Builder::new("../truffle/build/contracts/RustCoin.json") + .add_deployment(42, Address::zero(), Some(TransactionHash::zero())) .generate() .unwrap() .write_to_file(Path::new(&dest).join("rust_coin.rs"))