Skip to content

Commit 4247ce7

Browse files
committed
no need for some params on block count
1 parent 85e8b7c commit 4247ce7

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

src/hooks/adapter/helpers.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,22 @@ export function getBlocksParams({
215215
nonce,
216216
epoch,
217217
proposer,
218-
withProposerIdentity = true
218+
withProposerIdentity = true,
219+
220+
// not on api
221+
isCount = false
219222
}: GetBlocksType) {
220223
const params: AdapterProviderPropsType['params'] = {
221-
...getPageParams({ page, size }),
224+
...(isCount
225+
? {}
226+
: {
227+
...getPageParams({ page, size }),
228+
...(withProposerIdentity ? { withProposerIdentity } : {}),
229+
...(fields !== undefined ? { fields } : {})
230+
}),
222231
...(proposer ? { proposer } : {}),
223-
...(withProposerIdentity ? { withProposerIdentity } : {}),
224-
...getShardAndEpochParams(shard, epoch),
225232
...(nonce !== undefined ? { nonce } : {}),
226-
...(fields !== undefined ? { fields } : {})
233+
...getShardAndEpochParams(shard, epoch)
227234
};
228235

229236
return params;

src/hooks/adapter/requests/useBlockRequests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const useBlockRequests = () => {
3737
url: '/blocks/c',
3838
signal,
3939
timeout,
40-
params: getBlocksParams(params)
40+
params: getBlocksParams({ isCount: true, ...params })
4141
}),
4242

4343
/* Miniblocks */

0 commit comments

Comments
 (0)