fix CI errors
Some checks failed
Test the stack. / Run integration tests (pull_request) Failing after 5m23s
Test the stack. / Run unit tests (pull_request) Failing after 8m2s

This commit is contained in:
i-norden 2023-11-08 08:19:33 -06:00
parent 877b731340
commit fbcc9664da
2 changed files with 10 additions and 3 deletions

View File

@ -144,12 +144,11 @@ var _ = BeforeSuite(func() {
Expect(err).ToNot(HaveOccurred())
tracingAPI, _ = eth.NewTracingAPI(backend, nil, eth.APIConfig{StateDiffTimeout: shared.DefaultStateDiffTimeout})
tb.teardown()
})
var _ = AfterSuite(func() {
shared.TearDownDB(db)
tb.teardown()
})
var (
@ -302,7 +301,7 @@ var _ = Describe("eth state reading tests", func() {
Expect(err).ToNot(HaveOccurred())
have, _ := json.Marshal(result)
want := tc.want
Expect(have).To(Equal(want))
Expect(string(have)).To(Equal(want))
}
}
})

View File

@ -236,9 +236,14 @@ type txTraceResult struct {
Error string `json:"error,omitempty"` // Trace failure produced by the tracer
}
var noGenesisErr = errors.New("genesis is not traceable")
// TraceBlockByNumber returns the structured logs created during the execution of
// EVM and returns them as a JSON object.
func (api *TracingAPI) TraceBlockByNumber(ctx context.Context, number rpc.BlockNumber, config *TraceConfig) ([]*txTraceResult, error) {
if number == 0 {
return nil, noGenesisErr
}
block, err := api.blockByNumber(ctx, number)
if err != nil {
return nil, err
@ -263,6 +268,9 @@ func (api *TracingAPI) TraceBlockByHash(ctx context.Context, hash common.Hash, c
if err != nil {
return nil, err
}
if block.NumberU64() == 0 {
return nil, noGenesisErr
}
trace, err := api.traceBlock(ctx, block, config)
if trace != nil && err == nil {
return trace, nil