From 4a9a0d18ee8a24a179a6a86b0c6062d0dff5e5ba Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Wed, 24 Apr 2024 19:02:16 +0800 Subject: [PATCH] update methods --- pkg/backend.go | 12 ++++-------- pkg/client/database.go | 8 ++++---- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/pkg/backend.go b/pkg/backend.go index a634e73..c24c018 100644 --- a/pkg/backend.go +++ b/pkg/backend.go @@ -97,16 +97,12 @@ func (s *LevelDBBackend) ModifyAncients(f func(ethdb.AncientWriteOp) error) (int return 0, errWriteNotAllowed } -func (s *LevelDBBackend) TruncateAncients(n uint64) error { - return errWriteNotAllowed +func (s *LevelDBBackend) TruncateHead(n uint64) (uint64, error) { + return 0, errWriteNotAllowed } -func (s *LevelDBBackend) TruncateHead(n uint64) error { - return errWriteNotAllowed -} - -func (s *LevelDBBackend) TruncateTail(n uint64) error { - return errWriteNotAllowed +func (s *LevelDBBackend) TruncateTail(n uint64) (uint64, error) { + return 0, errWriteNotAllowed } func (s *LevelDBBackend) Sync() error { diff --git a/pkg/client/database.go b/pkg/client/database.go index f75e52c..7ddb7c9 100644 --- a/pkg/client/database.go +++ b/pkg/client/database.go @@ -212,14 +212,14 @@ func (d *DatabaseClient) ModifyAncients(f func(ethdb.AncientWriteOp) error) (int // TruncateHead satisfies the ethdb.AncientWriter interface. // TruncateHead discards all but the first n ancient data from the ancient store. -func (d *DatabaseClient) TruncateHead(n uint64) error { - return errNotSupported +func (d *DatabaseClient) TruncateHead(n uint64) (uint64, error) { + return 0, errNotSupported } // TruncateTail satisfies the ethdb.AncientWriter interface. // TruncateTail discards the first n ancient data from the ancient store. -func (d *DatabaseClient) TruncateTail(n uint64) error { - return errNotSupported +func (d *DatabaseClient) TruncateTail(n uint64) (uint64, error) { + return 0, errNotSupported } // Sync satisfies the ethdb.AncientWriter interface