All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
-
Fixed generating
Event
andFunction
structs where the ABI has a tuple with more than 12 fields.The
Event
andFunction
structs in those situations will now render withoutDebug
norPartialEq
support to allows for Rust to compile properly.
- Fixed ABI generation, ambiguous 'as_ref' implementation when using alloy-primitive crate.
- Bumped dependencies to
substreams
to 0.6 andprost
to 0.13 (see Upgrade notes)
-
Fixed AbiGen when in presence of functions that was has leading underscores or casing differences.
This was generating multiple Rust struct with the same name leading to compilation errors. Now, those cases will be de-duped and you will end up with N Rust struct all suffixed from 1 to N, like
TotalSupply1
andTotalSupply2
. -
Fixed AbiGen generated
Event#NAME
andFunction#Name
static const in presence of multiple overloads.This was previously using the de-duped name but this was wrong as the intention was always to be the ABI's defined named.
- Re-generated the Rust Ethereum bindings with latest Firehose Ethereum Protobuf definitions.
-
Added conversion from
&pb::BigInt
tosubstreams::scalar::BigInt
. -
Added conversion from
&pb::BigInt
tosubstreams::scalar::BigDecimal
.
- Re-generated the Rust Ethereum bindings with latest Firehose Ethereum Protobuf definitions.
- Fixed generated ABI code and decoding when dealing with indexed dynamic event like
event ContractDeployed(string indexed value)
. We introducedsubstreams_ethereum::IndexedDynamicValue<T>
to hold the hash value which is equivalent to topic.
- Fix bug where Int was not encoded properly in ABI generator
- Blocks with
DetailLevel
set toBase
now have transaction receipt information. Transaction successfulness is now supported.
- Update
block_view
with updated ethereum block athttps://github.com/streamingfast/firehose-ethereum/releases/download/v2.0.0/ethereum-v1.1.0.spkg
with added fieldDetailLevel
IMPORTANT:: Using blocks with
DetailLevel
set toExtended
(the default level),block.transactions()
returns only successful transactions. Blocks withDetailLevel
set toBase
does not have information about transaction successfulness. Note that a failed transaction will never have logs attached to it.
- Generate ABI from bytes with method
from_bytes
ofAbigen
Example usage:
Abigen::from_bytes("Contract", content_bytes))?
.generate()?
.write_to_file("src/abi/contract.rs")?;
- Fixed ABI code generator generating invalid code
encode
code when a function has a parameter of typetuple
.
-
Added
timestamp
onBlock
type, returns a reference to the header's timestamp. -
Re-generated Protobuf
Block
type using latestfirehose-ethereum
source, this brings in some missingBalanceChange#Reason
enum values.
-
Added
parent
onCallView
to retrieve the parent call of the currentCall
pointed to byCallView
-
Added
logs_with_calls
onTransactionTrace
which iterates over the logs of the transaction (excluding those from call that were reverted) and yields each log as a tuple(&Log, CallView)
.
-
Fixed encoding of function when dealing with a
bool
referenced as a sub type (like in a function that acceptsbool[]
). -
Added support for tuple in event in ABI generated code.
-
Fixed wrong handling of
FixedArray
when the array element's type is dynamic itself in ABI generated code.
- Re-exporting
block_view
fromsubstreams-ethereum-core
- Fixed bug in ABI generation where
uint
was not properly handled
- Bump
substreams
crate - Changing
into()
call when converting toBigInt
in abi to call the propersigned
orunsigned
encoding - Adding
into()
method fromBigInt
to useunsigned_bytes_be
- Bump
substreams
crate
- Replacing
EthBigInt
andethabi::Uint
to only usesubstreams-rs
scalarBigInt
struct.
-
Made Windows target(s) able to run tests when depending on
substreams-ethereum
crate. -
Adding
allow
attribute(s) to remove warnings for code generated by ABI generator (should be good now).
-
Bump
substreams
to 0.3.0. -
Adding
allow
attribute(s) to remove warnings for code generated by ABI generator.
- Bump
substreams
.
-
Fixed decoding of event where some indexed fields were
intN
(int8
toint256
by increment of 8). -
Fixed decoding of event where some unindexed fields were fixed array with sub element being dynamic types (
bytes[2]
). -
Fixed decoding of event where some unindexed fields were fixed bytes (
bytes8
tobytes32
). -
Added RPC batching functionality and the RPCDecodable trait to allow decoding of RPC responses.
- Breaking change
- Replaced
num_bigint
withEthBigInt
andBigInt
fromsubstreams-rs
crate
- Replaced
- Fixed issue when type of field was Vec of Uint and the underlying passed in value wasn't cloned. The clone only occurs when it is a Vec and not when the type is only a Uint.
- Fixed issue with dependency with api generation. Semver reference for proper way of importing dependencies.
- Adding ABI function generation first draft
- Adding tests for decoding of different value types
-
Breaking Replaced
substreams-ethereum/pb::eth::v1
tosubstreams-ethereum/pb::eth::v2
(perform a global replace of any references ofsubstreams-ethereum/pb::eth::v1
tosubstreams-ethereum/pb::eth::v2
and don't forget to re-generate ABI bindings also which depends onsubstreams-ethereum/pb::eth::v1
). -
Breaking
substreams-ethereum/pb::eth::rpc::RpcCall#method_signature
is now nameddata
. -
Breaking Bumped
prost
to^0.11.0
(will requires you to bumpsubstreams = "~0.0.19"
). -
Breaking Removed
must_decode
on ABI generated Event code. Instead, useif let Some(event) = <EventType>::match_and_decode(&log)
. For example, if you had the following code:if !abi::erc721::events::Transfer::match_log(log) { return None; } let transfer = abi::erc721::events::Transfer::must_decode(log);
Replace it with
if let Some(transfer) = abi::erc721::events::Transfer::match_and_decode(log) { // Do something }
- Fixed packaging issue.
Skipped
0.1.8
by mistake
- Bumped
substreams
version to0.0.17
- Bump versions in release and bump substreams create dependency
- Adding helper functions for block handling (transactions, receipts and logs)
- Rework of crate structure
- Fix bug where underlying
ethabi
library was incorrectly decoding anint24
to an un-overflowing value. This resulted in always having a positive number. Switching to usingBigInt
, proper overflowing of int24 value makes it that we can have negative values. - Changed crate structure to separate
substreams-ethereum-core
fromsubstreams-ethereum
. - Added helpers to
pb::Block
andpb::TransactionTrace
to facilitate iterating over events. - Removed
Event::must_decode
, use the newEvent::match_and_decode
instead.
- Fixed bug when an ABI has multiple times the same Event's name but with a different signature.
-
Fixed
bytes
usage in Abigen (was generatingaddress
type). -
Fixed bug on Abigen when event contains unindexed/indexed fields on certain ordering of them.
-
Improved generated code for ABI generator for events to
Self
wherever possible.
-
Bumped to Substreams 0.0.11.
-
substreams::init
is now always defined and the actualgetrandom
custom registration is conditional based on the platform you compile to. This will enable nonwasm32-unknown-unknown
target to compile which is required for unit testing
- Nothing
-
Added codegen API for ABI bindings that can be used instead of the macro for those who prefer that.
-
Added ABI bindings macro
use_contract
(restricted to Events for now). -
Added
NULL_ADDRESS
constant that can be re-used by dependent projects. -
StreamingFast Firehose Block generated Rust code is now included in this library directly.