Skip to content

Commit b771657

Browse files
committed
fix: rust bindings with alloy
1 parent 0677dee commit b771657

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

Cargo-component.lock

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ wavs-cli deploy-service --data ./.docker/cli --component $(pwd)/compiled/eth_tri
123123

124124
wavs-cli add-task --input "Nashville,TN" --data ./.docker/cli --service-id <Service-ID>
125125

126-
hex_bytes=$(cast decode-abi "getData(uint64)(bytes)" `cast call 0x2bdcc0de6be1f7d2ee689a0342d76f52e8efaba3 "getData(uint64)" 1`)
126+
# Where the call address is the service manager in ./.docker/cli/deployments.json
127+
hex_bytes=$(cast decode-abi "getData(uint64)(bytes)" `cast call 0x70e0ba845a1a0f2da3359c97e0285013525ffc49 "getData(uint64)" 1`)
127128
echo `cast --to-ascii $hex_bytes`
128129
```

app/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ edition = "2021"
77

88
[dependencies]
99
bindings.workspace = true
10-
alloy.workspace = true
10+
alloy = { git = "https://github.com/alloy-rs/alloy", rev = "v0.9.2", features = ["sol-types", "contract"] }
1111
eyre = "0.6"
1212
tokio = { version = "1.19", features = ["macros", "rt-multi-thread"] }

app/src/main.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use alloy::{
2-
hex, primitives::Address, providers::{Provider, ProviderBuilder}
2+
hex,
3+
primitives::Address,
4+
providers::{Provider, ProviderBuilder},
35
};
46
use bindings::wavsservicemanager::WavsServiceManager;
57
use eyre::Result;
@@ -18,16 +20,16 @@ async fn main() -> Result<()> {
1820
println!("Block: {:?}", block);
1921

2022
// update me before running
21-
// let contract_address = "0x851356ae760d987e095750cceb3bc6014560891c".parse::<Address>()?;
22-
// let contract = WavsServiceManager::new(contract_address, provider.clone());
23+
let contract_address = "0x70e0ba845a1a0f2da3359c97e0285013525ffc49".parse::<Address>()?;
24+
let contract = WavsServiceManager::new(contract_address, provider.clone());
2325

24-
// let resp = contract.getData(1).call().await?;
26+
let resp = contract.getData(1).call().await?;
2527

26-
// let hex = resp.data;
27-
// println!("Weather Response Hex: {:?}\n", hex);
28+
let hex = resp.data;
29+
println!("Weather Response Hex: {:?}\n", hex);
2830

29-
// let ascii = to_ascii(hex.to_string().as_str())?;
30-
// println!("Weather Response ASCII: {:?}", ascii);
31+
let ascii = to_ascii(hex.to_string().as_str())?;
32+
println!("Weather Response ASCII: {:?}", ascii);
3133

3234
Ok(())
3335
}

crates/bindings/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
alloy = { git = "https://github.com/alloy-rs/alloy", rev = "v0.9.2", features = ["sol-types", "contract"] }
7+
alloy = { git = "https://github.com/alloy-rs/alloy", rev = "v0.9.2", features = ["sol-types", "contract"] }

0 commit comments

Comments
 (0)