diff --git a/core/block_validator_test.go b/core/block_validator_test.go index ac308640f..82509eb72 100644 --- a/core/block_validator_test.go +++ b/core/block_validator_test.go @@ -25,7 +25,6 @@ import ( "github.com/ethereumproject/go-ethereum/common" "github.com/ethereumproject/go-ethereum/core/state" "github.com/ethereumproject/go-ethereum/core/types" - "github.com/ethereumproject/go-ethereum/core/vm" "github.com/ethereumproject/go-ethereum/ethdb" "github.com/ethereumproject/go-ethereum/event" ) @@ -137,7 +136,7 @@ func TestPutReceipt(t *testing.T) { hash[0] = 2 receipt := new(types.Receipt) - receipt.Logs = vm.Logs{&vm.Log{ + receipt.Logs = state.Logs{&state.Log{ Address: addr, Topics: []common.Hash{hash}, Data: []byte("hi"), diff --git a/core/blockchain_test.go b/core/blockchain_test.go index ceb739471..be5abc80b 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -30,7 +30,6 @@ import ( "github.com/ethereumproject/go-ethereum/common" "github.com/ethereumproject/go-ethereum/core/state" "github.com/ethereumproject/go-ethereum/core/types" - "github.com/ethereumproject/go-ethereum/core/vm" "github.com/ethereumproject/go-ethereum/crypto" "github.com/ethereumproject/go-ethereum/ethdb" "github.com/ethereumproject/go-ethereum/event" @@ -448,7 +447,7 @@ func (bproc) ValidateHeader(*types.Header, *types.Header, bool) error { return n func (bproc) ValidateState(block, parent *types.Block, state *state.StateDB, receipts types.Receipts, usedGas *big.Int) error { return nil } -func (bproc) Process(block *types.Block, statedb *state.StateDB) (types.Receipts, vm.Logs, *big.Int, error) { +func (bproc) Process(block *types.Block, statedb *state.StateDB) (types.Receipts, state.Logs, *big.Int, error) { return nil, nil, nil, nil } diff --git a/core/database_util_test.go b/core/database_util_test.go index a98a81173..6a7db409c 100644 --- a/core/database_util_test.go +++ b/core/database_util_test.go @@ -28,7 +28,7 @@ import ( "github.com/ethereumproject/go-ethereum/common" "github.com/ethereumproject/go-ethereum/core/types" - "github.com/ethereumproject/go-ethereum/core/vm" + "github.com/ethereumproject/go-ethereum/core/state" "github.com/ethereumproject/go-ethereum/crypto" "github.com/ethereumproject/go-ethereum/crypto/sha3" "github.com/ethereumproject/go-ethereum/ethdb" @@ -412,9 +412,9 @@ func TestReceiptStorage(t *testing.T) { receipt1 := &types.Receipt{ PostState: []byte{0x01}, CumulativeGasUsed: big.NewInt(1), - Logs: vm.Logs{ - &vm.Log{Address: common.BytesToAddress([]byte{0x11})}, - &vm.Log{Address: common.BytesToAddress([]byte{0x01, 0x11})}, + Logs: state.Logs{ + &state.Log{Address: common.BytesToAddress([]byte{0x11})}, + &state.Log{Address: common.BytesToAddress([]byte{0x01, 0x11})}, }, TxHash: common.BytesToHash([]byte{0x11, 0x11}), ContractAddress: common.BytesToAddress([]byte{0x01, 0x11, 0x11}), @@ -423,9 +423,9 @@ func TestReceiptStorage(t *testing.T) { receipt2 := &types.Receipt{ PostState: []byte{0x02}, CumulativeGasUsed: big.NewInt(2), - Logs: vm.Logs{ - &vm.Log{Address: common.BytesToAddress([]byte{0x22})}, - &vm.Log{Address: common.BytesToAddress([]byte{0x02, 0x22})}, + Logs: state.Logs{ + &state.Log{Address: common.BytesToAddress([]byte{0x22})}, + &state.Log{Address: common.BytesToAddress([]byte{0x02, 0x22})}, }, TxHash: common.BytesToHash([]byte{0x22, 0x22}), ContractAddress: common.BytesToAddress([]byte{0x02, 0x22, 0x22}), @@ -471,9 +471,9 @@ func TestBlockReceiptStorage(t *testing.T) { receipt1 := &types.Receipt{ PostState: []byte{0x01}, CumulativeGasUsed: big.NewInt(1), - Logs: vm.Logs{ - &vm.Log{Address: common.BytesToAddress([]byte{0x11})}, - &vm.Log{Address: common.BytesToAddress([]byte{0x01, 0x11})}, + Logs: state.Logs{ + &state.Log{Address: common.BytesToAddress([]byte{0x11})}, + &state.Log{Address: common.BytesToAddress([]byte{0x01, 0x11})}, }, TxHash: common.BytesToHash([]byte{0x11, 0x11}), ContractAddress: common.BytesToAddress([]byte{0x01, 0x11, 0x11}), @@ -482,9 +482,9 @@ func TestBlockReceiptStorage(t *testing.T) { receipt2 := &types.Receipt{ PostState: []byte{0x02}, CumulativeGasUsed: big.NewInt(2), - Logs: vm.Logs{ - &vm.Log{Address: common.BytesToAddress([]byte{0x22})}, - &vm.Log{Address: common.BytesToAddress([]byte{0x02, 0x22})}, + Logs: state.Logs{ + &state.Log{Address: common.BytesToAddress([]byte{0x22})}, + &state.Log{Address: common.BytesToAddress([]byte{0x02, 0x22})}, }, TxHash: common.BytesToHash([]byte{0x22, 0x22}), ContractAddress: common.BytesToAddress([]byte{0x02, 0x22, 0x22}), @@ -524,14 +524,14 @@ func TestMipmapBloom(t *testing.T) { db, _ := ethdb.NewMemDatabase() receipt1 := new(types.Receipt) - receipt1.Logs = vm.Logs{ - &vm.Log{Address: common.BytesToAddress([]byte("test"))}, - &vm.Log{Address: common.BytesToAddress([]byte("address"))}, + receipt1.Logs = state.Logs{ + &state.Log{Address: common.BytesToAddress([]byte("test"))}, + &state.Log{Address: common.BytesToAddress([]byte("address"))}, } receipt2 := new(types.Receipt) - receipt2.Logs = vm.Logs{ - &vm.Log{Address: common.BytesToAddress([]byte("test"))}, - &vm.Log{Address: common.BytesToAddress([]byte("address1"))}, + receipt2.Logs = state.Logs{ + &state.Log{Address: common.BytesToAddress([]byte("test"))}, + &state.Log{Address: common.BytesToAddress([]byte("address1"))}, } WriteMipmapBloom(db, 1, types.Receipts{receipt1}) @@ -547,14 +547,14 @@ func TestMipmapBloom(t *testing.T) { // reset db, _ = ethdb.NewMemDatabase() receipt := new(types.Receipt) - receipt.Logs = vm.Logs{ - &vm.Log{Address: common.BytesToAddress([]byte("test"))}, + receipt.Logs = state.Logs{ + &state.Log{Address: common.BytesToAddress([]byte("test"))}, } WriteMipmapBloom(db, 999, types.Receipts{receipt1}) receipt = new(types.Receipt) - receipt.Logs = vm.Logs{ - &vm.Log{Address: common.BytesToAddress([]byte("test 1"))}, + receipt.Logs = state.Logs{ + &state.Log{Address: common.BytesToAddress([]byte("test 1"))}, } WriteMipmapBloom(db, 1000, types.Receipts{receipt}) @@ -587,8 +587,8 @@ func TestMipmapChain(t *testing.T) { switch i { case 1: receipt := types.NewReceipt(nil, new(big.Int)) - receipt.Logs = vm.Logs{ - &vm.Log{ + receipt.Logs = state.Logs{ + &state.Log{ Address: addr, Topics: []common.Hash{hash1}, }, @@ -597,7 +597,7 @@ func TestMipmapChain(t *testing.T) { receipts = types.Receipts{receipt} case 1000: receipt := types.NewReceipt(nil, new(big.Int)) - receipt.Logs = vm.Logs{&vm.Log{Address: addr2}} + receipt.Logs = state.Logs{&state.Log{Address: addr2}} gen.AddUncheckedReceipt(receipt) receipts = types.Receipts{receipt} diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index efeef4ba7..8395cfd28 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -29,7 +29,6 @@ import ( "testing/quick" "github.com/ethereumproject/go-ethereum/common" - "github.com/ethereumproject/go-ethereum/core/vm" "github.com/ethereumproject/go-ethereum/ethdb" ) diff --git a/eth/backend_test.go b/eth/backend_test.go index 17f445cd6..f05dba85a 100644 --- a/eth/backend_test.go +++ b/eth/backend_test.go @@ -23,7 +23,7 @@ import ( "github.com/ethereumproject/go-ethereum/common" "github.com/ethereumproject/go-ethereum/core" "github.com/ethereumproject/go-ethereum/core/types" - "github.com/ethereumproject/go-ethereum/core/vm" + "github.com/ethereumproject/go-ethereum/core/state" "github.com/ethereumproject/go-ethereum/ethdb" ) @@ -37,12 +37,12 @@ func TestMipmapUpgrade(t *testing.T) { switch i { case 1: receipt := types.NewReceipt(nil, new(big.Int)) - receipt.Logs = vm.Logs{&vm.Log{Address: addr}} + receipt.Logs = state.Logs{&state.Log{Address: addr}} gen.AddUncheckedReceipt(receipt) receipts = types.Receipts{receipt} case 2: receipt := types.NewReceipt(nil, new(big.Int)) - receipt.Logs = vm.Logs{&vm.Log{Address: addr}} + receipt.Logs = state.Logs{&state.Log{Address: addr}} gen.AddUncheckedReceipt(receipt) receipts = types.Receipts{receipt} } diff --git a/eth/filters/filter_system_test.go b/eth/filters/filter_system_test.go index f214a43b4..c3b2a2fa2 100644 --- a/eth/filters/filter_system_test.go +++ b/eth/filters/filter_system_test.go @@ -22,7 +22,7 @@ import ( "github.com/ethereumproject/go-ethereum/core" "github.com/ethereumproject/go-ethereum/core/types" - "github.com/ethereumproject/go-ethereum/core/vm" + "github.com/ethereumproject/go-ethereum/core/state" "github.com/ethereumproject/go-ethereum/event" ) @@ -38,7 +38,7 @@ func TestCallbacks(t *testing.T) { ) blockFilter := &Filter{ - BlockCallback: func(*types.Block, vm.Logs) { + BlockCallback: func(*types.Block, state.Logs) { close(blockDone) }, } @@ -48,21 +48,21 @@ func TestCallbacks(t *testing.T) { }, } logFilter := &Filter{ - LogCallback: func(l *vm.Log, oob bool) { + LogCallback: func(l *state.Log, oob bool) { if !oob { close(logDone) } }, } removedLogFilter := &Filter{ - LogCallback: func(l *vm.Log, oob bool) { + LogCallback: func(l *state.Log, oob bool) { if oob { close(removedLogDone) } }, } pendingLogFilter := &Filter{ - LogCallback: func(*vm.Log, bool) { + LogCallback: func(*state.Log, bool) { close(pendingLogDone) }, } @@ -75,9 +75,9 @@ func TestCallbacks(t *testing.T) { mux.Post(core.ChainEvent{}) mux.Post(core.TxPreEvent{}) - mux.Post(vm.Logs{&vm.Log{}}) - mux.Post(core.RemovedLogsEvent{Logs: vm.Logs{&vm.Log{}}}) - mux.Post(core.PendingLogsEvent{Logs: vm.Logs{&vm.Log{}}}) + mux.Post(state.Logs{&state.Log{}}) + mux.Post(core.RemovedLogsEvent{Logs: state.Logs{&state.Log{}}}) + mux.Post(core.PendingLogsEvent{Logs: state.Logs{&state.Log{}}}) const dura = 5 * time.Second failTimer := time.NewTimer(dura) diff --git a/eth/filters/filter_test.go b/eth/filters/filter_test.go index c684d8df5..a9379b2f2 100644 --- a/eth/filters/filter_test.go +++ b/eth/filters/filter_test.go @@ -25,15 +25,15 @@ import ( "github.com/ethereumproject/go-ethereum/common" "github.com/ethereumproject/go-ethereum/core" "github.com/ethereumproject/go-ethereum/core/types" - "github.com/ethereumproject/go-ethereum/core/vm" + "github.com/ethereumproject/go-ethereum/core/state" "github.com/ethereumproject/go-ethereum/crypto" "github.com/ethereumproject/go-ethereum/ethdb" ) func makeReceipt(addr common.Address) *types.Receipt { receipt := types.NewReceipt(nil, new(big.Int)) - receipt.Logs = vm.Logs{ - &vm.Log{Address: addr}, + receipt.Logs = state.Logs{ + &state.Log{Address: addr}, } receipt.Bloom = types.CreateBloom(types.Receipts{receipt}) return receipt @@ -138,8 +138,8 @@ func TestFilters(t *testing.T) { switch i { case 1: receipt := types.NewReceipt(nil, new(big.Int)) - receipt.Logs = vm.Logs{ - &vm.Log{ + receipt.Logs = state.Logs{ + &state.Log{ Address: addr, Topics: []common.Hash{hash1}, }, @@ -148,8 +148,8 @@ func TestFilters(t *testing.T) { receipts = types.Receipts{receipt} case 2: receipt := types.NewReceipt(nil, new(big.Int)) - receipt.Logs = vm.Logs{ - &vm.Log{ + receipt.Logs = state.Logs{ + &state.Log{ Address: addr, Topics: []common.Hash{hash2}, }, @@ -158,8 +158,8 @@ func TestFilters(t *testing.T) { receipts = types.Receipts{receipt} case 998: receipt := types.NewReceipt(nil, new(big.Int)) - receipt.Logs = vm.Logs{ - &vm.Log{ + receipt.Logs = state.Logs{ + &state.Log{ Address: addr, Topics: []common.Hash{hash3}, }, @@ -168,8 +168,8 @@ func TestFilters(t *testing.T) { receipts = types.Receipts{receipt} case 999: receipt := types.NewReceipt(nil, new(big.Int)) - receipt.Logs = vm.Logs{ - &vm.Log{ + receipt.Logs = state.Logs{ + &state.Log{ Address: addr, Topics: []common.Hash{hash4}, },