diff options
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} |