Skip to content

Commit

Permalink
fix abigen used with alloy-primitives, bump to 0.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Dec 20, 2024
1 parent 9c1f10a commit c53430e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 28 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.10.1](https://github.com/streamingfast/substreams-ethereum/releases/tag/v0.10.1)

* Fixed ABI generation, ambiguous 'as_ref' implementation when using alloy-primitive crate.

## [0.10.0](https://github.com/streamingfast/substreams-ethereum/releases/tag/v0.10.0)

* Bumped dependencies to `substreams` to 0.6 and `prost` to 0.13 (see [Upgrade notes](https://github.com/streamingfast/substreams-rs/releases/tag/v0.6.0))
Expand Down
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["abigen", "abigen-tests", "core", "derive", "substreams-ethereum"]
resolver = "2"

[workspace.package]
version = "0.10.0"
version = "0.10.1"
edition = "2021"
description = "Substreams development kit for Ethereum chains, contains Firehose Block model and helpers as well as utilities for Ethereum ABI encoding/decoding."
homepage = "https://substreams.streamingfast.io/"
Expand All @@ -15,10 +15,10 @@ categories = ["api-bindings", "external-ffi-bindings", "wasm"]
rust-version = "1.60"

[workspace.dependencies]
substreams-ethereum = { version = "0.10.0", path = "./substreams-ethereum" }
substreams-ethereum-abigen = { version = "0.10.0", path = "./abigen" }
substreams-ethereum-core = { version = "0.10.0", path = "./core" }
substreams-ethereum-derive = { version = "0.10.0", path = "./derive" }
substreams-ethereum = { version = "0.10.1", path = "./substreams-ethereum" }
substreams-ethereum-abigen = { version = "0.10.1", path = "./abigen" }
substreams-ethereum-core = { version = "0.10.1", path = "./core" }
substreams-ethereum-derive = { version = "0.10.1", path = "./derive" }

[profile.release]
lto = true
Expand Down
36 changes: 18 additions & 18 deletions abigen-tests/src/abi/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2169,7 +2169,7 @@ pub mod events {
if log.data.len() < 64usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -2264,7 +2264,7 @@ pub mod events {
if log.data.len() < 128usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -2383,7 +2383,7 @@ pub mod events {
if log.data.len() != 64usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -2511,7 +2511,7 @@ pub mod events {
if log.data.len() != 64usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -2623,7 +2623,7 @@ pub mod events {
if log.data.len() != 64usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -2733,7 +2733,7 @@ pub mod events {
if log.data.len() != 32usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -2814,7 +2814,7 @@ pub mod events {
if log.data.len() != 0usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -2882,7 +2882,7 @@ pub mod events {
if log.data.len() != 0usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -2962,7 +2962,7 @@ pub mod events {
if log.data.len() < 64usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -3044,7 +3044,7 @@ pub mod events {
if log.data.len() != 128usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -3160,7 +3160,7 @@ pub mod events {
if log.data.len() < 160usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -3246,7 +3246,7 @@ pub mod events {
if log.data.len() < 160usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -3332,7 +3332,7 @@ pub mod events {
if log.data.len() != 64usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -3420,7 +3420,7 @@ pub mod events {
if log.data.len() != 32usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -3506,7 +3506,7 @@ pub mod events {
if log.data.len() != 32usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -3585,7 +3585,7 @@ pub mod events {
if log.data.len() != 0usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -3666,7 +3666,7 @@ pub mod events {
if log.data.len() != 0usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -3746,7 +3746,7 @@ pub mod events {
if log.data.len() != 0usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down
10 changes: 5 additions & 5 deletions abigen/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl Event {

#log_match_data

return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}

Expand Down Expand Up @@ -286,7 +286,7 @@ mod tests {
if log.data.len() != 0usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -371,7 +371,7 @@ mod tests {
if log.data.len() != 0usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -485,7 +485,7 @@ mod tests {
if log.data.len() != 32usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down Expand Up @@ -628,7 +628,7 @@ mod tests {
if log.data.len() != 0usize {
return false;
}
return log.topics.get(0).expect("bounds already checked").as_ref()
return log.topics.get(0).expect("bounds already checked").as_ref() as &[u8]
== Self::TOPIC_ID;
}
pub fn decode(
Expand Down

0 comments on commit c53430e

Please sign in to comment.