Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
weiihann committed Nov 5, 2024
1 parent 592eb95 commit ce85570
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rpc/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func TestStorageAt(t *testing.T) {
t.Run("non-existent contract", func(t *testing.T) {
mockReader.EXPECT().HeadState().Return(mockState, nopCloser, nil)
// we check if the contract exists by getting its nonce
mockState.EXPECT().ContractNonce(gomock.Any()).Return(nil, errors.New("non-existent contract"))
mockState.EXPECT().ContractNonce(gomock.Any()).Return(nil, db.ErrKeyNotFound)

storage, rpcErr := handler.StorageAt(felt.Zero, felt.Zero, rpc.BlockID{Latest: true})
require.Nil(t, storage)
Expand All @@ -133,8 +133,8 @@ func TestStorageAt(t *testing.T) {

t.Run("non-existent key", func(t *testing.T) {
mockReader.EXPECT().HeadState().Return(mockState, nopCloser, nil)
// we check if the contract exists by getting its nonce
mockState.EXPECT().ContractNonce(gomock.Any()).Return(nil, errors.New("non-existent contract"))
mockState.EXPECT().ContractNonce(&felt.Zero).Return(nil, nil)
mockState.EXPECT().ContractStorage(gomock.Any(), gomock.Any()).Return(nil, db.ErrKeyNotFound)

storage, rpcErr := handler.StorageAt(felt.Zero, felt.Zero, rpc.BlockID{Latest: true})
require.Nil(t, storage)
Expand Down

0 comments on commit ce85570

Please sign in to comment.