Skip to content

Commit

Permalink
Fix missing Some in deployment transaction hash (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkgnosis authored Feb 4, 2021
1 parent 9d9215a commit 004a025
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ethcontract-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ethcontract-common"
version = "0.11.0"
version = "0.11.1"
authors = ["Nicholas Rodrigues Lordello <nlordell@gmail.com>"]
edition = "2018"
license = "MIT OR Apache-2.0"
Expand Down
6 changes: 3 additions & 3 deletions ethcontract-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ethcontract-derive"
version = "0.11.0"
version = "0.11.1"
authors = ["Nicholas Rodrigues Lordello <nlordell@gmail.com>"]
edition = "2018"
license = "MIT OR Apache-2.0"
Expand All @@ -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"
4 changes: 2 additions & 2 deletions ethcontract-generate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ethcontract-generate"
version = "0.11.0"
version = "0.11.1"
authors = ["Nicholas Rodrigues Lordello <nlordell@gmail.com>"]
edition = "2018"
license = "MIT OR Apache-2.0"
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions ethcontract-generate/src/contract/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ fn expand_transaction_hash(hash: Option<TransactionHash>) -> TokenStream {

let bytes = hash.as_bytes().iter().copied().map(Literal::u8_unsuffixed);
quote! {
self::ethcontract::TransactionHash([#( #bytes ),*])
Some(self::ethcontract::TransactionHash([#( #bytes ),*]))
}
}

Expand Down Expand Up @@ -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]))
},
);
}
Expand Down
6 changes: 3 additions & 3 deletions ethcontract/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ethcontract"
version = "0.11.0"
version = "0.11.1"
authors = ["Nicholas Rodrigues Lordello <nlordell@gmail.com>"]
edition = "2018"
license = "MIT OR Apache-2.0"
Expand All @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion examples/generate/build.rs
Original file line number Diff line number Diff line change
@@ -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"))
Expand Down

0 comments on commit 004a025

Please sign in to comment.