forked from EscrowNet/escrownet-graph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
20 lines (17 loc) · 684 Bytes
/
Copy pathbuild.rs
File metadata and controls
20 lines (17 loc) · 684 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use cainome::rs::Abigen;
use std::collections::HashMap;
fn main() {
// Aliases added from the ABI
let mut aliases = HashMap::new();
aliases.insert(
String::from("escrownet_contract::escrow::escrow_factory::EscrowFactory::Event"),
String::from("EscrowFactoryEvent"),
);
let escrow_abigen =
Abigen::new("escrow", "./abi/escrow_contract.abi.json").with_types_aliases(aliases).with_derives(vec!["serde::Serialize".to_string(), "serde::Deserialize".to_string()]);
escrow_abigen
.generate()
.expect("Fail to generate bindings")
.write_to_file("./src/abi/escrow_contract.rs")
.unwrap();
}