fix CI errors
Some checks failed
Test the stack. / Run unit tests (pull_request) Failing after 4m18s
Test the stack. / Run integration tests (pull_request) Failing after 9m18s

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

View File

@ -131,7 +131,6 @@ var _ = BeforeSuite(func() {
backend, err := eth.NewEthBackend(db, &eth.Config{ backend, err := eth.NewEthBackend(db, &eth.Config{
ChainConfig: chainConfig, ChainConfig: chainConfig,
VMConfig: vm.Config{}, VMConfig: vm.Config{},
RPCGasCap: big.NewInt(10000000000), // Max gas capacity for a rpc call.
GroupCacheConfig: &shared.GroupCacheConfig{ GroupCacheConfig: &shared.GroupCacheConfig{
StateDB: shared.GroupConfig{ StateDB: shared.GroupConfig{
Name: "eth_debug_test", Name: "eth_debug_test",

View File

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