aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/logger_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/logger_test.go')
-rw-r--r--core/vm/logger_test.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/vm/logger_test.go b/core/vm/logger_test.go
index cdbb70dc4..cba7c7a0e 100644
--- a/core/vm/logger_test.go
+++ b/core/vm/logger_test.go
@@ -21,6 +21,7 @@ import (
"testing"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/params"
)
@@ -41,9 +42,15 @@ func (d *dummyContractRef) SetBalance(*big.Int) {}
func (d *dummyContractRef) SetNonce(uint64) {}
func (d *dummyContractRef) Balance() *big.Int { return new(big.Int) }
+type dummyStatedb struct {
+ state.StateDB
+}
+
+func (dummyStatedb) GetRefund() uint64 { return 1337 }
+
func TestStoreCapture(t *testing.T) {
var (
- env = NewEVM(Context{}, nil, params.TestChainConfig, Config{})
+ env = NewEVM(Context{}, &dummyStatedb{}, params.TestChainConfig, Config{})
logger = NewStructLogger(nil)
mem = NewMemory()
stack = newstack()
@@ -51,9 +58,7 @@ func TestStoreCapture(t *testing.T) {
)
stack.push(big.NewInt(1))
stack.push(big.NewInt(0))
-
var index common.Hash
-
logger.CaptureState(env, 0, SSTORE, 0, 0, mem, stack, contract, 0, nil)
if len(logger.changedValues[contract.Address()]) == 0 {
t.Fatalf("expected exactly 1 changed value on address %x, got %d", contract.Address(), len(logger.changedValues[contract.Address()]))