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
24c590cb
Unverified
Commit
24c590cb
authored
3 years ago
by
s7v7nislands
Committed by
GitHub
3 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/vm: clean up some dead functions (#24851)
parent
8a008ee0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
34 deletions
+3
-34
contracts.go
core/vm/contracts.go
+1
-1
instructions.go
core/vm/instructions.go
+1
-1
memory.go
core/vm/memory.go
+1
-18
stack.go
core/vm/stack.go
+0
-14
No files found.
core/vm/contracts.go
View file @
24c590cb
...
...
@@ -591,7 +591,7 @@ func (c *blake2F) Run(input []byte) ([]byte, error) {
// Parse the input into the Blake2b call parameters
var
(
rounds
=
binary
.
BigEndian
.
Uint32
(
input
[
0
:
4
])
final
=
(
input
[
212
]
==
blake2FFinalBlockBytes
)
final
=
input
[
212
]
==
blake2FFinalBlockBytes
h
[
8
]
uint64
m
[
16
]
uint64
...
...
This diff is collapsed.
Click to expand it.
core/vm/instructions.go
View file @
24c590cb
...
...
@@ -478,7 +478,7 @@ func opDifficulty(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext)
}
func
opRandom
(
pc
*
uint64
,
interpreter
*
EVMInterpreter
,
scope
*
ScopeContext
)
([]
byte
,
error
)
{
v
:=
new
(
uint256
.
Int
)
.
SetBytes
(
(
interpreter
.
evm
.
Context
.
Random
.
Bytes
()
))
v
:=
new
(
uint256
.
Int
)
.
SetBytes
(
interpreter
.
evm
.
Context
.
Random
.
Bytes
(
))
scope
.
Stack
.
push
(
v
)
return
nil
,
nil
}
...
...
This diff is collapsed.
Click to expand it.
core/vm/memory.go
View file @
24c590cb
...
...
@@ -17,8 +17,6 @@
package
vm
import
(
"fmt"
"github.com/holiman/uint256"
)
...
...
@@ -68,7 +66,7 @@ func (m *Memory) Resize(size uint64) {
}
}
// Get returns offset + size as a new slice
// Get
Copy
returns offset + size as a new slice
func
(
m
*
Memory
)
GetCopy
(
offset
,
size
int64
)
(
cpy
[]
byte
)
{
if
size
==
0
{
return
nil
...
...
@@ -106,18 +104,3 @@ func (m *Memory) Len() int {
func
(
m
*
Memory
)
Data
()
[]
byte
{
return
m
.
store
}
// Print dumps the content of the memory.
func
(
m
*
Memory
)
Print
()
{
fmt
.
Printf
(
"### mem %d bytes ###
\n
"
,
len
(
m
.
store
))
if
len
(
m
.
store
)
>
0
{
addr
:=
0
for
i
:=
0
;
i
+
32
<=
len
(
m
.
store
);
i
+=
32
{
fmt
.
Printf
(
"%03d: % x
\n
"
,
addr
,
m
.
store
[
i
:
i
+
32
])
addr
++
}
}
else
{
fmt
.
Println
(
"-- empty --"
)
}
fmt
.
Println
(
"####################"
)
}
This diff is collapsed.
Click to expand it.
core/vm/stack.go
View file @
24c590cb
...
...
@@ -17,7 +17,6 @@
package
vm
import
(
"fmt"
"sync"
"github.com/holiman/uint256"
...
...
@@ -81,16 +80,3 @@ func (st *Stack) peek() *uint256.Int {
func
(
st
*
Stack
)
Back
(
n
int
)
*
uint256
.
Int
{
return
&
st
.
data
[
st
.
len
()
-
n
-
1
]
}
// Print dumps the content of the stack
func
(
st
*
Stack
)
Print
()
{
fmt
.
Println
(
"### stack ###"
)
if
len
(
st
.
data
)
>
0
{
for
i
,
val
:=
range
st
.
data
{
fmt
.
Printf
(
"%-3d %s
\n
"
,
i
,
val
.
String
())
}
}
else
{
fmt
.
Println
(
"-- empty --"
)
}
fmt
.
Println
(
"#############"
)
}
This diff is collapsed.
Click to expand it.
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