@aztec/end-to-end 0.0.1-commit.42ee6df9b → 0.0.1-commit.431c48d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +229 -14
- package/dest/automine/automine_test_context.d.ts +85 -0
- package/dest/automine/automine_test_context.d.ts.map +1 -0
- package/dest/automine/automine_test_context.js +98 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts +2 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts.map +1 -0
- package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.d.ts +1 -1
- package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts +48 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts.map +1 -0
- package/dest/automine/delivery/interactive_handshake_responder.js +76 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts +19 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -0
- package/dest/automine/delivery/onchain_delivery_harness.js +141 -0
- package/dest/automine/token/blacklist_token_contract_test.d.ts +49 -0
- package/dest/automine/token/blacklist_token_contract_test.d.ts.map +1 -0
- package/dest/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.js +23 -36
- package/dest/automine/token/token_contract_test.d.ts +40 -0
- package/dest/automine/token/token_contract_test.d.ts.map +1 -0
- package/dest/{e2e_token_contract → automine/token}/token_contract_test.js +24 -39
- package/dest/automine/token/token_test_helpers.d.ts +73 -0
- package/dest/automine/token/token_test_helpers.d.ts.map +1 -0
- package/dest/automine/token/token_test_helpers.js +97 -0
- package/dest/bench/client_flows/benchmark.d.ts +15 -1
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +19 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +5 -5
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +45 -29
- package/dest/bench/utils.d.ts +3 -3
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +97 -6
- package/dest/composed/ha/ha_full_setup.d.ts +77 -0
- package/dest/composed/ha/ha_full_setup.d.ts.map +1 -0
- package/dest/composed/ha/ha_full_setup.js +383 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts +12 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts.map +1 -0
- package/dest/fixtures/authwit_proxy.d.ts +1 -1
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
- package/dest/fixtures/authwit_proxy.js +4 -0
- package/dest/fixtures/e2e_prover_test.d.ts +12 -9
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +51 -30
- package/dest/fixtures/fixtures.d.ts +79 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +80 -0
- package/dest/fixtures/ha_setup.d.ts +4 -4
- package/dest/fixtures/ha_setup.d.ts.map +1 -1
- package/dest/fixtures/ha_setup.js +5 -2
- package/dest/fixtures/index.d.ts +2 -1
- package/dest/fixtures/index.d.ts.map +1 -1
- package/dest/fixtures/index.js +1 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
- package/dest/fixtures/setup.d.ts +81 -42
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +289 -198
- package/dest/fixtures/setup_p2p_test.d.ts +10 -6
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +11 -11
- package/dest/fixtures/standard_contracts_genesis.d.ts +16 -0
- package/dest/fixtures/standard_contracts_genesis.d.ts.map +1 -0
- package/dest/fixtures/standard_contracts_genesis.js +25 -0
- package/dest/fixtures/timing.d.ts +42 -0
- package/dest/fixtures/timing.d.ts.map +1 -0
- package/dest/fixtures/timing.js +72 -0
- package/dest/fixtures/token_utils.d.ts +22 -4
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +21 -1
- package/dest/fixtures/utils.d.ts +2 -2
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +1 -1
- package/dest/fixtures/wait_helpers.d.ts +135 -0
- package/dest/fixtures/wait_helpers.d.ts.map +1 -0
- package/dest/fixtures/wait_helpers.js +154 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
- package/dest/forward-compatibility/wallet_service.d.ts +3 -0
- package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_service.js +109 -0
- package/dest/install_legacy_contracts.d.cts +13 -0
- package/dest/install_legacy_contracts.d.cts.map +1 -0
- package/dest/legacy-jest-resolver.d.cts +3 -0
- package/dest/legacy-jest-resolver.d.cts.map +1 -0
- package/dest/multi-node/block-production/setup.d.ts +97 -0
- package/dest/multi-node/block-production/setup.d.ts.map +1 -0
- package/dest/multi-node/block-production/setup.js +158 -0
- package/dest/multi-node/governance/setup.d.ts +67 -0
- package/dest/multi-node/governance/setup.d.ts.map +1 -0
- package/dest/multi-node/governance/setup.js +126 -0
- package/dest/multi-node/multi_node_test_context.d.ts +212 -0
- package/dest/multi-node/multi_node_test_context.d.ts.map +1 -0
- package/dest/multi-node/multi_node_test_context.js +347 -0
- package/dest/multi-node/slashing/inactivity_setup.d.ts +27 -0
- package/dest/multi-node/slashing/inactivity_setup.d.ts.map +1 -0
- package/dest/multi-node/slashing/inactivity_setup.js +111 -0
- package/dest/multi-node/slashing/setup.d.ts +167 -0
- package/dest/multi-node/slashing/setup.d.ts.map +1 -0
- package/dest/multi-node/slashing/setup.js +275 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.d.ts +19 -10
- package/dest/p2p/p2p_network.d.ts.map +1 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.js +82 -38
- package/dest/p2p/reqresp/utils.d.ts +19 -0
- package/dest/p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/{e2e_p2p → p2p}/reqresp/utils.js +32 -29
- package/dest/p2p/shared.d.ts +72 -0
- package/dest/p2p/shared.d.ts.map +1 -0
- package/dest/p2p/shared.js +212 -0
- package/dest/shared/cross_chain_test_harness.d.ts +6 -4
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +33 -21
- package/dest/shared/gas_portal_test_harness.d.ts +8 -5
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +24 -12
- package/dest/shared/submit-transactions.d.ts +1 -1
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +12 -5
- package/dest/shared/timing_env.d.js +5 -0
- package/dest/shared/timing_env.js +365 -0
- package/dest/shared/uniswap_l1_l2.d.ts +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +50 -37
- package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
- package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
- package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
- package/dest/simulators/lending_simulator.d.ts +10 -3
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +24 -12
- package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts +75 -0
- package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts.map +1 -0
- package/dest/single-node/cross-chain/cross_chain_messaging_test.js +209 -0
- package/dest/single-node/cross-chain/message_test_helpers.d.ts +38 -0
- package/dest/single-node/cross-chain/message_test_helpers.d.ts.map +1 -0
- package/dest/single-node/cross-chain/message_test_helpers.js +70 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.d.ts +1 -1
- package/dest/single-node/fees/bridging_race.notest.d.ts.map +1 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.js +17 -4
- package/dest/single-node/fees/fees_test.d.ts +95 -0
- package/dest/single-node/fees/fees_test.d.ts.map +1 -0
- package/dest/single-node/fees/fees_test.js +347 -0
- package/dest/single-node/l1-reorgs/setup.d.ts +42 -0
- package/dest/single-node/l1-reorgs/setup.d.ts.map +1 -0
- package/dest/single-node/l1-reorgs/setup.js +57 -0
- package/dest/single-node/partial-proofs/setup.d.ts +5 -0
- package/dest/single-node/partial-proofs/setup.d.ts.map +1 -0
- package/dest/single-node/partial-proofs/setup.js +5 -0
- package/dest/single-node/proving/setup.d.ts +5 -0
- package/dest/single-node/proving/setup.d.ts.map +1 -0
- package/dest/single-node/proving/setup.js +5 -0
- package/dest/single-node/recovery/setup.d.ts +5 -0
- package/dest/single-node/recovery/setup.d.ts.map +1 -0
- package/dest/single-node/recovery/setup.js +5 -0
- package/dest/single-node/setup.d.ts +49 -0
- package/dest/single-node/setup.d.ts.map +1 -0
- package/dest/single-node/setup.js +56 -0
- package/dest/single-node/single_node_test_context.d.ts +374 -0
- package/dest/single-node/single_node_test_context.d.ts.map +1 -0
- package/dest/single-node/single_node_test_context.js +847 -0
- package/dest/spartan/setup_test_wallets.d.ts +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +31 -46
- package/dest/spartan/tx_metrics.d.ts +27 -4
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +105 -20
- package/dest/spartan/utils/config.d.ts +9 -35
- package/dest/spartan/utils/config.d.ts.map +1 -1
- package/dest/spartan/utils/gossip_metrics.d.ts +9 -0
- package/dest/spartan/utils/gossip_metrics.d.ts.map +1 -0
- package/dest/spartan/utils/gossip_metrics.js +77 -0
- package/dest/spartan/utils/index.d.ts +2 -1
- package/dest/spartan/utils/index.d.ts.map +1 -1
- package/dest/spartan/utils/index.js +2 -0
- package/dest/spartan/utils/nodes.js +2 -2
- package/dest/test-wallet/test_wallet.d.ts +39 -10
- package/dest/test-wallet/test_wallet.d.ts.map +1 -1
- package/dest/test-wallet/test_wallet.js +166 -59
- package/dest/test-wallet/utils.d.ts +38 -3
- package/dest/test-wallet/utils.d.ts.map +1 -1
- package/dest/test-wallet/utils.js +65 -10
- package/dest/test-wallet/wallet_worker_script.js +12 -4
- package/dest/test-wallet/worker_wallet.d.ts +9 -8
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet.js +10 -4
- package/dest/test-wallet/worker_wallet_schema.d.ts +3 -273
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet_schema.js +15 -2
- package/package.json +48 -43
- package/src/automine/README.md +60 -0
- package/src/automine/automine_test_context.ts +153 -0
- package/src/automine/delivery/interactive_handshake_responder.ts +125 -0
- package/src/automine/delivery/onchain_delivery_harness.ts +213 -0
- package/src/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.ts +24 -47
- package/src/{e2e_token_contract → automine/token}/token_contract_test.ts +25 -48
- package/src/automine/token/token_test_helpers.ts +138 -0
- package/src/bench/client_flows/benchmark.ts +21 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +77 -56
- package/src/bench/utils.ts +110 -6
- package/src/composed/ha/ha_full_setup.ts +466 -0
- package/src/fixtures/authwit_proxy.ts +4 -0
- package/src/fixtures/e2e_prover_test.ts +66 -48
- package/src/fixtures/fixtures.ts +100 -0
- package/src/fixtures/ha_setup.ts +11 -5
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +361 -256
- package/src/fixtures/setup_p2p_test.ts +15 -11
- package/src/fixtures/standard_contracts_genesis.ts +28 -0
- package/src/fixtures/timing.ts +97 -0
- package/src/fixtures/token_utils.ts +39 -4
- package/src/fixtures/utils.ts +2 -3
- package/src/fixtures/wait_helpers.ts +333 -0
- package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
- package/src/forward-compatibility/wallet_service.ts +106 -0
- package/src/guides/up_quick_start.sh +5 -2
- package/src/infra/README.md +12 -0
- package/src/install_legacy_contracts.cjs +81 -0
- package/src/legacy-jest-resolver.cjs +98 -0
- package/src/multi-node/README.md +96 -0
- package/src/multi-node/block-production/setup.ts +272 -0
- package/src/multi-node/governance/setup.ts +172 -0
- package/src/multi-node/multi_node_test_context.ts +447 -0
- package/src/multi-node/slashing/inactivity_setup.ts +139 -0
- package/src/multi-node/slashing/setup.ts +433 -0
- package/src/p2p/README.md +78 -0
- package/src/{e2e_p2p → p2p}/p2p_network.ts +95 -50
- package/src/{e2e_p2p → p2p}/reqresp/utils.ts +35 -28
- package/src/p2p/shared.ts +329 -0
- package/src/shared/cross_chain_test_harness.ts +36 -17
- package/src/shared/gas_portal_test_harness.ts +32 -14
- package/src/shared/submit-transactions.ts +13 -5
- package/src/shared/timing_env.d.mts +39 -0
- package/src/shared/timing_env.mjs +363 -0
- package/src/shared/uniswap_l1_l2.ts +80 -43
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +28 -14
- package/src/single-node/README.md +66 -0
- package/src/single-node/cross-chain/cross_chain_messaging_test.ts +302 -0
- package/src/single-node/cross-chain/message_test_helpers.ts +125 -0
- package/src/{e2e_fees → single-node/fees}/bridging_race.notest.ts +19 -5
- package/src/{e2e_fees → single-node/fees}/fees_test.ts +176 -70
- package/src/single-node/l1-reorgs/setup.ts +93 -0
- package/src/single-node/partial-proofs/setup.ts +8 -0
- package/src/single-node/proving/setup.ts +15 -0
- package/src/single-node/recovery/setup.ts +8 -0
- package/src/single-node/setup.ts +63 -0
- package/src/single-node/single_node_test_context.ts +1058 -0
- package/src/spartan/setup_test_wallets.ts +32 -41
- package/src/spartan/tx_metrics.ts +107 -23
- package/src/spartan/utils/gossip_metrics.ts +108 -0
- package/src/spartan/utils/index.ts +3 -0
- package/src/spartan/utils/nodes.ts +2 -2
- package/src/test-wallet/test_wallet.ts +185 -60
- package/src/test-wallet/utils.ts +104 -11
- package/src/test-wallet/wallet_worker_script.ts +11 -5
- package/src/test-wallet/worker_wallet.ts +19 -16
- package/src/test-wallet/worker_wallet_schema.ts +4 -3
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +0 -55
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +0 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -47
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +0 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +0 -129
- package/dest/e2e_deploy_contract/deploy_test.d.ts +0 -37
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +0 -1
- package/dest/e2e_deploy_contract/deploy_test.js +0 -50
- package/dest/e2e_epochs/epochs_test.d.ts +0 -104
- package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
- package/dest/e2e_epochs/epochs_test.js +0 -389
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.d.ts +0 -88
- package/dest/e2e_fees/fees_test.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.js +0 -255
- package/dest/e2e_l1_publisher/write_json.d.ts +0 -11
- package/dest/e2e_l1_publisher/write_json.d.ts.map +0 -1
- package/dest/e2e_l1_publisher/write_json.js +0 -56
- package/dest/e2e_multi_validator/utils.d.ts +0 -12
- package/dest/e2e_multi_validator/utils.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +0 -26
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +0 -54
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +0 -31
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +0 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +0 -136
- package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
- package/dest/e2e_p2p/reqresp/utils.d.ts +0 -22
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +0 -1
- package/dest/e2e_p2p/shared.d.ts +0 -66
- package/dest/e2e_p2p/shared.d.ts.map +0 -1
- package/dest/e2e_p2p/shared.js +0 -212
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +0 -2
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +0 -1
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +0 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts +0 -44
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +0 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +0 -193
- package/src/e2e_deploy_contract/deploy_test.ts +0 -85
- package/src/e2e_epochs/epochs_test.ts +0 -499
- package/src/e2e_l1_publisher/write_json.ts +0 -77
- package/src/e2e_nested_contract/nested_contract_test.ts +0 -75
- package/src/e2e_p2p/inactivity_slash_test.ts +0 -179
- package/src/e2e_p2p/shared.ts +0 -343
- /package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fetcher.js +0 -0
- /package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.js +0 -0
- /package/dest/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js} +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof.json +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fetcher.ts +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.ts +0 -0
- /package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts} +0 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NO_WAIT, toSendOptions } from '@aztec/aztec.js/contracts';
|
|
2
2
|
import { waitForTx } from '@aztec/aztec.js/node';
|
|
3
|
+
import { timesAsync } from '@aztec/foundation/collection';
|
|
4
|
+
import { sleep } from '@aztec/foundation/sleep';
|
|
3
5
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
4
6
|
import { Tx } from '@aztec/stdlib/tx';
|
|
5
7
|
import { inspect } from 'util';
|
|
8
|
+
import { testSpan, withTestSpanOwner } from '../fixtures/timing.js';
|
|
6
9
|
export class ProvenTx extends Tx {
|
|
7
10
|
node;
|
|
8
11
|
offchainEffects;
|
|
@@ -10,7 +13,10 @@ export class ProvenTx extends Tx {
|
|
|
10
13
|
constructor(node, tx, offchainEffects, stats){
|
|
11
14
|
super(tx.getTxHash(), tx.data, tx.chonkProof, tx.contractClassLogFields, tx.publicFunctionCalldata), this.node = node, this.offchainEffects = offchainEffects, this.stats = stats;
|
|
12
15
|
}
|
|
13
|
-
|
|
16
|
+
send(options) {
|
|
17
|
+
return testSpan('tx:send', ()=>this.sendInner(options));
|
|
18
|
+
}
|
|
19
|
+
async sendInner(options) {
|
|
14
20
|
const txHash = this.getTxHash();
|
|
15
21
|
await this.node.sendTx(this).catch((err)=>{
|
|
16
22
|
throw this.contextualizeError(err, inspect(this));
|
|
@@ -32,14 +38,63 @@ export class ProvenTx extends Tx {
|
|
|
32
38
|
return err;
|
|
33
39
|
}
|
|
34
40
|
}
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
export function proveInteraction(wallet, interaction, options) {
|
|
42
|
+
return testSpan('tx:prove', async ()=>{
|
|
43
|
+
const execPayload = await interaction.request(options);
|
|
44
|
+
return wallet.proveTx(execPayload, toSendOptions(options));
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Pre-proves `count` interactions built by `makeCall(i)` against `wallet`, all with the same
|
|
49
|
+
* `options`. Returns the proven txs so the caller can send them individually (e.g. with sleeps
|
|
50
|
+
* between sends, or anchored to intermediate tips). For the common "send the whole batch at once"
|
|
51
|
+
* case use {@link proveAndSendTxs}.
|
|
52
|
+
*/ export function proveTxs(wallet, count, makeCall, options) {
|
|
53
|
+
return timesAsync(count, (i)=>proveInteraction(wallet, makeCall(i), options));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Pre-proves `count` interactions built by `makeCall(i)` and sends each one with `NO_WAIT`, all at
|
|
57
|
+
* once. Returns the tx hashes in batch order. Pairs with `waitForTxs` for the "send N, wait for N"
|
|
58
|
+
* arc. Use {@link proveTxs} instead when the sends need bespoke sequencing.
|
|
59
|
+
*/ export async function proveAndSendTxs(wallet, count, makeCall, options) {
|
|
60
|
+
const txs = await proveTxs(wallet, count, makeCall, options);
|
|
61
|
+
return Promise.all(txs.map((tx)=>tx.send({
|
|
62
|
+
wait: NO_WAIT
|
|
63
|
+
})));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Starts a background loop that keeps `node`'s mempool topped up: whenever the pending-tx count drops
|
|
67
|
+
* below `opts.minPending`, it proves and sends one interaction built by `makeCall()` (NO_WAIT). Errors
|
|
68
|
+
* are swallowed and retried. Returns an {@link AsyncDisposable}; disposing stops the loop and awaits it.
|
|
69
|
+
*/ export function startMempoolFeeder(wallet, node, makeCall, opts) {
|
|
70
|
+
const minPending = opts.minPending ?? 3;
|
|
71
|
+
const intervalMs = opts.intervalMs ?? 1000;
|
|
72
|
+
let stopped = false;
|
|
73
|
+
// Pin the feeder's prove/send spans to a fixed non-test owner. It runs interleaved with arbitrary
|
|
74
|
+
// tests, so without this its tx:prove/tx:send spans would smear onto whichever test was current
|
|
75
|
+
// when each round fired; the pinned owner matches no test/suite record, excluding them cleanly.
|
|
76
|
+
const loop = withTestSpanOwner('other:mempool-feeder', async ()=>{
|
|
77
|
+
while(!stopped){
|
|
78
|
+
try {
|
|
79
|
+
const pendingCount = await node.getPendingTxCount();
|
|
80
|
+
if (pendingCount < minPending) {
|
|
81
|
+
await proveAndSendTxs(wallet, 1, makeCall, {
|
|
82
|
+
from: opts.from
|
|
83
|
+
});
|
|
84
|
+
opts.logger?.verbose(`Topped up mempool (was ${pendingCount})`);
|
|
85
|
+
}
|
|
86
|
+
} catch (err) {
|
|
87
|
+
opts.logger?.verbose(`Mempool top-up error (will retry): ${err}`);
|
|
88
|
+
}
|
|
89
|
+
await sleep(intervalMs);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return {
|
|
93
|
+
async [Symbol.asyncDispose] () {
|
|
94
|
+
stopped = true;
|
|
95
|
+
await loop;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
43
98
|
}
|
|
44
99
|
/**
|
|
45
100
|
* Mutable wrapper around an AztecNode that forwards all calls to the current target.
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { DefaultWaitOpts } from '@aztec/aztec.js/contracts';
|
|
1
2
|
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
3
|
+
import { BackendType, BarretenbergSync } from '@aztec/bb.js';
|
|
2
4
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
5
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
|
-
import { parseWithOptionals, schemaHasMethod } from '@aztec/foundation/schemas';
|
|
6
|
+
import { getSchemaParameters, parseWithOptionals, schemaHasMethod } from '@aztec/foundation/schemas';
|
|
5
7
|
import { NodeListener, TransportServer } from '@aztec/foundation/transport';
|
|
6
8
|
import { Tx } from '@aztec/stdlib/tx';
|
|
7
9
|
import { workerData } from 'worker_threads';
|
|
@@ -14,15 +16,21 @@ try {
|
|
|
14
16
|
nodeUrl
|
|
15
17
|
});
|
|
16
18
|
const node = createAztecNodeClient(nodeUrl);
|
|
19
|
+
// Worker sync bb use is limited to crypto and proof serialization helpers.
|
|
20
|
+
await BarretenbergSync.initSingleton({
|
|
21
|
+
backend: BackendType.Wasm
|
|
22
|
+
});
|
|
17
23
|
const wallet = await TestWallet.create(node, pxeConfig);
|
|
24
|
+
// Worker wallets are only used by spartan tests against remote JSON-RPC nodes: keep the 1s poll cadence.
|
|
25
|
+
wallet.setDefaultWaitInterval(DefaultWaitOpts.interval);
|
|
18
26
|
logger.info('Worker wallet initialized');
|
|
19
27
|
const customMethods = {
|
|
20
28
|
proveTx: async (exec, opts)=>{
|
|
21
29
|
const provenTx = await wallet.proveTx(exec, opts);
|
|
22
30
|
return new Tx(provenTx.getTxHash(), provenTx.data, provenTx.chonkProof, provenTx.contractClassLogFields, provenTx.publicFunctionCalldata);
|
|
23
31
|
},
|
|
24
|
-
registerAccount: async (secret, salt)=>{
|
|
25
|
-
const manager = await wallet.createSchnorrAccount(secret, salt);
|
|
32
|
+
registerAccount: async (secret, salt, signingKey)=>{
|
|
33
|
+
const manager = await wallet.createSchnorrAccount(secret, salt, signingKey);
|
|
26
34
|
return manager.address;
|
|
27
35
|
}
|
|
28
36
|
};
|
|
@@ -33,7 +41,7 @@ try {
|
|
|
33
41
|
throw new Error(`Unknown method: ${msg.fn}`);
|
|
34
42
|
}
|
|
35
43
|
const jsonParams = JSON.parse(msg.args);
|
|
36
|
-
const args = await parseWithOptionals(jsonParams, schema[msg.fn]
|
|
44
|
+
const args = await parseWithOptionals(jsonParams, getSchemaParameters(schema[msg.fn]));
|
|
37
45
|
// we have to erase the fn type in order to be able to spread ...args
|
|
38
46
|
const handler = msg.fn in customMethods ? customMethods[msg.fn] : undefined;
|
|
39
47
|
const result = handler ? await handler(...args) : await wallet[msg.fn](...args);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { CallIntent, IntentInnerHash } from '@aztec/aztec.js/authorization';
|
|
2
2
|
import type { InteractionWaitOptions, SendReturn } from '@aztec/aztec.js/contracts';
|
|
3
|
-
import type { Aliased, AppCapabilities, BatchResults, BatchedMethod, ContractClassMetadata, ContractMetadata, ExecuteUtilityOptions, PrivateEvent, PrivateEventFilter, ProfileOptions, SendOptions, SimulateOptions, Wallet, WalletCapabilities } from '@aztec/aztec.js/wallet';
|
|
3
|
+
import type { Aliased, AppCapabilities, BatchResults, BatchedMethod, ContractClassMetadata, ContractMetadata, ExecuteUtilityOptions, PrivateEvent, PrivateEventFilter, ProfileOptions, SendOptions, SimulateOptions, TxSimulationResultWithAppOffset, Wallet, WalletCapabilities } from '@aztec/aztec.js/wallet';
|
|
4
4
|
import type { ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
5
|
-
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
|
+
import type { Fq, Fr } from '@aztec/foundation/curves/bn254';
|
|
6
6
|
import type { PXEConfig } from '@aztec/pxe/config';
|
|
7
7
|
import type { ContractArtifact, EventMetadataDefinition, FunctionCall } from '@aztec/stdlib/abi';
|
|
8
8
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
9
9
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
10
|
-
import type {
|
|
11
|
-
import type { ExecutionPayload, TxProfileResult,
|
|
10
|
+
import type { ContractInstancePreimage } from '@aztec/stdlib/contract';
|
|
11
|
+
import type { ExecutionPayload, TxProfileResult, UtilityExecutionResult } from '@aztec/stdlib/tx';
|
|
12
12
|
import { Tx } from '@aztec/stdlib/tx';
|
|
13
13
|
/**
|
|
14
14
|
* Wallet implementation that offloads all work to a worker thread.
|
|
@@ -35,18 +35,19 @@ export declare class WorkerWallet implements Wallet {
|
|
|
35
35
|
registerSender(address: AztecAddress, alias?: string): Promise<AztecAddress>;
|
|
36
36
|
getAddressBook(): Promise<Aliased<AztecAddress>[]>;
|
|
37
37
|
getAccounts(): Promise<Aliased<AztecAddress>[]>;
|
|
38
|
-
registerContract(instance:
|
|
39
|
-
|
|
38
|
+
registerContract(instance: ContractInstancePreimage, artifact?: ContractArtifact, secretKey?: Fr): Promise<void>;
|
|
39
|
+
registerContractClass(artifact: ContractArtifact): Promise<void>;
|
|
40
|
+
simulateTx(exec: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResultWithAppOffset>;
|
|
40
41
|
executeUtility(call: FunctionCall, opts: ExecuteUtilityOptions): Promise<UtilityExecutionResult>;
|
|
41
42
|
profileTx(exec: ExecutionPayload, opts: ProfileOptions): Promise<TxProfileResult>;
|
|
42
43
|
sendTx<W extends InteractionWaitOptions = undefined>(exec: ExecutionPayload, opts: SendOptions<W>): Promise<SendReturn<W>>;
|
|
43
44
|
proveTx(exec: ExecutionPayload, opts: Omit<SendOptions, 'wait'>): Promise<Tx>;
|
|
44
45
|
/** Registers an account inside the worker's TestWallet, populating its accounts map. */
|
|
45
|
-
registerAccount(secret: Fr, salt: Fr): Promise<AztecAddress>;
|
|
46
|
+
registerAccount(secret: Fr, salt: Fr, signingKey: Fq): Promise<AztecAddress>;
|
|
46
47
|
createAuthWit(from: AztecAddress, messageHashOrIntent: IntentInnerHash | CallIntent): Promise<AuthWitness>;
|
|
47
48
|
requestCapabilities(manifest: AppCapabilities): Promise<WalletCapabilities>;
|
|
48
49
|
batch<const T extends readonly BatchedMethod[]>(methods: T): Promise<BatchResults<T>>;
|
|
49
50
|
/** Shuts down the worker thread and closes the transport. */
|
|
50
51
|
stop(): Promise<void>;
|
|
51
52
|
}
|
|
52
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
53
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya2VyX3dhbGxldC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Rlc3Qtd2FsbGV0L3dvcmtlcl93YWxsZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLGVBQWUsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBQ2pGLE9BQU8sS0FBSyxFQUFFLHNCQUFzQixFQUFFLFVBQVUsRUFBRSxNQUFNLDJCQUEy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FtQixDQUFDLFFBQVEsRUFBRSxlQUFlLEdBQUcsT0FBTyxDQUFDLGtCQUFrQixDQUFDLENBRTFFO0lBRUQsS0FBSyxDQUFDLEtBQUssQ0FBQyxDQUFDLFNBQVMsU0FBUyxhQUFhLEVBQUUsRUFBRSxPQUFPLEVBQUUsQ0FBQyxHQUFHLE9BQU8sQ0FBQyxZQUFZLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FFcEY7SUFFRCw2REFBNkQ7SUFDdkQsSUFBSSxJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FHMUI7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker_wallet.d.ts","sourceRoot":"","sources":["../../src/test-wallet/worker_wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,KAAK,EACV,OAAO,EACP,eAAe,EACf,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,eAAe,EACf,MAAM,EACN,kBAAkB,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"worker_wallet.d.ts","sourceRoot":"","sources":["../../src/test-wallet/worker_wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,KAAK,EACV,OAAO,EACP,eAAe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5E;IAED,wFAAwF;IACxF,eAAe,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAE3E;IAED,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,GAAG,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAEzG;IAED,mBAAmB,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAE1E;IAED,KAAK,CAAC,KAAK,CAAC,CAAC,SAAS,SAAS,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAEpF;IAED,6DAA6D;IACvD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAG1B;CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
2
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
3
|
import { promiseWithResolvers } from '@aztec/foundation/promise';
|
|
4
|
+
import { getSchemaReturnType } from '@aztec/foundation/schemas';
|
|
4
5
|
import { sleep } from '@aztec/foundation/sleep';
|
|
5
6
|
import { NodeConnector, TransportClient } from '@aztec/foundation/transport';
|
|
6
7
|
import { Worker } from 'worker_threads';
|
|
@@ -39,7 +40,7 @@ const WORKER_READY_TIMEOUT_MS = 120_000;
|
|
|
39
40
|
...process.stderr.isTTY || process.env.FORCE_COLOR ? {
|
|
40
41
|
FORCE_COLOR: '1'
|
|
41
42
|
} : {},
|
|
42
|
-
LOG_LEVEL: process.env.WORKER_LOG_LEVEL ?? '
|
|
43
|
+
LOG_LEVEL: process.env.WORKER_LOG_LEVEL ?? 'info'
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
46
|
const connector = new NodeConnector(worker);
|
|
@@ -91,7 +92,9 @@ const WORKER_READY_TIMEOUT_MS = 120_000;
|
|
|
91
92
|
async call(fn, ...args) {
|
|
92
93
|
const resultJson = await this.callRaw(fn, ...args);
|
|
93
94
|
const methodSchema = WorkerWalletSchema[fn];
|
|
94
|
-
|
|
95
|
+
// Void-returning methods (e.g. registerContract) serialize to `undefined` on the worker side, which
|
|
96
|
+
// JSON.parse cannot handle; hand it straight to the schema, whose `z.void()` output accepts undefined.
|
|
97
|
+
return getSchemaReturnType(methodSchema).parseAsync(resultJson === undefined ? undefined : JSON.parse(resultJson));
|
|
95
98
|
}
|
|
96
99
|
getChainInfo() {
|
|
97
100
|
return this.call('getChainInfo');
|
|
@@ -117,6 +120,9 @@ const WORKER_READY_TIMEOUT_MS = 120_000;
|
|
|
117
120
|
registerContract(instance, artifact, secretKey) {
|
|
118
121
|
return this.call('registerContract', instance, artifact, secretKey);
|
|
119
122
|
}
|
|
123
|
+
registerContractClass(artifact) {
|
|
124
|
+
return this.call('registerContractClass', artifact);
|
|
125
|
+
}
|
|
120
126
|
simulateTx(exec, opts) {
|
|
121
127
|
return this.call('simulateTx', exec, opts);
|
|
122
128
|
}
|
|
@@ -132,8 +138,8 @@ const WORKER_READY_TIMEOUT_MS = 120_000;
|
|
|
132
138
|
proveTx(exec, opts) {
|
|
133
139
|
return this.call('proveTx', exec, opts);
|
|
134
140
|
}
|
|
135
|
-
/** Registers an account inside the worker's TestWallet, populating its accounts map. */ registerAccount(secret, salt) {
|
|
136
|
-
return this.call('registerAccount', secret, salt);
|
|
141
|
+
/** Registers an account inside the worker's TestWallet, populating its accounts map. */ registerAccount(secret, salt, signingKey) {
|
|
142
|
+
return this.call('registerAccount', secret, salt, signingKey);
|
|
137
143
|
}
|
|
138
144
|
createAuthWit(from, messageHashOrIntent) {
|
|
139
145
|
return this.call('createAuthWit', from, messageHashOrIntent);
|
|
@@ -1,274 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Tx } from '@aztec/stdlib/tx';
|
|
3
|
-
import { z } from 'zod';
|
|
1
|
+
import type { ApiSchema } from '@aztec/foundation/schemas';
|
|
4
2
|
/** Schema for the WorkerWallet API — extends WalletSchema with proveTx and registerAccount. */
|
|
5
|
-
export declare const WorkerWalletSchema:
|
|
6
|
-
|
|
7
|
-
getChainInfo: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<import("@aztec/entrypoints/interfaces").ChainInfo, z.ZodTypeDef, any>>;
|
|
8
|
-
getContractMetadata: z.ZodFunction<z.ZodTuple<[z.ZodType<AztecAddress, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/aztec.js/wallet").ContractMetadata, z.ZodTypeDef, any>>;
|
|
9
|
-
getContractClassMetadata: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/foundation/schemas").Fr, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/aztec.js/wallet").ContractClassMetadata, z.ZodTypeDef, any>>;
|
|
10
|
-
registerSender: z.ZodFunction<z.ZodTuple<[z.ZodType<AztecAddress, z.ZodTypeDef, any>, alias?: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodType<string | undefined, z.ZodTypeDef, any>> | undefined], z.ZodUnknown>, z.ZodType<AztecAddress, z.ZodTypeDef, any>>;
|
|
11
|
-
getAddressBook: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<import("@aztec/aztec.js/wallet").Aliased<AztecAddress>[], z.ZodTypeDef, any>>;
|
|
12
|
-
getAccounts: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<import("@aztec/aztec.js/wallet").Aliased<AztecAddress>[], z.ZodTypeDef, any>>;
|
|
13
|
-
registerContract: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/stdlib/contract").ContractInstanceWithAddress, z.ZodTypeDef, any>, artifact?: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodType<import("@aztec/stdlib/abi").ContractArtifact | undefined, z.ZodTypeDef, any>> | undefined, secretKey?: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodType<import("@aztec/foundation/schemas").Fr | undefined, z.ZodTypeDef, any>> | undefined], z.ZodUnknown>, z.ZodType<import("@aztec/stdlib/contract").ContractInstanceWithAddress, z.ZodTypeDef, any>>;
|
|
14
|
-
simulateTx: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/stdlib/tx").ExecutionPayload, z.ZodTypeDef, any>, opts: z.ZodType<import("@aztec/aztec.js/wallet").SimulateOptions, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/stdlib/tx").TxSimulationResult, z.ZodTypeDef, any>>;
|
|
15
|
-
executeUtility: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/stdlib/abi").FunctionCall, z.ZodTypeDef, any>, opts: z.ZodType<import("@aztec/aztec.js/wallet").ExecuteUtilityOptions, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/stdlib/tx").UtilityExecutionResult, z.ZodTypeDef, any>>;
|
|
16
|
-
profileTx: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/stdlib/tx").ExecutionPayload, z.ZodTypeDef, any>, opts: z.ZodType<import("@aztec/aztec.js/wallet").ProfileOptions, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/stdlib/tx").TxProfileResult, z.ZodTypeDef, any>>;
|
|
17
|
-
sendTx: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/stdlib/tx").ExecutionPayload, z.ZodTypeDef, any>, opts: z.ZodType<import("@aztec/aztec.js/wallet").SendOptions<import("@aztec/aztec.js/contracts").InteractionWaitOptions>, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/aztec.js/contracts").TxSendResultImmediate | import("@aztec/aztec.js/contracts").TxSendResultMined<import("@aztec/stdlib/tx").TxReceipt>, z.ZodTypeDef, any>>;
|
|
18
|
-
createAuthWit: z.ZodFunction<z.ZodTuple<[z.ZodType<AztecAddress, z.ZodTypeDef, any>, messageHashOrIntent: z.ZodType<import("@aztec/aztec.js/authorization").CallIntent | import("@aztec/aztec.js/authorization").IntentInnerHash, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/stdlib/auth-witness").AuthWitness, z.ZodTypeDef, any>>;
|
|
19
|
-
requestCapabilities: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/aztec.js/wallet").AppCapabilities, z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<import("@aztec/aztec.js/wallet").WalletCapabilities, z.ZodTypeDef, any>>;
|
|
20
|
-
batch: z.ZodFunction<z.ZodTuple<[z.ZodType<readonly import("@aztec/aztec.js/wallet").BatchedMethod[], z.ZodTypeDef, any>], z.ZodUnknown>, z.ZodType<readonly import("@aztec/aztec.js/wallet").BatchedMethodResultWrapper<import("@aztec/aztec.js/wallet").BatchedMethod>[], z.ZodTypeDef, any>>;
|
|
21
|
-
proveTx: z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
22
|
-
calls: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
23
|
-
name: z.ZodString;
|
|
24
|
-
to: import("@aztec/foundation/schemas").ZodFor<AztecAddress>;
|
|
25
|
-
selector: import("@aztec/foundation/schemas").ZodFor<import("@aztec/stdlib/abi").FunctionSelector>;
|
|
26
|
-
type: z.ZodNativeEnum<typeof import("@aztec/stdlib/abi").FunctionType>;
|
|
27
|
-
isStatic: z.ZodBoolean;
|
|
28
|
-
hideMsgSender: z.ZodBoolean;
|
|
29
|
-
args: z.ZodArray<import("@aztec/foundation/schemas").ZodFor<import("@aztec/foundation/schemas").Fr>, "many">;
|
|
30
|
-
returnTypes: z.ZodArray<z.ZodType<import("@aztec/stdlib/abi").AbiType, z.ZodTypeDef, import("@aztec/stdlib/abi").AbiType>, "many">;
|
|
31
|
-
}, "strip", z.ZodTypeAny, {
|
|
32
|
-
name: string;
|
|
33
|
-
to: AztecAddress;
|
|
34
|
-
selector: import("@aztec/stdlib/abi").FunctionSelector;
|
|
35
|
-
type: import("@aztec/stdlib/abi").FunctionType;
|
|
36
|
-
isStatic: boolean;
|
|
37
|
-
hideMsgSender: boolean;
|
|
38
|
-
args: import("@aztec/foundation/schemas").Fr[];
|
|
39
|
-
returnTypes: import("@aztec/stdlib/abi").AbiType[];
|
|
40
|
-
}, {
|
|
41
|
-
name: string;
|
|
42
|
-
to?: any;
|
|
43
|
-
selector?: any;
|
|
44
|
-
type: import("@aztec/stdlib/abi").FunctionType;
|
|
45
|
-
isStatic: boolean;
|
|
46
|
-
hideMsgSender: boolean;
|
|
47
|
-
args: any[];
|
|
48
|
-
returnTypes: import("@aztec/stdlib/abi").AbiType[];
|
|
49
|
-
}>, import("@aztec/stdlib/abi").FunctionCall, {
|
|
50
|
-
name: string;
|
|
51
|
-
to?: any;
|
|
52
|
-
selector?: any;
|
|
53
|
-
type: import("@aztec/stdlib/abi").FunctionType;
|
|
54
|
-
isStatic: boolean;
|
|
55
|
-
hideMsgSender: boolean;
|
|
56
|
-
args: any[];
|
|
57
|
-
returnTypes: import("@aztec/stdlib/abi").AbiType[];
|
|
58
|
-
}>, "many">;
|
|
59
|
-
authWitnesses: z.ZodArray<z.ZodType<import("@aztec/stdlib/auth-witness").AuthWitness, any, string>, "many">;
|
|
60
|
-
capsules: z.ZodArray<z.ZodType<import("@aztec/stdlib/tx").Capsule, any, string>, "many">;
|
|
61
|
-
extraHashedArgs: z.ZodArray<import("@aztec/foundation/schemas").ZodFor<import("@aztec/stdlib/tx").HashedValues>, "many">;
|
|
62
|
-
feePayer: import("@aztec/foundation/schemas").ZodNullableOptional<import("@aztec/foundation/schemas").ZodFor<AztecAddress>>;
|
|
63
|
-
}, "strip", z.ZodTypeAny, {
|
|
64
|
-
calls: import("@aztec/stdlib/abi").FunctionCall[];
|
|
65
|
-
authWitnesses: import("@aztec/stdlib/auth-witness").AuthWitness[];
|
|
66
|
-
capsules: import("@aztec/stdlib/tx").Capsule[];
|
|
67
|
-
extraHashedArgs: import("@aztec/stdlib/tx").HashedValues[];
|
|
68
|
-
feePayer?: AztecAddress | undefined;
|
|
69
|
-
}, {
|
|
70
|
-
calls: {
|
|
71
|
-
name: string;
|
|
72
|
-
to?: any;
|
|
73
|
-
selector?: any;
|
|
74
|
-
type: import("@aztec/stdlib/abi").FunctionType;
|
|
75
|
-
isStatic: boolean;
|
|
76
|
-
hideMsgSender: boolean;
|
|
77
|
-
args: any[];
|
|
78
|
-
returnTypes: import("@aztec/stdlib/abi").AbiType[];
|
|
79
|
-
}[];
|
|
80
|
-
authWitnesses: string[];
|
|
81
|
-
capsules: string[];
|
|
82
|
-
extraHashedArgs: any[];
|
|
83
|
-
feePayer?: any;
|
|
84
|
-
}>, z.ZodObject<{
|
|
85
|
-
from: z.ZodUnion<[import("@aztec/foundation/schemas").ZodFor<AztecAddress>, z.ZodLiteral<"NO_FROM">]>;
|
|
86
|
-
authWitnesses: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodArray<z.ZodType<import("@aztec/stdlib/auth-witness").AuthWitness, any, string>, "many">>;
|
|
87
|
-
capsules: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodArray<z.ZodType<import("@aztec/stdlib/tx").Capsule, any, string>, "many">>;
|
|
88
|
-
fee: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodObject<{
|
|
89
|
-
gasSettings: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodObject<{
|
|
90
|
-
gasLimits: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodEffects<z.ZodObject<{
|
|
91
|
-
daGas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
92
|
-
l2Gas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
93
|
-
}, "strip", z.ZodTypeAny, {
|
|
94
|
-
daGas: number;
|
|
95
|
-
l2Gas: number;
|
|
96
|
-
}, {
|
|
97
|
-
daGas: string | number | bigint;
|
|
98
|
-
l2Gas: string | number | bigint;
|
|
99
|
-
}>, import("@aztec/stdlib/gas").Gas, {
|
|
100
|
-
daGas: string | number | bigint;
|
|
101
|
-
l2Gas: string | number | bigint;
|
|
102
|
-
}>>;
|
|
103
|
-
teardownGasLimits: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodEffects<z.ZodObject<{
|
|
104
|
-
daGas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
105
|
-
l2Gas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
106
|
-
}, "strip", z.ZodTypeAny, {
|
|
107
|
-
daGas: number;
|
|
108
|
-
l2Gas: number;
|
|
109
|
-
}, {
|
|
110
|
-
daGas: string | number | bigint;
|
|
111
|
-
l2Gas: string | number | bigint;
|
|
112
|
-
}>, import("@aztec/stdlib/gas").Gas, {
|
|
113
|
-
daGas: string | number | bigint;
|
|
114
|
-
l2Gas: string | number | bigint;
|
|
115
|
-
}>>;
|
|
116
|
-
maxFeePerGas: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodObject<{
|
|
117
|
-
feePerDaGas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
118
|
-
feePerL2Gas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
119
|
-
}, "strip", z.ZodTypeAny, {
|
|
120
|
-
feePerDaGas: bigint;
|
|
121
|
-
feePerL2Gas: bigint;
|
|
122
|
-
}, {
|
|
123
|
-
feePerDaGas: string | number | bigint;
|
|
124
|
-
feePerL2Gas: string | number | bigint;
|
|
125
|
-
}>>;
|
|
126
|
-
maxPriorityFeePerGas: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodObject<{
|
|
127
|
-
feePerDaGas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
128
|
-
feePerL2Gas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
129
|
-
}, "strip", z.ZodTypeAny, {
|
|
130
|
-
feePerDaGas: bigint;
|
|
131
|
-
feePerL2Gas: bigint;
|
|
132
|
-
}, {
|
|
133
|
-
feePerDaGas: string | number | bigint;
|
|
134
|
-
feePerL2Gas: string | number | bigint;
|
|
135
|
-
}>>;
|
|
136
|
-
}, "strip", z.ZodTypeAny, {
|
|
137
|
-
gasLimits?: import("@aztec/stdlib/gas").Gas | undefined;
|
|
138
|
-
teardownGasLimits?: import("@aztec/stdlib/gas").Gas | undefined;
|
|
139
|
-
maxFeePerGas?: {
|
|
140
|
-
feePerDaGas: bigint;
|
|
141
|
-
feePerL2Gas: bigint;
|
|
142
|
-
} | undefined;
|
|
143
|
-
maxPriorityFeePerGas?: {
|
|
144
|
-
feePerDaGas: bigint;
|
|
145
|
-
feePerL2Gas: bigint;
|
|
146
|
-
} | undefined;
|
|
147
|
-
}, {
|
|
148
|
-
gasLimits?: {
|
|
149
|
-
daGas: string | number | bigint;
|
|
150
|
-
l2Gas: string | number | bigint;
|
|
151
|
-
} | undefined;
|
|
152
|
-
teardownGasLimits?: {
|
|
153
|
-
daGas: string | number | bigint;
|
|
154
|
-
l2Gas: string | number | bigint;
|
|
155
|
-
} | undefined;
|
|
156
|
-
maxFeePerGas?: {
|
|
157
|
-
feePerDaGas: string | number | bigint;
|
|
158
|
-
feePerL2Gas: string | number | bigint;
|
|
159
|
-
} | undefined;
|
|
160
|
-
maxPriorityFeePerGas?: {
|
|
161
|
-
feePerDaGas: string | number | bigint;
|
|
162
|
-
feePerL2Gas: string | number | bigint;
|
|
163
|
-
} | undefined;
|
|
164
|
-
}>>;
|
|
165
|
-
}, "strip", z.ZodTypeAny, {
|
|
166
|
-
gasSettings?: {
|
|
167
|
-
gasLimits?: import("@aztec/stdlib/gas").Gas | undefined;
|
|
168
|
-
teardownGasLimits?: import("@aztec/stdlib/gas").Gas | undefined;
|
|
169
|
-
maxFeePerGas?: {
|
|
170
|
-
feePerDaGas: bigint;
|
|
171
|
-
feePerL2Gas: bigint;
|
|
172
|
-
} | undefined;
|
|
173
|
-
maxPriorityFeePerGas?: {
|
|
174
|
-
feePerDaGas: bigint;
|
|
175
|
-
feePerL2Gas: bigint;
|
|
176
|
-
} | undefined;
|
|
177
|
-
} | undefined;
|
|
178
|
-
}, {
|
|
179
|
-
gasSettings?: {
|
|
180
|
-
gasLimits?: {
|
|
181
|
-
daGas: string | number | bigint;
|
|
182
|
-
l2Gas: string | number | bigint;
|
|
183
|
-
} | undefined;
|
|
184
|
-
teardownGasLimits?: {
|
|
185
|
-
daGas: string | number | bigint;
|
|
186
|
-
l2Gas: string | number | bigint;
|
|
187
|
-
} | undefined;
|
|
188
|
-
maxFeePerGas?: {
|
|
189
|
-
feePerDaGas: string | number | bigint;
|
|
190
|
-
feePerL2Gas: string | number | bigint;
|
|
191
|
-
} | undefined;
|
|
192
|
-
maxPriorityFeePerGas?: {
|
|
193
|
-
feePerDaGas: string | number | bigint;
|
|
194
|
-
feePerL2Gas: string | number | bigint;
|
|
195
|
-
} | undefined;
|
|
196
|
-
} | undefined;
|
|
197
|
-
}>>;
|
|
198
|
-
wait: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodUnion<[z.ZodLiteral<"NO_WAIT">, z.ZodObject<{
|
|
199
|
-
ignoreDroppedReceiptsFor: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodNumber>;
|
|
200
|
-
timeout: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodNumber>;
|
|
201
|
-
interval: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodNumber>;
|
|
202
|
-
dontThrowOnRevert: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodBoolean>;
|
|
203
|
-
}, "strip", z.ZodTypeAny, {
|
|
204
|
-
ignoreDroppedReceiptsFor?: number | undefined;
|
|
205
|
-
timeout?: number | undefined;
|
|
206
|
-
interval?: number | undefined;
|
|
207
|
-
dontThrowOnRevert?: boolean | undefined;
|
|
208
|
-
}, {
|
|
209
|
-
ignoreDroppedReceiptsFor?: number | undefined;
|
|
210
|
-
timeout?: number | undefined;
|
|
211
|
-
interval?: number | undefined;
|
|
212
|
-
dontThrowOnRevert?: boolean | undefined;
|
|
213
|
-
}>]>>;
|
|
214
|
-
additionalScopes: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodArray<import("@aztec/foundation/schemas").ZodFor<AztecAddress>, "many">>;
|
|
215
|
-
}, "strip", z.ZodTypeAny, {
|
|
216
|
-
from: "NO_FROM" | AztecAddress;
|
|
217
|
-
authWitnesses?: import("@aztec/stdlib/auth-witness").AuthWitness[] | undefined;
|
|
218
|
-
capsules?: import("@aztec/stdlib/tx").Capsule[] | undefined;
|
|
219
|
-
fee?: {
|
|
220
|
-
gasSettings?: {
|
|
221
|
-
gasLimits?: import("@aztec/stdlib/gas").Gas | undefined;
|
|
222
|
-
teardownGasLimits?: import("@aztec/stdlib/gas").Gas | undefined;
|
|
223
|
-
maxFeePerGas?: {
|
|
224
|
-
feePerDaGas: bigint;
|
|
225
|
-
feePerL2Gas: bigint;
|
|
226
|
-
} | undefined;
|
|
227
|
-
maxPriorityFeePerGas?: {
|
|
228
|
-
feePerDaGas: bigint;
|
|
229
|
-
feePerL2Gas: bigint;
|
|
230
|
-
} | undefined;
|
|
231
|
-
} | undefined;
|
|
232
|
-
} | undefined;
|
|
233
|
-
wait?: "NO_WAIT" | {
|
|
234
|
-
ignoreDroppedReceiptsFor?: number | undefined;
|
|
235
|
-
timeout?: number | undefined;
|
|
236
|
-
interval?: number | undefined;
|
|
237
|
-
dontThrowOnRevert?: boolean | undefined;
|
|
238
|
-
} | undefined;
|
|
239
|
-
additionalScopes?: AztecAddress[] | undefined;
|
|
240
|
-
}, {
|
|
241
|
-
from?: any;
|
|
242
|
-
authWitnesses?: string[] | undefined;
|
|
243
|
-
capsules?: string[] | undefined;
|
|
244
|
-
fee?: {
|
|
245
|
-
gasSettings?: {
|
|
246
|
-
gasLimits?: {
|
|
247
|
-
daGas: string | number | bigint;
|
|
248
|
-
l2Gas: string | number | bigint;
|
|
249
|
-
} | undefined;
|
|
250
|
-
teardownGasLimits?: {
|
|
251
|
-
daGas: string | number | bigint;
|
|
252
|
-
l2Gas: string | number | bigint;
|
|
253
|
-
} | undefined;
|
|
254
|
-
maxFeePerGas?: {
|
|
255
|
-
feePerDaGas: string | number | bigint;
|
|
256
|
-
feePerL2Gas: string | number | bigint;
|
|
257
|
-
} | undefined;
|
|
258
|
-
maxPriorityFeePerGas?: {
|
|
259
|
-
feePerDaGas: string | number | bigint;
|
|
260
|
-
feePerL2Gas: string | number | bigint;
|
|
261
|
-
} | undefined;
|
|
262
|
-
} | undefined;
|
|
263
|
-
} | undefined;
|
|
264
|
-
wait?: "NO_WAIT" | {
|
|
265
|
-
ignoreDroppedReceiptsFor?: number | undefined;
|
|
266
|
-
timeout?: number | undefined;
|
|
267
|
-
interval?: number | undefined;
|
|
268
|
-
dontThrowOnRevert?: boolean | undefined;
|
|
269
|
-
} | undefined;
|
|
270
|
-
additionalScopes?: any[] | undefined;
|
|
271
|
-
}>], z.ZodUnknown>, import("@aztec/foundation/schemas").ZodFor<Tx>>;
|
|
272
|
-
registerAccount: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>, z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>], z.ZodUnknown>, import("@aztec/foundation/schemas").ZodFor<AztecAddress>>;
|
|
273
|
-
};
|
|
274
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya2VyX3dhbGxldF9zY2hlbWEuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0LXdhbGxldC93b3JrZXJfd2FsbGV0X3NjaGVtYS50cyJdLCJ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CxpR0FBK0Y7QUFDL0YsZUFBTyxNQUFNLGtCQUFrQixFQUFFLFNBSWhDLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker_wallet_schema.d.ts","sourceRoot":"","sources":["../../src/test-wallet/worker_wallet_schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worker_wallet_schema.d.ts","sourceRoot":"","sources":["../../src/test-wallet/worker_wallet_schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAO3D,iGAA+F;AAC/F,eAAO,MAAM,kBAAkB,EAAE,SAIhC,CAAC"}
|
|
@@ -5,6 +5,19 @@ import { Tx } from '@aztec/stdlib/tx';
|
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
/** Schema for the WorkerWallet API — extends WalletSchema with proveTx and registerAccount. */ export const WorkerWalletSchema = {
|
|
7
7
|
...WalletSchema,
|
|
8
|
-
proveTx: z.function(
|
|
9
|
-
|
|
8
|
+
proveTx: z.function({
|
|
9
|
+
input: z.tuple([
|
|
10
|
+
ExecutionPayloadSchema,
|
|
11
|
+
SendOptionsSchema
|
|
12
|
+
]),
|
|
13
|
+
output: Tx.schema
|
|
14
|
+
}),
|
|
15
|
+
registerAccount: z.function({
|
|
16
|
+
input: z.tuple([
|
|
17
|
+
schemas.Fr,
|
|
18
|
+
schemas.Fr,
|
|
19
|
+
schemas.Fq
|
|
20
|
+
]),
|
|
21
|
+
output: AztecAddress.schema
|
|
22
|
+
})
|
|
10
23
|
};
|