Skip to content

Commit 3b21f1a

Browse files
frolicjxom
andauthored
feat: don't hash request ID (#3275)
* feat: don't hash request ID * Create heavy-lies-attend.md --------- Co-authored-by: jxom <[email protected]>
1 parent c933388 commit 3b21f1a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.changeset/heavy-lies-attend.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"viem": patch
3+
---
4+
5+
Removed hash on request cache key.

src/utils/buildRequest.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ import type {
5656
EIP1193RequestOptions,
5757
} from '../types/eip1193.js'
5858
import { stringToHex } from './encoding/toHex.js'
59-
import { keccak256 } from './hash/keccak256.js'
6059
import type { CreateBatchSchedulerErrorType } from './promise/createBatchScheduler.js'
6160
import { withDedupe } from './promise/withDedupe.js'
6261
import { type WithRetryErrorType, withRetry } from './promise/withRetry.js'
@@ -120,7 +119,7 @@ export function buildRequest<request extends (args: any) => Promise<any>>(
120119
})
121120

122121
const requestId = dedupe
123-
? keccak256(stringToHex(`${uid}.${stringify(args)}`))
122+
? stringToHex(`${uid}.${stringify(args)}`)
124123
: undefined
125124
return withDedupe(
126125
() =>

0 commit comments

Comments
 (0)