Skip to content

Commit

Permalink
feat: don't hash request ID (#3275)
Browse files Browse the repository at this point in the history
* feat: don't hash request ID

* Create heavy-lies-attend.md

---------

Co-authored-by: jxom <[email protected]>
  • Loading branch information
holic and jxom authored Jan 25, 2025
1 parent c933388 commit 3b21f1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/heavy-lies-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

Removed hash on request cache key.
3 changes: 1 addition & 2 deletions src/utils/buildRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ import type {
EIP1193RequestOptions,
} from '../types/eip1193.js'
import { stringToHex } from './encoding/toHex.js'
import { keccak256 } from './hash/keccak256.js'
import type { CreateBatchSchedulerErrorType } from './promise/createBatchScheduler.js'
import { withDedupe } from './promise/withDedupe.js'
import { type WithRetryErrorType, withRetry } from './promise/withRetry.js'
Expand Down Expand Up @@ -120,7 +119,7 @@ export function buildRequest<request extends (args: any) => Promise<any>>(
})

const requestId = dedupe
? keccak256(stringToHex(`${uid}.${stringify(args)}`))
? stringToHex(`${uid}.${stringify(args)}`)
: undefined
return withDedupe(
() =>
Expand Down

0 comments on commit 3b21f1a

Please sign in to comment.