mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
core/vm.go: revert lint in noop as per request
This commit is contained in:
parent
f639948c85
commit
325cb51531
1 changed files with 22 additions and 79 deletions
|
|
@ -23,105 +23,48 @@ import (
|
|||
"github.com/ethereum/go-ethereum/core/types"
|
||||
)
|
||||
|
||||
// NoopCanTransfer dummy function
|
||||
func NoopCanTransfer(db StateDB, from common.Address, balance *big.Int) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// NoopTransfer dummy function
|
||||
func NoopTransfer(db StateDB, from, to common.Address, amount *big.Int) {}
|
||||
|
||||
// NoopEVMCallContext represents the EVM's call context
|
||||
type NoopEVMCallContext struct{}
|
||||
|
||||
// Call dummy function
|
||||
func (NoopEVMCallContext) Call(caller ContractRef, addr common.Address, data []byte, gas, value *big.Int) ([]byte, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// CallCode dummy function
|
||||
func (NoopEVMCallContext) CallCode(caller ContractRef, addr common.Address, data []byte, gas, value *big.Int) ([]byte, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// Create dummy function
|
||||
func (NoopEVMCallContext) Create(caller ContractRef, data []byte, gas, value *big.Int) ([]byte, common.Address, error) {
|
||||
return nil, common.Address{}, nil
|
||||
}
|
||||
|
||||
// DelegateCall dummy function
|
||||
func (NoopEVMCallContext) DelegateCall(me ContractRef, addr common.Address, data []byte, gas *big.Int) ([]byte, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// NoopStateDB is an dummy state database
|
||||
type NoopStateDB struct{}
|
||||
|
||||
// CreateAccount dummy method
|
||||
func (NoopStateDB) CreateAccount(common.Address) {}
|
||||
|
||||
// SubBalance dummy method
|
||||
func (NoopStateDB) SubBalance(common.Address, *big.Int) {}
|
||||
|
||||
// AddBalance dummy method
|
||||
func (NoopStateDB) AddBalance(common.Address, *big.Int) {}
|
||||
|
||||
// GetBalance dummy method
|
||||
func (NoopStateDB) GetBalance(common.Address) *big.Int { return nil }
|
||||
|
||||
// GetNonce dummy method
|
||||
func (NoopStateDB) GetNonce(common.Address) uint64 { return 0 }
|
||||
|
||||
// SetNonce dummy method
|
||||
func (NoopStateDB) SetNonce(common.Address, uint64) {}
|
||||
|
||||
// GetCodeHash dummy method
|
||||
func (NoopStateDB) GetCodeHash(common.Address) common.Hash { return common.Hash{} }
|
||||
|
||||
// GetCode dummy method
|
||||
func (NoopStateDB) GetCode(common.Address) []byte { return nil }
|
||||
|
||||
// SetCode dummy method
|
||||
func (NoopStateDB) SetCode(common.Address, []byte) {}
|
||||
|
||||
// GetCodeSize dummy method
|
||||
func (NoopStateDB) GetCodeSize(common.Address) int { return 0 }
|
||||
|
||||
// AddRefund dummy method
|
||||
func (NoopStateDB) AddRefund(uint64) {}
|
||||
|
||||
// GetRefund dummy method
|
||||
func (NoopStateDB) GetRefund() uint64 { return 0 }
|
||||
|
||||
// GetState dummy method
|
||||
func (NoopStateDB) GetState(common.Address, common.Hash) common.Hash { return common.Hash{} }
|
||||
|
||||
// SetState dummy method
|
||||
func (NoopStateDB) SetState(common.Address, common.Hash, common.Hash) {}
|
||||
|
||||
// Suicide dummy method
|
||||
func (NoopStateDB) Suicide(common.Address) bool { return false }
|
||||
|
||||
// HasSuicided dummy method
|
||||
func (NoopStateDB) HasSuicided(common.Address) bool { return false }
|
||||
|
||||
// Exist dummy method
|
||||
func (NoopStateDB) Exist(common.Address) bool { return false }
|
||||
|
||||
// Empty dummy method
|
||||
func (NoopStateDB) Empty(common.Address) bool { return false }
|
||||
|
||||
// RevertToSnapshot dummy method
|
||||
func (NoopStateDB) RevertToSnapshot(int) {}
|
||||
|
||||
// Snapshot dummy method
|
||||
func (NoopStateDB) Snapshot() int { return 0 }
|
||||
|
||||
// AddLog dummy method
|
||||
func (NoopStateDB) AddLog(*types.Log) {}
|
||||
|
||||
// AddPreimage dummy method
|
||||
func (NoopStateDB) AddPreimage(common.Hash, []byte) {}
|
||||
|
||||
// ForEachStorage dummy method
|
||||
func (NoopStateDB) ForEachStorage(common.Address, func(common.Hash, common.Hash) bool) {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue