Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
d2247d9f
Unverified
Commit
d2247d9f
authored
Jul 25, 2022
by
Seungbae.yu
Committed by
GitHub
Jul 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth, internal, light: fix error string capitalization (#25364)
parent
39900be0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
api.go
eth/api.go
+1
-1
goja.go
eth/tracers/js/goja.go
+4
-4
jsre.go
internal/jsre/jsre.go
+2
-2
txpool.go
light/txpool.go
+1
-1
No files found.
eth/api.go
View file @
d2247d9f
...
...
@@ -582,5 +582,5 @@ func (api *DebugAPI) GetAccessibleState(from, to rpc.BlockNumber) (uint64, error
return
uint64
(
i
),
nil
}
}
return
0
,
fmt
.
Errorf
(
"
N
o state found"
)
return
0
,
fmt
.
Errorf
(
"
n
o state found"
)
}
eth/tracers/js/goja.go
View file @
d2247d9f
...
...
@@ -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
(
"
T
racer accessed out of bound memory: offset %d, end %d"
,
begin
,
end
)
return
nil
,
fmt
.
Errorf
(
"
t
racer accessed out of bound memory: offset %d, end %d"
,
begin
,
end
)
}
if
mo
.
memory
.
Len
()
<
int
(
end
)
{
return
nil
,
fmt
.
Errorf
(
"
T
racer accessed out of bound memory: available %d, offset %d, size %d"
,
mo
.
memory
.
Len
(),
begin
,
end
-
begin
)
return
nil
,
fmt
.
Errorf
(
"
t
racer 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
}
...
...
@@ -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
(
"
T
racer accessed out of bound memory: available %d, offset %d, size %d"
,
mo
.
memory
.
Len
(),
addr
,
32
)
return
nil
,
fmt
.
Errorf
(
"
t
racer 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
}
...
...
@@ -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
(
"
T
racer accessed out of bound stack: size %d, index %d"
,
len
(
s
.
stack
.
Data
()),
idx
)
return
nil
,
fmt
.
Errorf
(
"
t
racer accessed out of bound stack: size %d, index %d"
,
len
(
s
.
stack
.
Data
()),
idx
)
}
return
s
.
stack
.
Back
(
idx
)
.
ToBig
(),
nil
}
...
...
internal/jsre/jsre.go
View file @
d2247d9f
...
...
@@ -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
(
"
C
ould not read file %s: %v"
,
file
,
err
)
return
nil
,
fmt
.
Errorf
(
"
c
ould not read file %s: %v"
,
file
,
err
)
}
value
,
err
:=
compileAndRun
(
re
.
vm
,
file
,
string
(
source
))
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"
E
rror while compiling or running script: %v"
,
err
)
return
nil
,
fmt
.
Errorf
(
"
e
rror while compiling or running script: %v"
,
err
)
}
return
value
,
nil
}
...
...
light/txpool.go
View file @
d2247d9f
...
...
@@ -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
(
"
K
nown transaction (%x)"
,
hash
[
:
4
])
return
fmt
.
Errorf
(
"
k
nown transaction (%x)"
,
hash
[
:
4
])
}
err
:=
pool
.
validateTx
(
ctx
,
tx
)
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment