Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com>
  • Loading branch information
zhangchiqing and peterargue authored Nov 16, 2023
1 parent 588de92 commit 277608b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engine/execution/storehouse/block_end_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func NewBlockEndStateSnapshot(
// - (nil, storage.ErrNotFound) if the register does not exist
// - (nil, storage.ErrHeightNotIndexed) if the height is below the first height that is indexed.
// - (nil, storehouse.ErrNotExecuted) if the block is not executed yet
// - (nil, storehouse.ErrNotExecuted) if the block is conflicting iwth finalized block
// - (nil, storehouse.ErrNotExecuted) if the block is conflicting with finalized block
// - (nil, err) for any other exceptions
func (s *BlockEndStateSnapshot) Get(id flow.RegisterID) (flow.RegisterValue, error) {
value, ok := s.getFromCache(id)
Expand All @@ -61,7 +61,7 @@ func (s *BlockEndStateSnapshot) Get(id flow.RegisterID) (flow.RegisterValue, err
// in this case, the nil value can be cached, because the storage will not change it
value = nil
} else {
// if the error is not found, such as storage.ErrHeightNotIndexed, storehouse.ErrNotExecuted
// if the error is not ErrNotFound, such as storage.ErrHeightNotIndexed, storehouse.ErrNotExecuted
// we return the error without caching
return nil, err
}
Expand Down

0 comments on commit 277608b

Please sign in to comment.