Skip to content

Commit

Permalink
use panic
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchiqing committed Nov 27, 2024
1 parent 10d4b9d commit 59a1d05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fvm/evm/offchain/storage/readonly.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (s *ReadOnlyStorage) GetValue(owner []byte, key []byte) ([]byte, error) {

// SetValue returns an error if called
func (s *ReadOnlyStorage) SetValue(owner, key, value []byte) error {
return fmt.Errorf("unexpected call received for SetValue with owner: %x, key: %v, value: %x", owner, key, value)
panic(fmt.Sprintf("unexpected call received for SetValue with owner: %x, key: %v, value: %x", owner, key, value))
}

// ValueExists checks if a register exists
Expand All @@ -40,5 +40,5 @@ func (s *ReadOnlyStorage) ValueExists(owner []byte, key []byte) (bool, error) {

// AllocateSlabIndex returns an error if called
func (s *ReadOnlyStorage) AllocateSlabIndex(owner []byte) (atree.SlabIndex, error) {
return atree.SlabIndex{}, fmt.Errorf("unexpected call received for AllocateSlabIndex with owner: %x", owner)
panic(fmt.Errorf("unexpected call received for AllocateSlabIndex with owner: %x", owner))
}

0 comments on commit 59a1d05

Please sign in to comment.