|
|
@ -35,17 +35,17 @@ var newTestHasher = blocktest.NewHasher |
|
|
|
func TestLookupStorage(t *testing.T) { |
|
|
|
func TestLookupStorage(t *testing.T) { |
|
|
|
tests := []struct { |
|
|
|
tests := []struct { |
|
|
|
name string |
|
|
|
name string |
|
|
|
writeTxLookupEntriesByBlock func(ethdb.Writer, *types.Block) |
|
|
|
writeTxLookupEntriesByBlock func(ethdb.KeyValueWriter, *types.Block) |
|
|
|
}{ |
|
|
|
}{ |
|
|
|
{ |
|
|
|
{ |
|
|
|
"DatabaseV6", |
|
|
|
"DatabaseV6", |
|
|
|
func(db ethdb.Writer, block *types.Block) { |
|
|
|
func(db ethdb.KeyValueWriter, block *types.Block) { |
|
|
|
WriteTxLookupEntriesByBlock(db, block) |
|
|
|
WriteTxLookupEntriesByBlock(db, block) |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
"DatabaseV4-V5", |
|
|
|
"DatabaseV4-V5", |
|
|
|
func(db ethdb.Writer, block *types.Block) { |
|
|
|
func(db ethdb.KeyValueWriter, block *types.Block) { |
|
|
|
for _, tx := range block.Transactions() { |
|
|
|
for _, tx := range block.Transactions() { |
|
|
|
db.Put(txLookupKey(tx.Hash()), block.Hash().Bytes()) |
|
|
|
db.Put(txLookupKey(tx.Hash()), block.Hash().Bytes()) |
|
|
|
} |
|
|
|
} |
|
|
@ -53,7 +53,7 @@ func TestLookupStorage(t *testing.T) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
"DatabaseV3", |
|
|
|
"DatabaseV3", |
|
|
|
func(db ethdb.Writer, block *types.Block) { |
|
|
|
func(db ethdb.KeyValueWriter, block *types.Block) { |
|
|
|
for index, tx := range block.Transactions() { |
|
|
|
for index, tx := range block.Transactions() { |
|
|
|
entry := LegacyTxLookupEntry{ |
|
|
|
entry := LegacyTxLookupEntry{ |
|
|
|
BlockHash: block.Hash(), |
|
|
|
BlockHash: block.Hash(), |
|
|
|