From 3a87b044e4a6f4f46f11f7b2a4150d45e15b0704 Mon Sep 17 00:00:00 2001 From: Eduard Voiculescu Date: Thu, 16 Nov 2023 17:02:11 -0500 Subject: [PATCH] update block view rust fmt, update CHANGELOG with changes to block.transactions() and preparing for release 0.9.6 --- CHANGELOG.md | 5 +++++ Cargo.toml | 10 +++++----- core/src/block_view.rs | 4 +++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3638ef..88f7813 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ 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.9.6](https://github.com/streamingfast/substreams-ethereum/releases/tag/v0.9.6) +* Update `block_view` with updated ethereum block at `https://github.com/streamingfast/firehose-ethereum/releases/download/v2.0.0/ethereum-v1.1.0.spkg` with added field `DetailLevel` +> **_IMPORTANT:_**: Using blocks with `DetailLevel` set to `Extended` (the default level), `block.transactions()` returns only successful transactions. +> Blocks with `DetailLevel` set to `Base` does not have information about transaction successfulness. Note that a failed transaction will never have logs attached to it. + ## [0.9.5](https://github.com/streamingfast/substreams-ethereum/releases/tag/v0.9.5) * Generate ABI from bytes with method `from_bytes` of `Abigen` diff --git a/Cargo.toml b/Cargo.toml index ab00bd3..df4d58c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ ] [workspace.package] -version = "0.9.5" +version = "0.9.6" 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/" @@ -20,10 +20,10 @@ categories = ["api-bindings", "external-ffi-bindings", "wasm"] rust-version = "1.60" [workspace.dependencies] -substreams-ethereum = { version = "0.9.5", path = "./substreams-ethereum" } -substreams-ethereum-abigen = { version = "0.9.5", path = "./abigen" } -substreams-ethereum-core = { version = "0.9.5", path = "./core" } -substreams-ethereum-derive = { version = "0.9.5", path = "./derive" } +substreams-ethereum = { version = "0.9.6", path = "./substreams-ethereum" } +substreams-ethereum-abigen = { version = "0.9.6", path = "./abigen" } +substreams-ethereum-core = { version = "0.9.6", path = "./core" } +substreams-ethereum-derive = { version = "0.9.6", path = "./derive" } [profile.release] lto = true diff --git a/core/src/block_view.rs b/core/src/block_view.rs index 70f914a..020fb7f 100644 --- a/core/src/block_view.rs +++ b/core/src/block_view.rs @@ -6,7 +6,9 @@ use crate::{pb::eth::v2 as pb, Event}; impl pb::Block { /// Iterates over transactions (successful in the case of DetaillevelExtended) pub fn transactions(&self) -> impl Iterator { - self.transaction_traces.iter().filter(|tx| tx.status == 1 || self.detail_level == pb::block::DetailLevel::DetaillevelBase.into()) + self.transaction_traces.iter().filter(|tx| { + tx.status == 1 || self.detail_level == pb::block::DetailLevel::DetaillevelBase.into() + }) } /// Iterates over transaction receipts of successful transactions.