-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: timestamp and block number on txEffect (#111)
- Loading branch information
1 parent
f8ba8cb
commit 8e457eb
Showing
8 changed files
with
75 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { z } from "zod"; | ||
import { ChicmozL2Block, chicmozL2BlockSchema } from "./l2Block.js"; | ||
import { | ||
chicmozL2ContractClassRegisteredEventSchema, | ||
chicmozL2ContractInstanceDeployedEventSchema, | ||
} from "./l2Contract.js"; | ||
import { chicmozL2TxEffectSchema } from "./l2TxEffect.js"; | ||
|
||
export const chicmozL2ContractInstanceDeluxeSchema = z.object({ | ||
...chicmozL2ContractInstanceDeployedEventSchema.shape, | ||
...chicmozL2ContractClassRegisteredEventSchema.shape, | ||
blockHeight: chicmozL2BlockSchema.shape.height.optional(), | ||
}); | ||
|
||
export type ChicmozL2ContractInstanceDeluxe = z.infer< | ||
typeof chicmozL2ContractInstanceDeluxeSchema | ||
>; | ||
|
||
export const chicmozL2TxEffectDeluxeSchema = z.object({ | ||
...chicmozL2TxEffectSchema.shape, | ||
blockHeight: z.lazy(() => chicmozL2BlockSchema.shape.height), | ||
timestamp: z.lazy( | ||
() => | ||
chicmozL2BlockSchema.shape.header.shape.globalVariables.shape.timestamp | ||
), | ||
}); | ||
|
||
export type ChicmozL2TxEffectDeluxe = z.infer< | ||
typeof chicmozL2TxEffectSchema & { | ||
blockHeight: ChicmozL2Block["height"]; | ||
timestamp: ChicmozL2Block["header"]["globalVariables"]["timestamp"]; | ||
} | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export * from "./l2Block.js"; | ||
export * from "./l2Contract.js"; | ||
export * from "./l2TxEffect.js"; | ||
export * from "./deluxe.js"; | ||
export { frNumberSchema } from "./utils.js"; | ||
|
||
export { type NodeInfo } from "@aztec/aztec.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters