Skip to content

Commit

Permalink
Merge pull request #14 from pimlicolabs/feature/getSenderAddress
Browse files Browse the repository at this point in the history
Fix type of publicClient
  • Loading branch information
kristofgazso authored Oct 2, 2023
2 parents f7474a0 + eedcfab commit 5e9753e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
10 changes: 3 additions & 7 deletions src/actions/public.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import type {
Address,
Chain,
ContractFunctionExecutionErrorType,
ContractFunctionRevertedErrorType,
Hex,
PublicClient,
Transport
PublicClient
} from "viem"
import { BaseError } from "viem"

Expand Down Expand Up @@ -52,10 +50,8 @@ export class InvalidEntryPointError extends BaseError {
*
* // Return '0x7a88a206ba40b37a8c07a2b5688cf8b287318b63'
*/
export const getSenderAddress = async <
TPublicClient extends PublicClient<Transport, Chain | undefined> = PublicClient<Transport, Chain | undefined>
>(
publicClient: TPublicClient,
export const getSenderAddress = async (
publicClient: PublicClient,
{ initCode, entryPoint }: GetSenderAddressParams
): Promise<Address> => {
try {
Expand Down
3 changes: 1 addition & 2 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
import {
http,
Hex,
HttpTransport,
WalletClient,
concatHex,
createPublicClient,
Expand Down Expand Up @@ -52,7 +51,7 @@ const chain = "goerli"
const account = privateKeyToAccount(process.env.TEST_PRIVATE_KEY as Hex)
const factoryAddress = "0x9406Cc6185a346906296840746125a0E44976454" as Address

const publicClient = createPublicClient<HttpTransport, typeof goerli>({
const publicClient = createPublicClient({
chain: goerli,
transport: http(process.env.RPC_URL as string)
})
Expand Down

0 comments on commit 5e9753e

Please sign in to comment.