Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
adnpark committed Jul 23, 2024
1 parent b7147f4 commit ac550bd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
4 changes: 2 additions & 2 deletions plugins/multi-chain-weighted-validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import {
type WeightedSigner,
type WeightedValidatorConfig,
createMultiChainWeightedValidator,
getValidatorAddress,
getCurrentSigners,
getUpdateConfigCall,
getCurrentSigners
getValidatorAddress
} from "./toMultiChainWeightedValidatorPlugin.js"

export {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
type Transport,
type TypedDataDefinition,
encodeAbiParameters,
zeroAddress,
encodeFunctionData
encodeFunctionData,
zeroAddress
} from "viem"
import { toAccount } from "viem/accounts"
import { getChainId, readContract } from "viem/actions"
Expand Down Expand Up @@ -353,26 +353,30 @@ export function getUpdateConfigCall<entryPoint extends EntryPoint>(
return {
to: validatorAddress,
value: 0n,
data: encodeFunctionData({abi: MultiChainWeightedValidatorAbi, functionName: "renew", args: [
concatHex([
toHex(config.threshold, { size: 3 }),
toHex(config.delay || 0, { size: 6 }),
encodeAbiParameters(
[{ name: "guardiansData", type: "bytes[]" }],
[
configSigners.map((cfg) =>
concatHex([
cfg.publicKey.length === 42
? SIGNER_TYPE.ECDSA
: SIGNER_TYPE.PASSKEY,
toHex(cfg.weight, { size: 3 }),
cfg.publicKey
])
)
]
)
])
]})
data: encodeFunctionData({
abi: MultiChainWeightedValidatorAbi,
functionName: "renew",
args: [
concatHex([
toHex(config.threshold, { size: 3 }),
toHex(config.delay || 0, { size: 6 }),
encodeAbiParameters(
[{ name: "guardiansData", type: "bytes[]" }],
[
configSigners.map((cfg) =>
concatHex([
cfg.publicKey.length === 42
? SIGNER_TYPE.ECDSA
: SIGNER_TYPE.PASSKEY,
toHex(cfg.weight, { size: 3 }),
cfg.publicKey
])
)
]
)
])
]
})
}
}

Expand Down

0 comments on commit ac550bd

Please sign in to comment.