Skip to content

Commit a04d0e5

Browse files
dbadoyjagdeep sidhu
authored and
jagdeep sidhu
committed
eth, internal, light: fix error string capitalization (ethereum#25364)
1 parent 54d6166 commit a04d0e5

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

eth/api.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -582,5 +582,5 @@ func (api *DebugAPI) GetAccessibleState(from, to rpc.BlockNumber) (uint64, error
582582
return uint64(i), nil
583583
}
584584
}
585-
return 0, fmt.Errorf("No state found")
585+
return 0, fmt.Errorf("no state found")
586586
}

eth/tracers/js/goja.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -548,10 +548,10 @@ func (mo *memoryObj) slice(begin, end int64) ([]byte, error) {
548548
return []byte{}, nil
549549
}
550550
if end < begin || begin < 0 {
551-
return nil, fmt.Errorf("Tracer accessed out of bound memory: offset %d, end %d", begin, end)
551+
return nil, fmt.Errorf("tracer accessed out of bound memory: offset %d, end %d", begin, end)
552552
}
553553
if mo.memory.Len() < int(end) {
554-
return nil, fmt.Errorf("Tracer accessed out of bound memory: available %d, offset %d, size %d", mo.memory.Len(), begin, end-begin)
554+
return nil, fmt.Errorf("tracer accessed out of bound memory: available %d, offset %d, size %d", mo.memory.Len(), begin, end-begin)
555555
}
556556
return mo.memory.GetCopy(begin, end-begin), nil
557557
}
@@ -573,7 +573,7 @@ func (mo *memoryObj) GetUint(addr int64) goja.Value {
573573
// getUint returns the 32 bytes at the specified address interpreted as a uint.
574574
func (mo *memoryObj) getUint(addr int64) (*big.Int, error) {
575575
if mo.memory.Len() < int(addr)+32 || addr < 0 {
576-
return nil, fmt.Errorf("Tracer accessed out of bound memory: available %d, offset %d, size %d", mo.memory.Len(), addr, 32)
576+
return nil, fmt.Errorf("tracer accessed out of bound memory: available %d, offset %d, size %d", mo.memory.Len(), addr, 32)
577577
}
578578
return new(big.Int).SetBytes(mo.memory.GetPtr(addr, 32)), nil
579579
}
@@ -613,7 +613,7 @@ func (s *stackObj) Peek(idx int) goja.Value {
613613
// peek returns the nth-from-the-top element of the stack.
614614
func (s *stackObj) peek(idx int) (*big.Int, error) {
615615
if len(s.stack.Data()) <= idx || idx < 0 {
616-
return nil, fmt.Errorf("Tracer accessed out of bound stack: size %d, index %d", len(s.stack.Data()), idx)
616+
return nil, fmt.Errorf("tracer accessed out of bound stack: size %d, index %d", len(s.stack.Data()), idx)
617617
}
618618
return s.stack.Back(idx).ToBig(), nil
619619
}

internal/jsre/jsre.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,11 @@ func (re *JSRE) loadScript(call Call) (goja.Value, error) {
322322
file = common.AbsolutePath(re.assetPath, file)
323323
source, err := os.ReadFile(file)
324324
if err != nil {
325-
return nil, fmt.Errorf("Could not read file %s: %v", file, err)
325+
return nil, fmt.Errorf("could not read file %s: %v", file, err)
326326
}
327327
value, err := compileAndRun(re.vm, file, string(source))
328328
if err != nil {
329-
return nil, fmt.Errorf("Error while compiling or running script: %v", err)
329+
return nil, fmt.Errorf("error while compiling or running script: %v", err)
330330
}
331331
return value, nil
332332
}

light/txpool.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ func (pool *TxPool) add(ctx context.Context, tx *types.Transaction) error {
405405
hash := tx.Hash()
406406

407407
if pool.pending[hash] != nil {
408-
return fmt.Errorf("Known transaction (%x)", hash[:4])
408+
return fmt.Errorf("known transaction (%x)", hash[:4])
409409
}
410410
err := pool.validateTx(ctx, tx)
411411
if err != nil {

0 commit comments

Comments
 (0)