Skip to content

Commit

Permalink
fix: return promise definition
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptodev-2s committed Jul 22, 2024
1 parent cc04717 commit 3243082
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/block-ref.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('createBlockRefMiddleware', () => {
'0x100',
),
},
response: async () => Promise.resolve('something'),
response: async () => 'something',
}),
]);

Expand Down Expand Up @@ -157,7 +157,7 @@ describe('createBlockRefMiddleware', () => {
'0x100',
),
},
response: async () => Promise.resolve('something'),
response: async () => 'something',
}),
]);

Expand Down Expand Up @@ -199,7 +199,7 @@ describe('createBlockRefMiddleware', () => {
'0x100',
),
},
response: async () => Promise.resolve('something'),
response: async () => 'something',
}),
]);

Expand Down Expand Up @@ -247,7 +247,7 @@ describe('createBlockRefMiddleware', () => {
'0x100',
),
},
response: async () => Promise.resolve('something'),
response: async () => 'something',
}),
]);

Expand Down
4 changes: 2 additions & 2 deletions src/retryOnEmpty.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describe('createRetryOnEmptyMiddleware', () => {
stubRequestThatFailsThenFinallySucceeds({
request,
numberOfTimesToFail: 9,
successfulResponse: async () => Promise.resolve('something'),
successfulResponse: async () => 'something',
}),
]);

Expand Down Expand Up @@ -252,7 +252,7 @@ describe('createRetryOnEmptyMiddleware', () => {
buildStubForBlockNumberRequest(blockNumber),
stubGenericRequest({
request,
response: async () => Promise.resolve('success'),
response: async () => 'success',
}),
]);

Expand Down
4 changes: 2 additions & 2 deletions test/util/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export function buildStubForBlockNumberRequest(
method: 'eth_blockNumber',
params: [],
},
response: async () => Promise.resolve(blockNumber),
response: async () => blockNumber,
};
}

Expand Down Expand Up @@ -221,7 +221,7 @@ export function stubProviderRequests(
remainingStubs.splice(stubIndex, 1);
}

return Promise.resolve(res);
return res;
}
});
}
Expand Down

0 comments on commit 3243082

Please sign in to comment.