Skip to content

Commit

Permalink
Merge branch 'main' of github.com:zerodevapp/sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
SahilVasava committed Sep 30, 2024
2 parents f191f51 + 6437514 commit 330101c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/test/v0.7/permissionValidator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
zeroAddress
} from "viem"
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"
import { sepolia } from "viem/chains"
import {
ECDSA_SIGNER_CONTRACT,
GAS_POLICY_CONTRACT,
Expand Down Expand Up @@ -67,7 +68,6 @@ import {
kernelVersion,
sleep
} from "./utils"
import { sepolia } from "viem/chains";

const ETHEREUM_ADDRESS_LENGTH = 42
const ETHEREUM_ADDRESS_REGEX = /^0x[0-9a-fA-F]{40}$/
Expand Down
12 changes: 9 additions & 3 deletions packages/test/v0.7/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ export const getRecoveryKernelAccount = async (
export const getSignerToPermissionKernelAccount = async (
policies: Policy[],
action?: Action
): Promise<KernelSmartAccount<ENTRYPOINT_ADDRESS_V07_TYPE, Transport, Chain>> => {
): Promise<
KernelSmartAccount<ENTRYPOINT_ADDRESS_V07_TYPE, Transport, Chain>
> => {
const privateKey1 = process.env.TEST_PRIVATE_KEY as Hex
if (!privateKey1) {
throw new Error(
Expand Down Expand Up @@ -526,7 +528,9 @@ export const getSessionKeySignerToPermissionKernelAccount = async (

export const getSignerToRootPermissionKernelAccount = async (
policies: Policy[]
): Promise<KernelSmartAccount<ENTRYPOINT_ADDRESS_V07_TYPE, Transport, Chain>> => {
): Promise<
KernelSmartAccount<ENTRYPOINT_ADDRESS_V07_TYPE, Transport, Chain>
> => {
const publicClient = await getPublicClient()
const signer1 = privateKeyToAccount(generatePrivateKey())
const ecdsaModularSigner = toECDSASigner({ signer: signer1 })
Expand Down Expand Up @@ -557,7 +561,9 @@ export const getSignerToRootPermissionKernelAccount = async (
export const getSignerToRootPermissionWithSecondaryValidatorKernelAccount =
async (
policies: Policy[]
): Promise<KernelSmartAccount<ENTRYPOINT_ADDRESS_V07_TYPE, Transport, Chain>> => {
): Promise<
KernelSmartAccount<ENTRYPOINT_ADDRESS_V07_TYPE, Transport, Chain>
> => {
const publicClient = await getPublicClient()
const signer1 = privateKeyToAccount(generatePrivateKey())
const ecdsaModularSigner = toECDSASigner({ signer: signer1 })
Expand Down
6 changes: 2 additions & 4 deletions plugins/permission/deserializePermissionAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,8 @@ export const deserializePermissionAccount = async <
kernelVersion
})

const { index, validatorInitData, useMetaFactory } = decodeParamsFromInitCode(
params.accountParams.initCode,
kernelVersion
)
const { index, validatorInitData, useMetaFactory } =
decodeParamsFromInitCode(params.accountParams.initCode, kernelVersion)

const kernelPluginManager = await toKernelPluginManager(client, {
regular: modularPermissionPlugin,
Expand Down

0 comments on commit 330101c

Please sign in to comment.