Skip to content

Commit

Permalink
Merge pull request ethereum#243 from OffchainLabs/export-memdb-errors
Browse files Browse the repository at this point in the history
Export errNotFound from memorydb to use it in Nitro error checks
  • Loading branch information
anodar authored Aug 10, 2023
2 parents 82ab511 + 522fde5 commit 0461acc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ethdb/memorydb/memorydb.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ var (
// invocation of a data access operation.
errMemorydbClosed = errors.New("database closed")

// errMemorydbNotFound is returned if a key is requested that is not found in
// ErrMemorydbNotFound is returned if a key is requested that is not found in
// the provided memory database.
errMemorydbNotFound = errors.New("not found")
ErrMemorydbNotFound = errors.New("not found")

// errSnapshotReleased is returned if callers want to retrieve data from a
// released snapshot.
Expand Down Expand Up @@ -98,7 +98,7 @@ func (db *Database) Get(key []byte) ([]byte, error) {
if entry, ok := db.db[string(key)]; ok {
return common.CopyBytes(entry), nil
}
return nil, errMemorydbNotFound
return nil, ErrMemorydbNotFound
}

// Put inserts the given value into the key-value store.
Expand Down Expand Up @@ -374,7 +374,7 @@ func (snap *snapshot) Get(key []byte) ([]byte, error) {
if entry, ok := snap.db[string(key)]; ok {
return common.CopyBytes(entry), nil
}
return nil, errMemorydbNotFound
return nil, ErrMemorydbNotFound
}

// Release releases associated resources. Release should always succeed and can
Expand Down

0 comments on commit 0461acc

Please sign in to comment.