Skip to content

Commit

Permalink
core/vm: clean up some dead functions (ethereum#24851)
Browse files Browse the repository at this point in the history
  • Loading branch information
s7v7nislands authored and gzliudan committed Mar 1, 2024
1 parent b022ba2 commit ac35f0e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 34 deletions.
2 changes: 1 addition & 1 deletion core/vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,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
Expand Down
19 changes: 1 addition & 18 deletions core/vm/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
package vm

import (
"fmt"

"github.com/holiman/uint256"
)

Expand Down Expand Up @@ -68,7 +66,7 @@ func (m *Memory) Resize(size uint64) {
}
}

// Get returns offset + size as a new slice
// GetCopy returns offset + size as a new slice
func (m *Memory) GetCopy(offset, size int64) (cpy []byte) {
if size == 0 {
return nil
Expand Down Expand Up @@ -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("####################")
}
15 changes: 0 additions & 15 deletions core/vm/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
package vm

import (
"fmt"

"github.com/holiman/uint256"
)

Expand Down Expand Up @@ -69,16 +67,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 %v\n", i, val)
}
} else {
fmt.Println("-- empty --")
}
fmt.Println("#############")
}

0 comments on commit ac35f0e

Please sign in to comment.