Skip to content

Commit

Permalink
fix test block
Browse files Browse the repository at this point in the history
  • Loading branch information
billettc committed Jul 4, 2024
1 parent e96ed9a commit f15a004
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions cmd/firestarknet/testblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ func testBlock(ctx context.Context, logger *zap.Logger, tracer logging.Tracer, a
if err != nil {
return fmt.Errorf("fetching rpc block: %w", err)
}
jqOgBlock, err := jq(`
del(

jqQueries = []string{
`del(
.status,
.transactions[].invoke_transaction_v0.type,
.transactions[].invoke_transaction_v1.type,
Expand All @@ -139,7 +140,11 @@ func testBlock(ctx context.Context, logger *zap.Logger, tracer logging.Tracer, a
.transactions[].deploy_account_transaction_v1.type,
.transactions[].deploy_account_transaction_v3.type,
.transactions[].receipt.finality_status
)`, ogBlockData)
)`,
`(.. | select(type == "null")) |= ""`,
}

jqOgBlock, err := jqs(jqQueries, ogBlockData)
if err != nil {
return fmt.Errorf("jqing og block: %w", err)
}
Expand Down Expand Up @@ -181,7 +186,10 @@ func testBlock(ctx context.Context, logger *zap.Logger, tracer logging.Tracer, a
return fmt.Errorf("fetching state update: %w", err)
}

jqOgStateUpdate, err := jqs([]string{`del(.block_hash)`}, ogStateUpdate)
jqOgStateUpdate, err := jqs([]string{
`del(.block_hash)`,
`(.. | select(type == "null")) |= ""`,
}, ogStateUpdate)

ogStateUpdatePretty, err := pretty(jqOgStateUpdate)
if err != nil {
Expand Down

0 comments on commit f15a004

Please sign in to comment.