Skip to content

Commit

Permalink
fix(utils): update deposit schema with to/fromLiteChain (#679)
Browse files Browse the repository at this point in the history
Signed-off-by: bennett <[email protected]>
  • Loading branch information
bmzig authored Jul 4, 2024
1 parent 8cf0e7b commit 0705b9e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@across-protocol/sdk",
"author": "UMA Team",
"version": "3.1.9",
"version": "3.1.10",
"license": "AGPL-3.0",
"homepage": "https://docs.across.to/reference/sdk",
"files": [
Expand Down
4 changes: 3 additions & 1 deletion src/utils/ValidatorUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BigNumber, ethers } from "ethers";
import { object, min as Min, define, optional, string, integer } from "superstruct";
import { object, min as Min, define, optional, string, integer, boolean } from "superstruct";
import { DepositWithBlock } from "../interfaces";

const AddressValidator = define<string>("AddressValidator", (v) => ethers.utils.isAddress(String(v)));
Expand Down Expand Up @@ -31,6 +31,8 @@ const V3DepositSchema = object({
logIndex: Min(integer(), 0),
quoteBlockNumber: Min(integer(), 0),
transactionHash: HexValidator,
fromLiteChain: optional(boolean()),
toLiteChain: optional(boolean()),
});

export function isDepositFormedCorrectly(deposit: unknown): deposit is DepositWithBlock {
Expand Down
2 changes: 2 additions & 0 deletions test/validatorUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ describe("validatorUtils", () => {
transactionIndex: 0,
logIndex: 0,
quoteBlockNumber: 0,
fromLiteChain: false,
toLiteChain: false,
};
});

Expand Down

0 comments on commit 0705b9e

Please sign in to comment.