From c53430e1a9102938406528654272991163c5746b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Duchesneau?= Date: Fri, 20 Dec 2024 09:07:12 -0500 Subject: [PATCH] fix abigen used with alloy-primitives, bump to 0.10.1 --- CHANGELOG.md | 4 ++++ Cargo.toml | 10 +++++----- abigen-tests/src/abi/tests.rs | 36 +++++++++++++++++------------------ abigen/src/event.rs | 10 +++++----- 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72974ee..f756a78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/Cargo.toml b/Cargo.toml index 9131949..dd132fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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/" @@ -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 diff --git a/abigen-tests/src/abi/tests.rs b/abigen-tests/src/abi/tests.rs index 399c287..7d4338d 100644 --- a/abigen-tests/src/abi/tests.rs +++ b/abigen-tests/src/abi/tests.rs @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( diff --git a/abigen/src/event.rs b/abigen/src/event.rs index 146ff2b..45651e6 100644 --- a/abigen/src/event.rs +++ b/abigen/src/event.rs @@ -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; } @@ -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( @@ -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( @@ -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( @@ -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(