Skip to content

Commit

Permalink
eth, internal, light: fix error string capitalization (#25364)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbadoy authored Jul 25, 2022
1 parent 39900be commit d2247d9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion eth/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,5 +582,5 @@ func (api *DebugAPI) GetAccessibleState(from, to rpc.BlockNumber) (uint64, error
return uint64(i), nil
}
}
return 0, fmt.Errorf("No state found")
return 0, fmt.Errorf("no state found")
}
8 changes: 4 additions & 4 deletions eth/tracers/js/goja.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,10 @@ func (mo *memoryObj) slice(begin, end int64) ([]byte, error) {
return []byte{}, nil
}
if end < begin || begin < 0 {
return nil, fmt.Errorf("Tracer accessed out of bound memory: offset %d, end %d", begin, end)
return nil, fmt.Errorf("tracer accessed out of bound memory: offset %d, end %d", begin, end)
}
if mo.memory.Len() < int(end) {
return nil, fmt.Errorf("Tracer accessed out of bound memory: available %d, offset %d, size %d", mo.memory.Len(), begin, end-begin)
return nil, fmt.Errorf("tracer accessed out of bound memory: available %d, offset %d, size %d", mo.memory.Len(), begin, end-begin)
}
return mo.memory.GetCopy(begin, end-begin), nil
}
Expand All @@ -573,7 +573,7 @@ func (mo *memoryObj) GetUint(addr int64) goja.Value {
// getUint returns the 32 bytes at the specified address interpreted as a uint.
func (mo *memoryObj) getUint(addr int64) (*big.Int, error) {
if mo.memory.Len() < int(addr)+32 || addr < 0 {
return nil, fmt.Errorf("Tracer accessed out of bound memory: available %d, offset %d, size %d", mo.memory.Len(), addr, 32)
return nil, fmt.Errorf("tracer accessed out of bound memory: available %d, offset %d, size %d", mo.memory.Len(), addr, 32)
}
return new(big.Int).SetBytes(mo.memory.GetPtr(addr, 32)), nil
}
Expand Down Expand Up @@ -613,7 +613,7 @@ func (s *stackObj) Peek(idx int) goja.Value {
// peek returns the nth-from-the-top element of the stack.
func (s *stackObj) peek(idx int) (*big.Int, error) {
if len(s.stack.Data()) <= idx || idx < 0 {
return nil, fmt.Errorf("Tracer accessed out of bound stack: size %d, index %d", len(s.stack.Data()), idx)
return nil, fmt.Errorf("tracer accessed out of bound stack: size %d, index %d", len(s.stack.Data()), idx)
}
return s.stack.Back(idx).ToBig(), nil
}
Expand Down
4 changes: 2 additions & 2 deletions internal/jsre/jsre.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,11 @@ func (re *JSRE) loadScript(call Call) (goja.Value, error) {
file = common.AbsolutePath(re.assetPath, file)
source, err := os.ReadFile(file)
if err != nil {
return nil, fmt.Errorf("Could not read file %s: %v", file, err)
return nil, fmt.Errorf("could not read file %s: %v", file, err)
}
value, err := compileAndRun(re.vm, file, string(source))
if err != nil {
return nil, fmt.Errorf("Error while compiling or running script: %v", err)
return nil, fmt.Errorf("error while compiling or running script: %v", err)
}
return value, nil
}
Expand Down
2 changes: 1 addition & 1 deletion light/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ func (pool *TxPool) add(ctx context.Context, tx *types.Transaction) error {
hash := tx.Hash()

if pool.pending[hash] != nil {
return fmt.Errorf("Known transaction (%x)", hash[:4])
return fmt.Errorf("known transaction (%x)", hash[:4])
}
err := pool.validateTx(ctx, tx)
if err != nil {
Expand Down

0 comments on commit d2247d9

Please sign in to comment.