From ce855707d9cc5990e273d648f7778be27fb1c620 Mon Sep 17 00:00:00 2001 From: weiihann Date: Tue, 5 Nov 2024 17:45:46 +0800 Subject: [PATCH] fix test --- rpc/contract_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpc/contract_test.go b/rpc/contract_test.go index dc84a37fd9..4d0ee8c2c8 100644 --- a/rpc/contract_test.go +++ b/rpc/contract_test.go @@ -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) @@ -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)