eth, internal, light: fix error string capitalization (#25364)

This commit is contained in:
Seungbae.yu 2022-07-25 18:53:44 +09:00 committed by GitHub
parent 39900be087
commit d2247d9f5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -582,5 +582,5 @@ func (api *DebugAPI) GetAccessibleState(from, to rpc.BlockNumber) (uint64, error
return uint64(i), nil return uint64(i), nil
} }
} }
return 0, fmt.Errorf("No state found") return 0, fmt.Errorf("no state found")
} }

View File

@ -548,10 +548,10 @@ func (mo *memoryObj) slice(begin, end int64) ([]byte, error) {
return []byte{}, nil return []byte{}, nil
} }
if end < begin || begin < 0 { 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) { 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 return mo.memory.GetCopy(begin, end-begin), nil
} }
@ -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. // getUint returns the 32 bytes at the specified address interpreted as a uint.
func (mo *memoryObj) getUint(addr int64) (*big.Int, error) { func (mo *memoryObj) getUint(addr int64) (*big.Int, error) {
if mo.memory.Len() < int(addr)+32 || addr < 0 { 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 return new(big.Int).SetBytes(mo.memory.GetPtr(addr, 32)), nil
} }
@ -613,7 +613,7 @@ func (s *stackObj) Peek(idx int) goja.Value {
// peek returns the nth-from-the-top element of the stack. // peek returns the nth-from-the-top element of the stack.
func (s *stackObj) peek(idx int) (*big.Int, error) { func (s *stackObj) peek(idx int) (*big.Int, error) {
if len(s.stack.Data()) <= idx || idx < 0 { 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 return s.stack.Back(idx).ToBig(), nil
} }

View File

@ -322,11 +322,11 @@ func (re *JSRE) loadScript(call Call) (goja.Value, error) {
file = common.AbsolutePath(re.assetPath, file) file = common.AbsolutePath(re.assetPath, file)
source, err := os.ReadFile(file) source, err := os.ReadFile(file)
if err != nil { 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)) value, err := compileAndRun(re.vm, file, string(source))
if err != nil { 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 return value, nil
} }

View File

@ -398,7 +398,7 @@ func (pool *TxPool) add(ctx context.Context, tx *types.Transaction) error {
hash := tx.Hash() hash := tx.Hash()
if pool.pending[hash] != nil { 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) err := pool.validateTx(ctx, tx)
if err != nil { if err != nil {