diff options
author | Felix Lange <fjl@twurst.com> | 2017-01-05 21:03:50 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2017-01-06 21:15:22 +0800 |
commit | 7731061903bb992f7630ab389863951efb360258 (patch) | |
tree | ea706da87ce002a631cba30b171cb44dbdd7c2c6 /core/database_util_test.go | |
parent | b9683d3748dcb73ab5a5474334eaf157267d9c4a (diff) | |
download | go-tangerine-7731061903bb992f7630ab389863951efb360258.tar go-tangerine-7731061903bb992f7630ab389863951efb360258.tar.gz go-tangerine-7731061903bb992f7630ab389863951efb360258.tar.bz2 go-tangerine-7731061903bb992f7630ab389863951efb360258.tar.lz go-tangerine-7731061903bb992f7630ab389863951efb360258.tar.xz go-tangerine-7731061903bb992f7630ab389863951efb360258.tar.zst go-tangerine-7731061903bb992f7630ab389863951efb360258.zip |
core/vm: move Log to core/types
This significantly reduces the dependency closure of ethclient, which no
longer depends on core/vm as of this change.
All uses of vm.Logs are replaced by []*types.Log. NewLog is gone too,
the constructor simply returned a literal.
Diffstat (limited to 'core/database_util_test.go')
-rw-r--r-- | core/database_util_test.go | 54 |
1 files changed, 24 insertions, 30 deletions
diff --git a/core/database_util_test.go b/core/database_util_test.go index 83750aa60..c8fd857ea 100644 --- a/core/database_util_test.go +++ b/core/database_util_test.go @@ -26,7 +26,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/sha3" "github.com/ethereum/go-ethereum/ethdb" @@ -393,9 +392,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: []*types.Log{ + {Address: common.BytesToAddress([]byte{0x11})}, + {Address: common.BytesToAddress([]byte{0x01, 0x11})}, }, TxHash: common.BytesToHash([]byte{0x11, 0x11}), ContractAddress: common.BytesToAddress([]byte{0x01, 0x11, 0x11}), @@ -404,9 +403,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: []*types.Log{ + {Address: common.BytesToAddress([]byte{0x22})}, + {Address: common.BytesToAddress([]byte{0x02, 0x22})}, }, TxHash: common.BytesToHash([]byte{0x22, 0x22}), ContractAddress: common.BytesToAddress([]byte{0x02, 0x22, 0x22}), @@ -452,9 +451,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: []*types.Log{ + {Address: common.BytesToAddress([]byte{0x11})}, + {Address: common.BytesToAddress([]byte{0x01, 0x11})}, }, TxHash: common.BytesToHash([]byte{0x11, 0x11}), ContractAddress: common.BytesToAddress([]byte{0x01, 0x11, 0x11}), @@ -463,9 +462,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: []*types.Log{ + {Address: common.BytesToAddress([]byte{0x22})}, + {Address: common.BytesToAddress([]byte{0x02, 0x22})}, }, TxHash: common.BytesToHash([]byte{0x22, 0x22}), ContractAddress: common.BytesToAddress([]byte{0x02, 0x22, 0x22}), @@ -505,14 +504,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 = []*types.Log{ + {Address: common.BytesToAddress([]byte("test"))}, + {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 = []*types.Log{ + {Address: common.BytesToAddress([]byte("test"))}, + {Address: common.BytesToAddress([]byte("address1"))}, } WriteMipmapBloom(db, 1, types.Receipts{receipt1}) @@ -528,14 +527,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 = []*types.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 = []*types.Log{ + {Address: common.BytesToAddress([]byte("test 1"))}, } WriteMipmapBloom(db, 1000, types.Receipts{receipt}) @@ -568,17 +567,12 @@ func TestMipmapChain(t *testing.T) { switch i { case 1: receipt := types.NewReceipt(nil, new(big.Int)) - receipt.Logs = vm.Logs{ - &vm.Log{ - Address: addr, - Topics: []common.Hash{hash1}, - }, - } + receipt.Logs = []*types.Log{{Address: addr, Topics: []common.Hash{hash1}}} gen.AddUncheckedReceipt(receipt) receipts = types.Receipts{receipt} case 1000: receipt := types.NewReceipt(nil, new(big.Int)) - receipt.Logs = vm.Logs{&vm.Log{Address: addr2}} + receipt.Logs = []*types.Log{{Address: addr2}} gen.AddUncheckedReceipt(receipt) receipts = types.Receipts{receipt} |