Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions eth/tracers/firehose.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ func (f *Firehose) OnBlockEnd(err error) {
} else {
f.printBlockToFirehose(f.block, f.blockFinality)
}

} else {
// An error occurred, could have happen in transaction/call context, we must not check if in trx/call, only check in block
f.ensureInBlock(0)
Expand Down Expand Up @@ -899,6 +898,7 @@ func (f *Firehose) removeLogBlockIndexOnStateRevertedCalls() {

func (f *Firehose) assignOrdinalAndIndexToReceiptLogs() {
firehoseTrace("assigning ordinal and index to logs")

defer func() {
firehoseTrace("assigning ordinal and index to logs terminated")
}()
Expand Down Expand Up @@ -2297,7 +2297,6 @@ func maxFeePerGas(tx *types.Transaction) *pbeth.BigInt {

case types.DynamicFeeTxType, types.BlobTxType, types.SetCodeTxType:
return firehoseBigIntFromNative(tx.GasFeeCap())

}

panic(errUnhandledTransactionType("maxFeePerGas", tx.Type()))
Expand All @@ -2311,7 +2310,6 @@ func maxPriorityFeePerGas(tx *types.Transaction) *pbeth.BigInt {
case types.DynamicFeeTxType, types.BlobTxType, types.SetCodeTxType:
return firehoseBigIntFromNative(tx.GasTipCap())
}

panic(errUnhandledTransactionType("maxPriorityFeePerGas", tx.Type()))
}

Expand Down
3 changes: 2 additions & 1 deletion eth/tracers/firehose_concurrency.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package tracers

import (
pbeth "github.com/streamingfast/firehose-ethereum/types/pb/sf/ethereum/type/v2"
"sync"

pbeth "github.com/streamingfast/firehose-ethereum/types/pb/sf/ethereum/type/v2"
)

type blockPrintJob struct {
Expand Down
9 changes: 4 additions & 5 deletions eth/tracers/firehose_concurrency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ package tracers
import (
"encoding/hex"
"fmt"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/params"
"github.com/stretchr/testify/require"
"regexp"
"strconv"
"strings"
"testing"

"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/params"
"github.com/stretchr/testify/require"
)

func TestFirehose_BlockPrintsToFirehose_SingleBlock(t *testing.T) {

f := NewFirehose(&FirehoseConfig{
ConcurrentBlockFlushing: 1,
ApplyBackwardCompatibility: ptr(false),
Expand Down Expand Up @@ -56,7 +56,6 @@ func TestFirehose_BlockPrintsToFirehose_SingleBlock(t *testing.T) {
}

func TestFirehose_BlocksPrintToFirehose_MultipleBlocksInOrder(t *testing.T) {

const blockCount = 100
const baseBlockNum = 0

Expand Down
9 changes: 5 additions & 4 deletions eth/tracers/firehose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ func TestFirehoseCallStack_Push(t *testing.T) {
actions []actionRunner
}{
{
"push/pop emtpy", []actionRunner{
"push/pop emtpy",
[]actionRunner{
push(&pbeth.Call{}),
pop(),
check(func(t *testing.T, s *CallStack) {
Expand All @@ -46,7 +47,8 @@ func TestFirehoseCallStack_Push(t *testing.T) {
},
},
{
"push/push/push", []actionRunner{
"push/push/push",
[]actionRunner{
push(&pbeth.Call{}),
push(&pbeth.Call{}),
push(&pbeth.Call{}),
Expand Down Expand Up @@ -193,7 +195,6 @@ func Test_FirehoseAndGethHeaderFieldMatches(t *testing.T) {
var endsWithUnknownConstant = regexp.MustCompile(`.*\(\d+\)$`)

func TestFirehose_BalanceChangeAllMappedCorrectly(t *testing.T) {

for i := 0; i <= math.MaxUint8; i++ {
tracingReason := tracing.BalanceChangeReason(i)
if tracingReason == tracing.BalanceChangeUnspecified || tracingReason == tracing.BalanceChangeRevert {
Expand Down Expand Up @@ -405,7 +406,7 @@ func TestFirehose_reorderIsolatedTransactionsAndOrdinals(t *testing.T) {
goldenPath := tt.expectedBlockFile

if !goldenUpdate && !fileExits(t, goldenPath) {
t.Fatalf("the golden file %q does not exist, re-run with 'GOLDEN_UPDATE=true go test ./... -run %q' to generate the intial version", goldenPath, t.Name())
t.Fatalf("the golden file %q does not exist, re-run with 'GOLDEN_UPDATE=true go test ./... -run %q' to generate the initial version", goldenPath, t.Name())
}

content, err := protojson.MarshalOptions{Indent: " "}.Marshal(f.block)
Expand Down
2 changes: 1 addition & 1 deletion eth/tracers/internal/tracetest/firehose/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (lines firehoseBlockLines) assertOnlyBlockEquals(t *testing.T, goldenDir st
for _, line := range lines {
goldenPath := filepath.Join(goldenDir, fmt.Sprintf("block.%d.golden.json", line.Block.Header.Number))
if !goldenUpdate && !fileExists(t, goldenPath) {
t.Fatalf("the golden file %q does not exist, re-run with 'GOLDEN_UPDATE=true go test ./... -run %q' to generate the intial version", goldenPath, t.Name())
t.Fatalf("the golden file %q does not exist, re-run with 'GOLDEN_UPDATE=true go test ./... -run %q' to generate the initial version", goldenPath, t.Name())
}

unnormalizedContent, err := protojson.MarshalOptions{Indent: " "}.Marshal(line.Block)
Expand Down