-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aztec.js): Support AddressLike parameters (#2430)
Lets a user of aztec.js pass `EthAddress` or `AztecAddress` instances when an `EthereumAddress` or `AztecAddress` struct from aztec.nr is required. Changes all e2e tests to use this simplified API.
- Loading branch information
1 parent
6499248
commit 5b5f139
Showing
22 changed files
with
362 additions
and
412 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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import { Fr } from '@aztec/circuits.js'; | ||
import { AztecAddress, EthAddress, Fr } from '@aztec/circuits.js'; | ||
|
||
/** Any type that can be converted into a field for a contract call. */ | ||
export type FieldLike = Fr | Buffer | bigint | number | { /** Converts to field */ toField: () => Fr }; | ||
|
||
/** Any type that can be converted into an EthereumAddress Aztec.nr struct. */ | ||
export type EthAddressLike = { /** Wrapped address */ address: FieldLike } | EthAddress; | ||
|
||
/** Any type that can be converted into an EthereumAddress Aztec.nr struct. */ | ||
export type AztecAddressLike = { /** Wrapped address */ address: FieldLike } | AztecAddress; |
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
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
Oops, something went wrong.