Module: testing
The @aztec/accounts/testing
export provides utility methods for testing, in particular in a Sandbox environment.
Use getInitialTestAccountsWallets to obtain a list of wallets for the Sandbox pre-seeded accounts.
Interfaces
Variables
INITIAL_TEST_ACCOUNT_SALTS
• Const
INITIAL_TEST_ACCOUNT_SALTS: Fr
[]
INITIAL_TEST_ENCRYPTION_KEYS
• Const
INITIAL_TEST_ENCRYPTION_KEYS: Fq
[]
INITIAL_TEST_SECRET_KEYS
• Const
INITIAL_TEST_SECRET_KEYS: Fr
[]
INITIAL_TEST_SIGNING_KEYS
• Const
INITIAL_TEST_SIGNING_KEYS: Fq
[] = INITIAL_TEST_ENCRYPTION_KEYS
Functions
deployFundedSchnorrAccount
▸ deployFundedSchnorrAccount(pxe
, account
, opts?
, waitForProvenOptions?
): Promise
<AccountManager
>
Deploy schnorr account contract. It will pay for the fee for the deployment itself. So it must be funded with the prefilled public data.
Parameters
Name | Type |
---|---|
pxe | PXE |
account | DeployAccountData |
opts | WaitOpts & { skipClassRegistration? : boolean } |
waitForProvenOptions? | WaitForProvenOpts |
Returns
Promise
<AccountManager
>
deployFundedSchnorrAccounts
▸ deployFundedSchnorrAccounts(pxe
, accounts
, opts?
, waitForProvenOptions?
): Promise
<AccountManager
[]>
Deploy schnorr account contracts. They will pay for the fees for the deployment themselves. So they must be funded with the prefilled public data.
Parameters
Name | Type |
---|---|
pxe | PXE |
accounts | DeployAccountData [] |
opts | WaitOpts & { skipClassRegistration? : boolean } |
waitForProvenOptions? | WaitForProvenOpts |
Returns
Promise
<AccountManager
[]>
generateSchnorrAccounts
▸ generateSchnorrAccounts(numberOfAccounts
): Promise
<{ address
: AztecAddress
; salt
: Fr
; secret
: Fr
; signingKey
: Fq
}[]>
Generate a fixed amount of random schnorr account contract instance.
Parameters
Name | Type |
---|---|
numberOfAccounts | number |
Returns
Promise
<{ address
: AztecAddress
; salt
: Fr
; secret
: Fr
; signingKey
: Fq
}[]>
getDeployedTestAccounts
▸ getDeployedTestAccounts(pxe
): Promise
<InitialAccountData
[]>
Queries a PXE for it's registered accounts.
Parameters
Name | Type | Description |
---|---|---|
pxe | PXE | PXE instance. |
Returns
Promise
<InitialAccountData
[]>
A set of key data for each of the initial accounts.
getDeployedTestAccountsWallets
▸ getDeployedTestAccountsWallets(pxe
): Promise
<AccountWalletWithSecretKey
[]>
Queries a PXE for it's registered accounts and returns wallets for those accounts using keys in the initial test accounts.
Parameters
Name | Type | Description |
---|---|---|
pxe | PXE | PXE instance. |
Returns
Promise
<AccountWalletWithSecretKey
[]>
A set of AccountWallet implementations for each of the initial accounts.
getInitialTestAccounts
▸ getInitialTestAccounts(): Promise
<InitialAccountData
[]>
Gets the basic information for initial test accounts.
Returns
Promise
<InitialAccountData
[]>
getInitialTestAccountsWallets
▸ getInitialTestAccountsWallets(pxe
): Promise
<AccountWalletWithSecretKey
[]>
Gets a collection of wallets for the Aztec accounts that are initially stored in the test environment.
Parameters
Name | Type | Description |
---|---|---|
pxe | PXE | PXE instance. |
Returns
Promise
<AccountWalletWithSecretKey
[]>
A set of AccountWallet implementations for each of the initial accounts.