Skip to content

Commit

Permalink
Update ValidatorUtils.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspai committed Feb 12, 2024
1 parent db85599 commit 15967b1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/utils/ValidatorUtils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { BigNumber, ethers } from "ethers";
import { object, min as Min, define, optional, string, integer } from "superstruct";
import { DepositWithBlock } from "../interfaces";
import { isV2Deposit, isV3Deposit } from "./V3Utils";

const AddressValidator = define<string>("AddressValidator", (v) => ethers.utils.isAddress(String(v)));
const HexValidator = define<string>("HexValidator", (v) => ethers.utils.isHexString(String(v)));
Expand Down Expand Up @@ -59,8 +58,5 @@ const V3DepositSchema = object({
});

export function isDepositFormedCorrectly(deposit: unknown): deposit is DepositWithBlock {
return (
(V2DepositSchema.is(deposit) && isV2Deposit(deposit as DepositWithBlock)) ||
(V3DepositSchema.is(deposit) && isV3Deposit(deposit as DepositWithBlock))
);
return V2DepositSchema.is(deposit) || V3DepositSchema.is(deposit);
}

0 comments on commit 15967b1

Please sign in to comment.