Releases: streamingfast/substreams-rs
Releases · streamingfast/substreams-rs
v0.7.6
v0.7.5
v0.7.4
Added
-
Map handlers now generate testable
__impl_<name>functions by default for easier unit testing:- The macro now generates a testable
__impl_<name>function alongside the WASM export - Use
#[substreams::handlers::map(no_testable)]to opt-out and get the legacy behavior - Supports all input types: protobuf messages,
Stringparams, store inputs (readable and writable), andDeltas
- The macro now generates a testable
-
Experimental: Added
substreams::testingmodule with utilities for unit testing handlers (only available in#[cfg(test)]builds):map!macro to conveniently call testable handler functionsclock()function to createClockinstances from string specifications for testing- Example usage:
use substreams::testing::{map, clock}; #[substreams::handlers::map] fn map_transfers(clock: Clock, blk: eth::Block) -> Result<Events, Error> { // handler logic } #[test] fn test_map_transfers() { let clock = clock("12345@1609459200000"); // block 12345 with timestamp let blk = eth::Block::default(); let result = map!(map_transfers(clock, blk)); assert!(result.is_ok()); }
Note: This module is experimental. While we aim to minimize breaking changes, we reserve the right to modify the API as needed.
-
Experimental: Added
substreams::sqemodule with a high-performance expression parser that will replaceexpr_parserin a future release:- Parsing: 5-9x faster across all expression types
- Matching: 3-14x faster with zero allocations (no more cloning on every match!)
- Repeated matching: 9-14x faster - the main use case sees the biggest wins
- Fully compatible with the existing expression syntax
- Zero-copy parsing and zero-allocation matching
- Available at
substreams::sqe::{parse, ExprMatcher, expr_matcher, matches_keys_in_parsed_expr}
v0.7.3
Added
- Added
PartialEqandPartialOrdtrait implementations for cross-type comparisons:- For
BigDecimal:PartialEq<bigdecimal::BigDecimal>andPartialOrd<bigdecimal::BigDecimal>- Compare with the underlying wrapped type- Reverse implementations allowing
bigdecimal::BigDecimalto compare withBigDecimal PartialEqandPartialOrdfor all primitive integer types (i8,i16,i32,i64,i128,isize,u8,u16,u32,u64,u128,usize)
- For
BigInt:PartialEq<num_bigint::BigInt>andPartialOrd<num_bigint::BigInt>- Compare with the underlying wrapped type- Reverse implementations allowing
num_bigint::BigIntto compare withBigInt PartialEqandPartialOrdfor all primitive integer types (i8,i16,i32,i64,i128,isize,u8,u16,u32,u64,u128,usize)
- Example usage:
let a = BigInt::from(100); assert!(a > 50i32); assert!(a < 150u64); assert!(50isize < a); let b = BigDecimal::from(100); assert!(b > 50i32); assert!(150u64 > b);
- For
Changed
- Optimized
BigInt::to_decimalto use a pre-computed lookup table for powers of 10 (decimals 0-18), avoiding repeatedBigDecimalallocations for common token decimal values like ETH (18 decimals).
v0.7.2
Added
- Added
Neg(unary-) trait implementations forBigDecimal,&BigDecimal,BigInt, and&BigInt, enabling negation operations.- For
BigDecimal:impl Neg for BigDecimal- Consumes the value and returns its negationimpl Neg for &BigDecimal- Works with borrowed references without consuming the original value
- For
BigInt:impl Neg for BigInt- Consumes the value and returns its negationimpl Neg for &BigInt- Works with borrowed references without consuming the original value
- Example usage:
let positive = BigInt::from(42); let negative = -positive; // BigInt(-42) let value = BigDecimal::from(100); let negated = -&value; // BigDecimal(-100), value is still available
- For
v0.7.1
Changed
- Bumped minimum Rust version to 1.83.
Added
- Added
AddAssign(+=) andSubAssign(-=) trait implementations forBigDecimalandBigInt, enabling in-place mutation operations.- For
BigDecimal:AddAssignandSubAssignforBigDecimal,&BigDecimal, andBigInt- Specialized implementations for all primitive integer types (
i8,i16,i32,i64,i128,isize,u8,u16,u32,u64,u128,usize)
- For
BigInt:AddAssignandSubAssignforBigIntand&BigInt- Specialized implementations for all primitive integer types
- Example usage:
let mut balance = BigDecimal::from(100); balance += 50; // Primitive integers balance -= BigInt::from(25); // BigInt values let mut count = BigInt::from(1000); count += 100; // Works for BigInt too count -= BigInt::from(50);
- For
v0.7.0
v0.6.4
- Updated foundational store protobuf definitions:
GetResponse: Renamedresponsefield tocode, addedblock_reachedfield (tag 3)GetAllResponse: Addedblock_reachedfieldGetAllRequest: Removedomit_deletedfieldGetRequest: Removedomit_deletedfield