Skip to content

Commit

Permalink
fix(cli): encode function and event signatures correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
topocount committed Nov 19, 2024
1 parent fa789d9 commit 0ed0cd2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/cli/src/commands/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,9 @@ const zAbiItemSchema = z.custom<`0x${string}`>().pipe(
message: 'signature must start with `event` or function`',
})
.transform((sig) => {
if (sig.startsWith('event')) return pad(toFunctionSelector(sig)) as Hex;
if (sig.startsWith('function')) return toEventSelector(sig) as Hex;
if (sig.startsWith('function'))
return pad(toFunctionSelector(sig)) as Hex;
if (sig.startsWith('event')) return toEventSelector(sig) as Hex;
throw new Error('unreachable');
}),
);
Expand Down

0 comments on commit 0ed0cd2

Please sign in to comment.