diff --git a/core/vm/noop.go b/core/vm/noop.go index 9e95352686..b71ead0d77 100644 --- a/core/vm/noop.go +++ b/core/vm/noop.go @@ -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) CreateAccount(common.Address) {} +func (NoopStateDB) SubBalance(common.Address, *big.Int) {} +func (NoopStateDB) AddBalance(common.Address, *big.Int) {} +func (NoopStateDB) GetBalance(common.Address) *big.Int { return nil } +func (NoopStateDB) GetNonce(common.Address) uint64 { return 0 } +func (NoopStateDB) SetNonce(common.Address, uint64) {} +func (NoopStateDB) GetCodeHash(common.Address) common.Hash { return common.Hash{} } +func (NoopStateDB) GetCode(common.Address) []byte { return nil } +func (NoopStateDB) SetCode(common.Address, []byte) {} +func (NoopStateDB) GetCodeSize(common.Address) int { return 0 } +func (NoopStateDB) AddRefund(uint64) {} +func (NoopStateDB) GetRefund() uint64 { return 0 } +func (NoopStateDB) GetState(common.Address, common.Hash) common.Hash { return common.Hash{} } +func (NoopStateDB) SetState(common.Address, common.Hash, common.Hash) {} +func (NoopStateDB) Suicide(common.Address) bool { return false } +func (NoopStateDB) HasSuicided(common.Address) bool { return false } +func (NoopStateDB) Exist(common.Address) bool { return false } +func (NoopStateDB) Empty(common.Address) bool { return false } +func (NoopStateDB) RevertToSnapshot(int) {} +func (NoopStateDB) Snapshot() int { return 0 } +func (NoopStateDB) AddLog(*types.Log) {} +func (NoopStateDB) AddPreimage(common.Hash, []byte) {} func (NoopStateDB) ForEachStorage(common.Address, func(common.Hash, common.Hash) bool) {}