mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-14 12:06:40 +00:00
core/rawdb: test that writing during readonly fails
This commit is contained in:
parent
8f42a64920
commit
114a81e0d6
1 changed files with 9 additions and 0 deletions
|
|
@ -903,4 +903,13 @@ func TestFreezerReadonlyBasics(t *testing.T) {
|
||||||
if !bytes.Equal(v, exp) {
|
if !bytes.Equal(v, exp) {
|
||||||
t.Errorf("retrieved value is incorrect")
|
t.Errorf("retrieved value is incorrect")
|
||||||
}
|
}
|
||||||
|
// Now write some data. This should fail either during AppendRaw or Commit
|
||||||
|
batch := f.newBatch()
|
||||||
|
writeErr := batch.AppendRaw(32, make([]byte, 1))
|
||||||
|
if writeErr == nil {
|
||||||
|
writeErr = batch.commit()
|
||||||
|
}
|
||||||
|
if writeErr == nil {
|
||||||
|
t.Fatalf("Writing to readonly table should fail")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue