Skip to content

Commit

Permalink
remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
JukLee0ira committed Sep 25, 2024
1 parent 005b4ee commit 54703c2
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 41 deletions.
6 changes: 0 additions & 6 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,6 @@ func NewSimulatedBackend(alloc core.GenesisAlloc) *SimulatedBackend {
return backend
}

// Close terminates the underlying blockchain's update loop.
func (b *SimulatedBackend) Close() error {
b.blockchain.Stop()
return nil
}

// Commit imports all the pending transactions as a single block and starts a
// fresh new state.
func (b *SimulatedBackend) Commit() {
Expand Down
15 changes: 0 additions & 15 deletions core/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ var (
// is higher than the balance of the user's account.
ErrInsufficientFunds = errors.New("insufficient funds for gas * price + value")

// ErrGasOverflow is returned when calculating gas usage.
ErrGasOverflow = errors.New("gas overflow")

// ErrIntrinsicGas is returned if the transaction is specified to use less gas
// than required to start the invocation.
ErrIntrinsicGas = errors.New("intrinsic gas too low")
Expand All @@ -84,16 +81,4 @@ var (

// ErrGasUintOverflow is returned when calculating gas usage.
ErrGasUintOverflow = errors.New("gas uint64 overflow")

// ErrInsufficientIntrinsicGas is returned when the gas limit speicified in transaction
// is not enought to cover intrinsic gas usage.
ErrInsufficientIntrinsicGas = errors.New("insufficient intrinsic gas")
)

type ConsensusError struct {
Reason error
}

func (ce *ConsensusError) Unwarp() error {
return ce.Reason
}
13 changes: 3 additions & 10 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,9 @@ type Message interface {
// ExecutionResult includes all output after executing given evm
// message no matter the execution itself is successful or not.
type ExecutionResult struct {
UsedGas uint64 // Total used gas but include the refunded gas
Err error // Any error encountered during the execution(listed in core/vm/errors.go)
ReturnData []byte // Returned data from evm(function result or data supplied with revert opcode)
RevertReason []byte // Reason to perform revert thrown by solidity code
}

// Unwrap returns the internal evm error which allows us for further
// analysis outside.
func (result *ExecutionResult) Unwrap() error {
return result.Err
UsedGas uint64 // Total used gas but include the refunded gas
Err error // Any error encountered during the execution(listed in core/vm/errors.go)
ReturnData []byte // Returned data from evm(function result or data supplied with revert opcode)
}

// Failed returns the indicator whether the execution is successful or not
Expand Down
7 changes: 0 additions & 7 deletions core/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,15 @@
package vm

import (
"math/big"
"sync/atomic"

"github.com/XinFinOrg/XDPoSChain/common"
"github.com/XinFinOrg/XDPoSChain/common/math"
"github.com/XinFinOrg/XDPoSChain/core/types"
"github.com/XinFinOrg/XDPoSChain/params"
"github.com/holiman/uint256"
"golang.org/x/crypto/sha3"
)

var (
bigZero = new(big.Int)
tt255 = math.BigPow(2, 255)
)

func opAdd(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
x, y := scope.Stack.pop(), scope.Stack.peek()
y.Add(&x, y)
Expand Down
3 changes: 0 additions & 3 deletions core/vm/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package vm

import (
"encoding/hex"
"errors"
"fmt"
"io"
"math/big"
Expand All @@ -33,8 +32,6 @@ import (
"github.com/holiman/uint256"
)

var errTraceLimitReached = errors.New("the number of logs reached the specified limit")

// Storage represents a contract's storage.
type Storage map[common.Hash]common.Hash

Expand Down

0 comments on commit 54703c2

Please sign in to comment.