Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
add current serde version to binding dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Autoparallel committed Sep 19, 2023
1 parent c702e6c commit a65abb5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ethers-contract/ethers-contract-abigen/src/multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,12 @@ impl MultiExpansionResult {
None
};

MultiBindingsInner { root, bindings, shared_types }
MultiBindingsInner {
root,
bindings,
shared_types,
dependencies: vec![String::from(r#"serde = "1.0.188""#)],
}
}
}

Expand Down Expand Up @@ -581,6 +586,8 @@ struct MultiBindingsInner {
bindings: BTreeMap<String, ContractBindings>,
/// contains the content of the shared types if any
shared_types: Option<ContractBindings>,
/// Dependencies other than `ethers-rs` to add to the `Cargo.toml` for bindings generated as a crate.
dependencies: Vec<String>,
}

// deref allows for inspection without modification
Expand Down Expand Up @@ -611,6 +618,9 @@ impl MultiBindingsInner {
writeln!(toml)?;
writeln!(toml, "[dependencies]")?;
writeln!(toml, r#"{crate_version}"#)?;
for dependency in self.dependencies.clone() {
writeln!(toml, "{}", dependency)?;
}
Ok(toml)
}

Expand Down

0 comments on commit a65abb5

Please sign in to comment.