|
|
@ -87,7 +87,7 @@ func TestBodyStorage(t *testing.T) { |
|
|
|
WriteBody(db, hash, 0, body) |
|
|
|
WriteBody(db, hash, 0, body) |
|
|
|
if entry := ReadBody(db, hash, 0); entry == nil { |
|
|
|
if entry := ReadBody(db, hash, 0); entry == nil { |
|
|
|
t.Fatalf("Stored body not found") |
|
|
|
t.Fatalf("Stored body not found") |
|
|
|
} else if types.DeriveSha(types.Transactions(entry.Transactions)) != types.DeriveSha(types.Transactions(body.Transactions)) || types.CalcUncleHash(entry.Uncles) != types.CalcUncleHash(body.Uncles) { |
|
|
|
} else if types.DeriveSha(types.Transactions(entry.Transactions())) != types.DeriveSha(types.Transactions(body.Transactions())) || types.CalcUncleHash(entry.Uncles()) != types.CalcUncleHash(body.Uncles()) { |
|
|
|
t.Fatalf("Retrieved body mismatch: have %v, want %v", entry, body) |
|
|
|
t.Fatalf("Retrieved body mismatch: have %v, want %v", entry, body) |
|
|
|
} |
|
|
|
} |
|
|
|
if entry := ReadBodyRLP(db, hash, 0); entry == nil { |
|
|
|
if entry := ReadBodyRLP(db, hash, 0); entry == nil { |
|
|
@ -142,7 +142,7 @@ func TestBlockStorage(t *testing.T) { |
|
|
|
} |
|
|
|
} |
|
|
|
if entry := ReadBody(db, block.Hash(), block.NumberU64()); entry == nil { |
|
|
|
if entry := ReadBody(db, block.Hash(), block.NumberU64()); entry == nil { |
|
|
|
t.Fatalf("Stored body not found") |
|
|
|
t.Fatalf("Stored body not found") |
|
|
|
} else if types.DeriveSha(types.Transactions(entry.Transactions)) != types.DeriveSha(block.Transactions()) || types.CalcUncleHash(entry.Uncles) != types.CalcUncleHash(block.Uncles()) { |
|
|
|
} else if types.DeriveSha(types.Transactions(entry.Transactions())) != types.DeriveSha(block.Transactions()) || types.CalcUncleHash(entry.Uncles()) != types.CalcUncleHash(block.Uncles()) { |
|
|
|
t.Fatalf("Retrieved body mismatch: have %v, want %v", entry, block.Body()) |
|
|
|
t.Fatalf("Retrieved body mismatch: have %v, want %v", entry, block.Body()) |
|
|
|
} |
|
|
|
} |
|
|
|
if actual, err := ReadEpochBlockNumber(db, big.NewInt(0)); err != nil { |
|
|
|
if actual, err := ReadEpochBlockNumber(db, big.NewInt(0)); err != nil { |
|
|
|