Skip to content

Commit 3b99ffe

Browse files
joshstevens19github-actions
andauthored
Release/0.10.0 (#112)
* release/0.10.0 * Add release binaries for * fix: resolve topic_id packing issues * fix: invalid parsing for hex string * Add release binaries for * windows --------- Co-authored-by: github-actions <[email protected]>
1 parent 74bd478 commit 3b99ffe

File tree

12 files changed

+57
-20
lines changed

12 files changed

+57
-20
lines changed

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rindexer_cli"
3-
version = "0.9.0"
3+
version = "0.10.0"
44
edition = "2021"
55
resolver = "2"
66

core/src/abi.rs

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{collections::HashSet, fs, iter::Map, path::Path};
1+
use std::{collections::HashSet, fs, path::Path};
22

33
use ethers::{
44
types::{ValueOrArray, H256},
@@ -178,12 +178,33 @@ pub enum ReadAbiError {
178178

179179
impl ABIItem {
180180
pub fn format_event_signature(&self) -> Result<String, ParamTypeError> {
181-
let formatted_inputs = self
182-
.inputs
183-
.iter()
184-
.map(|component| component.format_param_type())
185-
.collect::<Result<Vec<_>, _>>()?;
186-
Ok(formatted_inputs.join(","))
181+
let name = &self.name;
182+
let params = self.inputs.iter()
183+
.map(Self::format_param_type)
184+
.collect::<Result<Vec<_>, _>>()?
185+
.join(",");
186+
187+
Ok(format!("{}({})", name, params))
188+
}
189+
190+
fn format_param_type(input: &ABIInput) -> Result<String, ParamTypeError> {
191+
let base_type = input.type_.split('[').next().unwrap_or(&input.type_);
192+
let array_suffix = input.type_.strip_prefix(base_type).unwrap_or("");
193+
194+
let type_str = match base_type {
195+
"tuple" => {
196+
let inner = input.components.as_ref()
197+
.ok_or(ParamTypeError::MissingComponents)?
198+
.iter()
199+
.map(Self::format_param_type)
200+
.collect::<Result<Vec<_>, _>>()?
201+
.join(",");
202+
format!("({})", inner)
203+
},
204+
_ => base_type.to_string(),
205+
};
206+
207+
Ok(format!("{}{}", type_str, array_suffix))
187208
}
188209

189210
pub fn extract_event_names_and_signatures_from_abi(
@@ -193,6 +214,7 @@ impl ABIItem {
193214
for item in abi_json.into_iter() {
194215
if item.type_ == "event" {
195216
let signature = item.format_event_signature()?;
217+
// println!("signature {}", signature);
196218
events.push(EventInfo::new(item, signature));
197219
}
198220
}
@@ -275,13 +297,12 @@ impl EventInfo {
275297
}
276298

277299
pub fn topic_id(&self) -> H256 {
278-
let event_signature = format!("{}({})", self.name, self.signature);
300+
let event_signature = self.signature.clone();
279301
H256::from_slice(&keccak256(event_signature))
280302
}
281303

282304
pub fn topic_id_as_hex_string(&self) -> String {
283-
let event_signature = format!("{}({})", self.name, self.signature);
284-
Map::collect(keccak256(event_signature).iter().map(|byte| format!("{:02x}", byte)))
305+
format!("{:x}", self.topic_id())
285306
}
286307

287308
pub fn struct_result(&self) -> &str {

core/src/generator/events_bindings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ fn build_pub_contract_fn(
422422
}
423423
Some(value) => match value {
424424
ValueOrArray::Value(address) => {
425-
let address = format!("{}", address);
425+
let address = format!("{:?}", address);
426426
Code::new(format!(
427427
r#"pub fn {contract_name}_contract(network: &str) -> {abi_gen_name}<Arc<Provider<RetryClient<Http>>>> {{
428428
let address: Address = "{address}".parse().expect("Invalid address");

documentation/docs/pages/docs/changelog.mdx

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,9 @@
55

66
### Features
77
-------------------------------------------------
8-
- feat: expose an insert_bulk new postgres function to make inserting bulk data easier
9-
- feat: expose new ethereum sql type wrappers for bytes types#
10-
- feat: expose postgres ToSql trait
11-
- feat: support with_transaction in postgres client
12-
- feat: get the block timestamp from the RPC call (its an option as not all providers expose it)
13-
- feat: allow you to override environment file path
148

159
### Bug fixes
1610
-------------------------------------------------
17-
- fix: dependency events not being applied to the correct contract
18-
- fix: resolve defining environment variables in contract address fields in the yaml
1911

2012
### Breaking changes
2113
-------------------------------------------------
@@ -25,6 +17,30 @@
2517

2618
all release branches are deployed through `release/VERSION_NUMBER` branches
2719

20+
## 0.10.0-beta - 15th October 2024
21+
22+
github branch - https://github.com/joshstevens19/rindexer/tree/release/0.10.0
23+
24+
- linux binary - https://rindexer.xyz/releases/linux-amd64/0.10.0/rindexer_linux-amd64.tar.gz
25+
- mac apple silicon binary - https://rindexer.xyz/releases/darwin-arm64/0.10.0/rindexer_darwin-arm64.tar.gz
26+
- mac apple intel binary - https://rindexer.xyz/releases/darwin-amd64/0.10.0/rindexer_darwin-amd64.tar.gz
27+
- windows binary - https://rindexer/releases.xyz/win32-amd64/0.10.0/rindexer_win32-amd64.zip
28+
29+
### Features
30+
-------------------------------------------------
31+
- feat: expose an insert_bulk new postgres function to make inserting bulk data easier
32+
- feat: expose new ethereum sql type wrappers for bytes types#
33+
- feat: expose postgres ToSql trait
34+
- feat: support with_transaction in postgres client
35+
- feat: get the block timestamp from the RPC call (its an option as not all providers expose it)
36+
- feat: allow you to override environment file path
37+
38+
### Bug fixes
39+
-------------------------------------------------
40+
- fix: dependency events not being applied to the correct contract
41+
- fix: resolve defining environment variables in contract address fields in the yaml
42+
- fix: resolve topic_id packing issues
43+
2844
## 0.9.0-beta - 19th September 2024
2945

3046
github branch - https://github.com/joshstevens19/rindexer/tree/release/0.9.0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)