@aztec/pxe 0.0.0-test.1 → 0.0.1-commit.21caa21
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 +5 -5
- package/dest/bin/check_oracle_version.d.ts +2 -0
- package/dest/bin/check_oracle_version.d.ts.map +1 -0
- package/dest/bin/check_oracle_version.js +39 -0
- package/dest/config/index.d.ts +11 -24
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +18 -33
- package/dest/config/package_info.d.ts +1 -1
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +56 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -0
- package/dest/contract_function_simulator/contract_function_simulator.js +300 -0
- package/dest/contract_function_simulator/execution_data_provider.d.ts +265 -0
- package/dest/contract_function_simulator/execution_data_provider.d.ts.map +1 -0
- package/dest/contract_function_simulator/execution_data_provider.js +14 -0
- package/dest/contract_function_simulator/execution_note_cache.d.ts +94 -0
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/execution_note_cache.js +190 -0
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +16 -0
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +26 -0
- package/dest/contract_function_simulator/hashed_values_cache.d.ts +28 -0
- package/dest/contract_function_simulator/hashed_values_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/hashed_values_cache.js +36 -0
- package/dest/contract_function_simulator/index.d.ts +14 -0
- package/dest/contract_function_simulator/index.d.ts.map +1 -0
- package/dest/contract_function_simulator/index.js +12 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +20 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +37 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +15 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +25 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +17 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +65 -0
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +23 -0
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +48 -0
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +22 -0
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/utility_context.js +33 -0
- package/dest/contract_function_simulator/oracle/index.d.ts +14 -0
- package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/index.js +2 -0
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +100 -0
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/interfaces.js +4 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +17 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +24 -0
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +24 -0
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +50 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts +58 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/oracle.js +333 -0
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +48 -0
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/private_execution.js +123 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +231 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +428 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +153 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +265 -0
- package/dest/contract_function_simulator/pick_notes.d.ts +85 -0
- package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -0
- package/dest/contract_function_simulator/pick_notes.js +51 -0
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +6 -0
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -0
- package/dest/contract_function_simulator/proxied_contract_data_source.js +62 -0
- package/dest/contract_function_simulator/proxied_node.d.ts +9 -0
- package/dest/contract_function_simulator/proxied_node.d.ts.map +1 -0
- package/dest/contract_function_simulator/proxied_node.js +27 -0
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +122 -0
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +1 -0
- package/dest/contract_function_simulator/pxe_oracle_interface.js +694 -0
- package/dest/entrypoints/client/bundle/index.d.ts +5 -3
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +3 -2
- package/dest/entrypoints/client/bundle/utils.d.ts +10 -10
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +18 -12
- package/dest/entrypoints/client/lazy/index.d.ts +5 -3
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +3 -2
- package/dest/entrypoints/client/lazy/utils.d.ts +9 -9
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +17 -11
- package/dest/entrypoints/pxe_creation_options.d.ts +14 -0
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -0
- package/dest/entrypoints/server/index.d.ts +6 -4
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +4 -3
- package/dest/entrypoints/server/utils.d.ts +8 -16
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +30 -35
- package/dest/error_enriching.d.ts +11 -0
- package/dest/error_enriching.d.ts.map +1 -0
- package/dest/{pxe_service/error_enriching.js → error_enriching.js} +26 -18
- package/dest/oracle_version.d.ts +3 -0
- package/dest/oracle_version.d.ts.map +1 -0
- package/dest/oracle_version.js +10 -0
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +28 -0
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +1 -0
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.js +271 -0
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +4 -0
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +1 -0
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.js +41 -0
- package/dest/private_kernel/hints/index.d.ts +3 -0
- package/dest/private_kernel/hints/index.d.ts.map +1 -0
- package/dest/{kernel_prover → private_kernel}/hints/index.js +1 -0
- package/dest/private_kernel/index.d.ts +3 -0
- package/dest/private_kernel/index.d.ts.map +1 -0
- package/dest/private_kernel/index.js +2 -0
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +44 -0
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -0
- package/dest/private_kernel/private_kernel_execution_prover.js +286 -0
- package/dest/private_kernel/private_kernel_oracle.d.ts +62 -0
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -0
- package/dest/private_kernel/private_kernel_oracle.js +4 -0
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +45 -0
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +1 -0
- package/dest/{kernel_oracle/index.js → private_kernel/private_kernel_oracle_impl.js} +19 -9
- package/dest/pxe.d.ts +240 -0
- package/dest/pxe.d.ts.map +1 -0
- package/dest/pxe.js +771 -0
- package/dest/storage/address_data_provider/address_data_provider.d.ts +2 -4
- package/dest/storage/address_data_provider/address_data_provider.d.ts.map +1 -1
- package/dest/storage/address_data_provider/address_data_provider.js +0 -3
- package/dest/storage/address_data_provider/index.d.ts +1 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +15 -6
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +1 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.js +85 -24
- package/dest/storage/capsule_data_provider/index.d.ts +1 -1
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts +13 -58
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +1 -1
- package/dest/storage/contract_data_provider/contract_data_provider.js +89 -79
- package/dest/storage/contract_data_provider/index.d.ts +1 -2
- package/dest/storage/contract_data_provider/index.d.ts.map +1 -1
- package/dest/storage/contract_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts +3 -42
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +1 -1
- package/dest/storage/contract_data_provider/private_functions_tree.js +9 -61
- package/dest/storage/index.d.ts +3 -4
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +2 -3
- package/dest/storage/metadata.d.ts +2 -0
- package/dest/storage/metadata.d.ts.map +1 -0
- package/dest/storage/metadata.js +1 -0
- package/dest/storage/note_data_provider/index.d.ts +2 -2
- package/dest/storage/note_data_provider/index.d.ts.map +1 -1
- package/dest/storage/note_data_provider/index.js +1 -1
- package/dest/storage/note_data_provider/note_data_provider.d.ts +73 -10
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +1 -1
- package/dest/storage/note_data_provider/note_data_provider.js +145 -83
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +37 -0
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +1 -0
- package/dest/storage/private_event_data_provider/private_event_data_provider.js +105 -0
- package/dest/storage/sync_data_provider/index.d.ts +1 -1
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts +3 -5
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +1 -1
- package/dest/storage/sync_data_provider/sync_data_provider.js +2 -5
- package/dest/storage/tagging_data_provider/index.d.ts +1 -1
- package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +29 -7
- package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +1 -1
- package/dest/storage/tagging_data_provider/tagging_data_provider.js +48 -24
- package/dest/synchronizer/index.d.ts +1 -1
- package/dest/synchronizer/synchronizer.d.ts +8 -10
- package/dest/synchronizer/synchronizer.d.ts.map +1 -1
- package/dest/synchronizer/synchronizer.js +17 -19
- package/dest/tagging/constants.d.ts +2 -0
- package/dest/tagging/constants.d.ts.map +1 -0
- package/dest/tagging/constants.js +2 -0
- package/dest/tagging/index.d.ts +7 -0
- package/dest/tagging/index.d.ts.map +1 -0
- package/dest/tagging/index.js +5 -0
- package/dest/tagging/siloed_tag.d.ts +14 -0
- package/dest/tagging/siloed_tag.d.ts.map +1 -0
- package/dest/tagging/siloed_tag.js +20 -0
- package/dest/tagging/tag.d.ts +12 -0
- package/dest/tagging/tag.d.ts.map +1 -0
- package/dest/tagging/tag.js +17 -0
- package/dest/tagging/utils.d.ts +18 -0
- package/dest/tagging/utils.d.ts.map +1 -0
- package/dest/tagging/utils.js +24 -0
- package/package.json +37 -34
- package/src/bin/check_oracle_version.ts +50 -0
- package/src/config/index.ts +27 -55
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +553 -0
- package/src/contract_function_simulator/execution_data_provider.ts +333 -0
- package/src/contract_function_simulator/execution_note_cache.ts +229 -0
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +32 -0
- package/src/contract_function_simulator/hashed_values_cache.ts +47 -0
- package/src/contract_function_simulator/index.ts +13 -0
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +47 -0
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +27 -0
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +69 -0
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +61 -0
- package/src/contract_function_simulator/noir-structs/utility_context.ts +42 -0
- package/src/contract_function_simulator/oracle/index.ts +16 -0
- package/src/contract_function_simulator/oracle/interfaces.ts +170 -0
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +23 -0
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +54 -0
- package/src/contract_function_simulator/oracle/oracle.ts +583 -0
- package/src/contract_function_simulator/oracle/private_execution.ts +207 -0
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +633 -0
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +358 -0
- package/src/contract_function_simulator/pick_notes.ts +141 -0
- package/src/contract_function_simulator/proxied_contract_data_source.ts +66 -0
- package/src/contract_function_simulator/proxied_node.ts +33 -0
- package/src/contract_function_simulator/pxe_oracle_interface.ts +1008 -0
- package/src/entrypoints/client/bundle/index.ts +4 -2
- package/src/entrypoints/client/bundle/utils.ts +36 -36
- package/src/entrypoints/client/lazy/index.ts +4 -2
- package/src/entrypoints/client/lazy/utils.ts +36 -31
- package/src/entrypoints/{client/pxe_creation_options.ts → pxe_creation_options.ts} +4 -1
- package/src/entrypoints/server/index.ts +5 -3
- package/src/entrypoints/server/utils.ts +58 -50
- package/src/{pxe_service/error_enriching.ts → error_enriching.ts} +36 -27
- package/src/oracle_version.ts +11 -0
- package/src/{kernel_prover → private_kernel}/hints/build_private_kernel_reset_private_inputs.ts +158 -146
- package/src/private_kernel/hints/compute_tx_include_by_timestamp.ts +58 -0
- package/src/{kernel_prover → private_kernel}/hints/index.ts +1 -0
- package/src/private_kernel/index.ts +2 -0
- package/src/private_kernel/private_kernel_execution_prover.ts +431 -0
- package/src/{kernel_prover/proving_data_oracle.ts → private_kernel/private_kernel_oracle.ts} +17 -29
- package/src/{kernel_oracle/index.ts → private_kernel/private_kernel_oracle_impl.ts} +30 -15
- package/src/pxe.ts +1085 -0
- package/src/storage/address_data_provider/address_data_provider.ts +1 -7
- package/src/storage/capsule_data_provider/capsule_data_provider.ts +97 -30
- package/src/storage/contract_data_provider/contract_data_provider.ts +109 -93
- package/src/storage/contract_data_provider/index.ts +0 -1
- package/src/storage/contract_data_provider/private_functions_tree.ts +11 -75
- package/src/storage/index.ts +2 -4
- package/src/storage/metadata.ts +1 -0
- package/src/storage/note_data_provider/index.ts +1 -1
- package/src/storage/note_data_provider/note_data_provider.ts +176 -122
- package/src/storage/private_event_data_provider/private_event_data_provider.ts +143 -0
- package/src/storage/sync_data_provider/sync_data_provider.ts +4 -10
- package/src/storage/tagging_data_provider/tagging_data_provider.ts +58 -30
- package/src/synchronizer/synchronizer.ts +21 -22
- package/src/tagging/constants.ts +2 -0
- package/src/tagging/index.ts +6 -0
- package/src/tagging/siloed_tag.ts +22 -0
- package/src/tagging/tag.ts +16 -0
- package/src/tagging/utils.ts +31 -0
- package/dest/bin/index.d.ts +0 -3
- package/dest/bin/index.d.ts.map +0 -1
- package/dest/bin/index.js +0 -28
- package/dest/entrypoints/client/pxe_creation_options.d.ts +0 -11
- package/dest/entrypoints/client/pxe_creation_options.d.ts.map +0 -1
- package/dest/kernel_oracle/index.d.ts +0 -45
- package/dest/kernel_oracle/index.d.ts.map +0 -1
- package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
- package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
- package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.js +0 -270
- package/dest/kernel_prover/hints/index.d.ts +0 -2
- package/dest/kernel_prover/hints/index.d.ts.map +0 -1
- package/dest/kernel_prover/index.d.ts +0 -3
- package/dest/kernel_prover/index.d.ts.map +0 -1
- package/dest/kernel_prover/index.js +0 -2
- package/dest/kernel_prover/kernel_prover.d.ts +0 -38
- package/dest/kernel_prover/kernel_prover.d.ts.map +0 -1
- package/dest/kernel_prover/kernel_prover.js +0 -217
- package/dest/kernel_prover/proving_data_oracle.d.ts +0 -73
- package/dest/kernel_prover/proving_data_oracle.d.ts.map +0 -1
- package/dest/kernel_prover/proving_data_oracle.js +0 -4
- package/dest/note_decryption_utils/add_public_values_to_payload.d.ts +0 -11
- package/dest/note_decryption_utils/add_public_values_to_payload.d.ts.map +0 -1
- package/dest/note_decryption_utils/add_public_values_to_payload.js +0 -47
- package/dest/pxe_http/index.d.ts +0 -2
- package/dest/pxe_http/index.d.ts.map +0 -1
- package/dest/pxe_http/index.js +0 -1
- package/dest/pxe_http/pxe_http_server.d.ts +0 -16
- package/dest/pxe_http/pxe_http_server.d.ts.map +0 -1
- package/dest/pxe_http/pxe_http_server.js +0 -27
- package/dest/pxe_oracle_interface/index.d.ts +0 -159
- package/dest/pxe_oracle_interface/index.d.ts.map +0 -1
- package/dest/pxe_oracle_interface/index.js +0 -692
- package/dest/pxe_oracle_interface/tagging_utils.d.ts +0 -17
- package/dest/pxe_oracle_interface/tagging_utils.d.ts.map +0 -1
- package/dest/pxe_oracle_interface/tagging_utils.js +0 -23
- package/dest/pxe_service/error_enriching.d.ts +0 -11
- package/dest/pxe_service/error_enriching.d.ts.map +0 -1
- package/dest/pxe_service/index.d.ts +0 -3
- package/dest/pxe_service/index.d.ts.map +0 -1
- package/dest/pxe_service/index.js +0 -2
- package/dest/pxe_service/pxe_service.d.ts +0 -111
- package/dest/pxe_service/pxe_service.d.ts.map +0 -1
- package/dest/pxe_service/pxe_service.js +0 -664
- package/dest/storage/auth_witness_data_provider/auth_witness_data_provider.d.ts +0 -11
- package/dest/storage/auth_witness_data_provider/auth_witness_data_provider.d.ts.map +0 -1
- package/dest/storage/auth_witness_data_provider/auth_witness_data_provider.js +0 -20
- package/dest/storage/auth_witness_data_provider/index.d.ts +0 -2
- package/dest/storage/auth_witness_data_provider/index.d.ts.map +0 -1
- package/dest/storage/auth_witness_data_provider/index.js +0 -1
- package/dest/storage/data_provider.d.ts +0 -4
- package/dest/storage/data_provider.d.ts.map +0 -1
- package/dest/storage/data_provider.js +0 -1
- package/dest/storage/note_data_provider/note_dao.d.ts +0 -106
- package/dest/storage/note_data_provider/note_dao.d.ts.map +0 -1
- package/dest/storage/note_data_provider/note_dao.js +0 -106
- package/dest/test/pxe_test_suite.d.ts +0 -3
- package/dest/test/pxe_test_suite.d.ts.map +0 -1
- package/dest/test/pxe_test_suite.js +0 -97
- package/src/bin/index.ts +0 -38
- package/src/kernel_prover/index.ts +0 -2
- package/src/kernel_prover/kernel_prover.ts +0 -351
- package/src/note_decryption_utils/add_public_values_to_payload.ts +0 -64
- package/src/pxe_http/index.ts +0 -1
- package/src/pxe_http/pxe_http_server.ts +0 -29
- package/src/pxe_oracle_interface/index.ts +0 -925
- package/src/pxe_oracle_interface/tagging_utils.ts +0 -32
- package/src/pxe_service/index.ts +0 -2
- package/src/pxe_service/pxe_service.ts +0 -949
- package/src/storage/auth_witness_data_provider/auth_witness_data_provider.ts +0 -34
- package/src/storage/auth_witness_data_provider/index.ts +0 -1
- package/src/storage/data_provider.ts +0 -3
- package/src/storage/note_data_provider/note_dao.ts +0 -162
- package/src/test/pxe_test_suite.ts +0 -111
- /package/dest/entrypoints/{client/pxe_creation_options.js → pxe_creation_options.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth_witness_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/auth_witness_data_provider/auth_witness_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBAAa,uBAAwB,YAAW,YAAY;;gBAI9C,KAAK,EAAE,iBAAiB;IAK9B,cAAc,CAAC,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAO7D,cAAc,CAAC,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC;IAK1D,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;CAMjC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { toArray } from '@aztec/foundation/iterable';
|
|
3
|
-
export class AuthWitnessDataProvider {
|
|
4
|
-
#store;
|
|
5
|
-
#authWitnesses;
|
|
6
|
-
constructor(store){
|
|
7
|
-
this.#store = store;
|
|
8
|
-
this.#authWitnesses = this.#store.openMap('auth_witnesses');
|
|
9
|
-
}
|
|
10
|
-
async addAuthWitness(messageHash, witness) {
|
|
11
|
-
await this.#authWitnesses.set(messageHash.toString(), witness.map((w)=>w.toBuffer()));
|
|
12
|
-
}
|
|
13
|
-
async getAuthWitness(messageHash) {
|
|
14
|
-
const witness = await this.#authWitnesses.getAsync(messageHash.toString());
|
|
15
|
-
return witness?.map((w)=>Fr.fromBuffer(w));
|
|
16
|
-
}
|
|
17
|
-
async getSize() {
|
|
18
|
-
return (await toArray(this.#authWitnesses.valuesAsync())).reduce((sum, value)=>sum + value.length * Fr.SIZE_IN_BYTES, 0);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/auth_witness_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { AuthWitnessDataProvider } from './auth_witness_data_provider.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data_provider.d.ts","sourceRoot":"","sources":["../../src/storage/data_provider.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
5
|
-
import type { NoteData } from '@aztec/simulator/client';
|
|
6
|
-
import { NoteSelector } from '@aztec/stdlib/abi';
|
|
7
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
|
-
import type { PublicKey } from '@aztec/stdlib/keys';
|
|
9
|
-
import { Note } from '@aztec/stdlib/note';
|
|
10
|
-
import { TxHash } from '@aztec/stdlib/tx';
|
|
11
|
-
/**
|
|
12
|
-
* A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
|
|
13
|
-
* information required to use it during execution and manage its state.
|
|
14
|
-
*/
|
|
15
|
-
export declare class NoteDao implements NoteData {
|
|
16
|
-
/** The packed content of the note, as will be returned in the getNotes oracle. */
|
|
17
|
-
note: Note;
|
|
18
|
-
/** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
|
|
19
|
-
contractAddress: AztecAddress;
|
|
20
|
-
/**
|
|
21
|
-
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
22
|
-
* since contracts typically make queries based on it.
|
|
23
|
-
* */
|
|
24
|
-
storageSlot: Fr;
|
|
25
|
-
/** The kernel-provided nonce of the note, required to compute the uniqueNoteHash. */
|
|
26
|
-
nonce: Fr;
|
|
27
|
-
/**
|
|
28
|
-
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
|
|
29
|
-
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
30
|
-
*/
|
|
31
|
-
noteHash: Fr;
|
|
32
|
-
/**
|
|
33
|
-
* The nullifier of the note, siloed by contract address.
|
|
34
|
-
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
35
|
-
*/
|
|
36
|
-
siloedNullifier: Fr;
|
|
37
|
-
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
38
|
-
* when searching for txEffects.
|
|
39
|
-
*/
|
|
40
|
-
txHash: TxHash;
|
|
41
|
-
/** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
42
|
-
* reorgs.*/
|
|
43
|
-
l2BlockNumber: number;
|
|
44
|
-
/** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
45
|
-
* reorgs.*/
|
|
46
|
-
l2BlockHash: string;
|
|
47
|
-
/** The index of the leaf in the global note hash tree the note is stored at */
|
|
48
|
-
index: bigint;
|
|
49
|
-
/** The public key with which the note log was encrypted during delivery. */
|
|
50
|
-
addressPoint: PublicKey;
|
|
51
|
-
/** The note type identifier for the contract.
|
|
52
|
-
* TODO(#12013): remove
|
|
53
|
-
*/
|
|
54
|
-
noteTypeId: NoteSelector;
|
|
55
|
-
constructor(
|
|
56
|
-
/** The packed content of the note, as will be returned in the getNotes oracle. */
|
|
57
|
-
note: Note,
|
|
58
|
-
/** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
|
|
59
|
-
contractAddress: AztecAddress,
|
|
60
|
-
/**
|
|
61
|
-
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
62
|
-
* since contracts typically make queries based on it.
|
|
63
|
-
* */
|
|
64
|
-
storageSlot: Fr,
|
|
65
|
-
/** The kernel-provided nonce of the note, required to compute the uniqueNoteHash. */
|
|
66
|
-
nonce: Fr,
|
|
67
|
-
/**
|
|
68
|
-
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
|
|
69
|
-
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
70
|
-
*/
|
|
71
|
-
noteHash: Fr,
|
|
72
|
-
/**
|
|
73
|
-
* The nullifier of the note, siloed by contract address.
|
|
74
|
-
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
75
|
-
*/
|
|
76
|
-
siloedNullifier: Fr,
|
|
77
|
-
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
78
|
-
* when searching for txEffects.
|
|
79
|
-
*/
|
|
80
|
-
txHash: TxHash,
|
|
81
|
-
/** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
82
|
-
* reorgs.*/
|
|
83
|
-
l2BlockNumber: number,
|
|
84
|
-
/** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
85
|
-
* reorgs.*/
|
|
86
|
-
l2BlockHash: string,
|
|
87
|
-
/** The index of the leaf in the global note hash tree the note is stored at */
|
|
88
|
-
index: bigint,
|
|
89
|
-
/** The public key with which the note log was encrypted during delivery. */
|
|
90
|
-
addressPoint: PublicKey,
|
|
91
|
-
/** The note type identifier for the contract.
|
|
92
|
-
* TODO(#12013): remove
|
|
93
|
-
*/
|
|
94
|
-
noteTypeId: NoteSelector);
|
|
95
|
-
toBuffer(): Buffer;
|
|
96
|
-
static fromBuffer(buffer: Buffer | BufferReader): NoteDao;
|
|
97
|
-
toString(): string;
|
|
98
|
-
static fromString(str: string): NoteDao;
|
|
99
|
-
/**
|
|
100
|
-
* Returns the size in bytes of the Note Dao.
|
|
101
|
-
* @returns - Its size in bytes.
|
|
102
|
-
*/
|
|
103
|
-
getSize(): number;
|
|
104
|
-
static random({ note, contractAddress, storageSlot, nonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, index, addressPoint, noteTypeId, }?: Partial<NoteDao>): Promise<NoteDao>;
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=note_dao.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note_dao.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/note_dao.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,EAAE,EAAS,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;;GAGG;AACH,qBAAa,OAAQ,YAAW,QAAQ;IAIpC,kFAAkF;IAC3E,IAAI,EAAE,IAAI;IACjB,8GAA8G;IACvG,eAAe,EAAE,YAAY;IACpC;;;SAGK;IACE,WAAW,EAAE,EAAE;IACtB,qFAAqF;IAC9E,KAAK,EAAE,EAAE;IAGhB;;;OAGG;IACI,QAAQ,EAAE,EAAE;IACnB;;;OAGG;IACI,eAAe,EAAE,EAAE;IAG1B;;OAEG;IACI,MAAM,EAAE,MAAM;IACrB;gBACY;IACL,aAAa,EAAE,MAAM;IAC5B;gBACY;IACL,WAAW,EAAE,MAAM;IAC1B,+EAA+E;IACxE,KAAK,EAAE,MAAM;IACpB,4EAA4E;IACrE,YAAY,EAAE,SAAS;IAE9B;;OAEG;IACI,UAAU,EAAE,YAAY;;IA3C/B,kFAAkF;IAC3E,IAAI,EAAE,IAAI;IACjB,8GAA8G;IACvG,eAAe,EAAE,YAAY;IACpC;;;SAGK;IACE,WAAW,EAAE,EAAE;IACtB,qFAAqF;IAC9E,KAAK,EAAE,EAAE;IAGhB;;;OAGG;IACI,QAAQ,EAAE,EAAE;IACnB;;;OAGG;IACI,eAAe,EAAE,EAAE;IAG1B;;OAEG;IACI,MAAM,EAAE,MAAM;IACrB;gBACY;IACL,aAAa,EAAE,MAAM;IAC5B;gBACY;IACL,WAAW,EAAE,MAAM;IAC1B,+EAA+E;IACxE,KAAK,EAAE,MAAM;IACpB,4EAA4E;IACrE,YAAY,EAAE,SAAS;IAE9B;;OAEG;IACI,UAAU,EAAE,YAAY;IAGjC,QAAQ,IAAI,MAAM;IAiBlB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAgC/C,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAK7B;;;OAGG;IACI,OAAO;WAMD,MAAM,CAAC,EAClB,IAAoB,EACpB,eAA2B,EAC3B,WAAyB,EACzB,KAAmB,EACnB,QAAsB,EACtB,eAA6B,EAC7B,MAAwB,EACxB,aAAgD,EAChD,WAAoC,EACpC,KAA8B,EAC9B,YAAwB,EACxB,UAAkC,GACnC,GAAE,OAAO,CAAC,OAAO,CAAM;CAgBzB"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
2
|
-
import { Fr, Point } from '@aztec/foundation/fields';
|
|
3
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
-
import { NoteSelector } from '@aztec/stdlib/abi';
|
|
5
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
-
import { Note } from '@aztec/stdlib/note';
|
|
7
|
-
import { TxHash } from '@aztec/stdlib/tx';
|
|
8
|
-
/**
|
|
9
|
-
* A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
|
|
10
|
-
* information required to use it during execution and manage its state.
|
|
11
|
-
*/ export class NoteDao {
|
|
12
|
-
note;
|
|
13
|
-
contractAddress;
|
|
14
|
-
storageSlot;
|
|
15
|
-
nonce;
|
|
16
|
-
noteHash;
|
|
17
|
-
siloedNullifier;
|
|
18
|
-
txHash;
|
|
19
|
-
l2BlockNumber;
|
|
20
|
-
l2BlockHash;
|
|
21
|
-
index;
|
|
22
|
-
addressPoint;
|
|
23
|
-
noteTypeId;
|
|
24
|
-
constructor(// Note information
|
|
25
|
-
/** The packed content of the note, as will be returned in the getNotes oracle. */ note, /** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */ contractAddress, /**
|
|
26
|
-
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
27
|
-
* since contracts typically make queries based on it.
|
|
28
|
-
* */ storageSlot, /** The kernel-provided nonce of the note, required to compute the uniqueNoteHash. */ nonce, // Computed values
|
|
29
|
-
/**
|
|
30
|
-
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
|
|
31
|
-
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
32
|
-
*/ noteHash, /**
|
|
33
|
-
* The nullifier of the note, siloed by contract address.
|
|
34
|
-
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
35
|
-
*/ siloedNullifier, // Metadata
|
|
36
|
-
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
37
|
-
* when searching for txEffects.
|
|
38
|
-
*/ txHash, /** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
39
|
-
* reorgs.*/ l2BlockNumber, /** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
40
|
-
* reorgs.*/ l2BlockHash, /** The index of the leaf in the global note hash tree the note is stored at */ index, /** The public key with which the note log was encrypted during delivery. */ addressPoint, /** The note type identifier for the contract.
|
|
41
|
-
* TODO(#12013): remove
|
|
42
|
-
*/ noteTypeId){
|
|
43
|
-
this.note = note;
|
|
44
|
-
this.contractAddress = contractAddress;
|
|
45
|
-
this.storageSlot = storageSlot;
|
|
46
|
-
this.nonce = nonce;
|
|
47
|
-
this.noteHash = noteHash;
|
|
48
|
-
this.siloedNullifier = siloedNullifier;
|
|
49
|
-
this.txHash = txHash;
|
|
50
|
-
this.l2BlockNumber = l2BlockNumber;
|
|
51
|
-
this.l2BlockHash = l2BlockHash;
|
|
52
|
-
this.index = index;
|
|
53
|
-
this.addressPoint = addressPoint;
|
|
54
|
-
this.noteTypeId = noteTypeId;
|
|
55
|
-
}
|
|
56
|
-
toBuffer() {
|
|
57
|
-
return serializeToBuffer([
|
|
58
|
-
this.note,
|
|
59
|
-
this.contractAddress,
|
|
60
|
-
this.storageSlot,
|
|
61
|
-
this.nonce,
|
|
62
|
-
this.noteHash,
|
|
63
|
-
this.siloedNullifier,
|
|
64
|
-
this.txHash,
|
|
65
|
-
this.l2BlockNumber,
|
|
66
|
-
Fr.fromHexString(this.l2BlockHash),
|
|
67
|
-
this.index,
|
|
68
|
-
this.addressPoint,
|
|
69
|
-
this.noteTypeId
|
|
70
|
-
]);
|
|
71
|
-
}
|
|
72
|
-
static fromBuffer(buffer) {
|
|
73
|
-
const reader = BufferReader.asReader(buffer);
|
|
74
|
-
const note = Note.fromBuffer(reader);
|
|
75
|
-
const contractAddress = AztecAddress.fromBuffer(reader);
|
|
76
|
-
const storageSlot = Fr.fromBuffer(reader);
|
|
77
|
-
const nonce = Fr.fromBuffer(reader);
|
|
78
|
-
const noteHash = Fr.fromBuffer(reader);
|
|
79
|
-
const siloedNullifier = Fr.fromBuffer(reader);
|
|
80
|
-
const txHash = reader.readObject(TxHash);
|
|
81
|
-
const l2BlockNumber = reader.readNumber();
|
|
82
|
-
const l2BlockHash = Fr.fromBuffer(reader).toString();
|
|
83
|
-
const index = toBigIntBE(reader.readBytes(32));
|
|
84
|
-
const publicKey = Point.fromBuffer(reader);
|
|
85
|
-
const noteTypeId = reader.readObject(NoteSelector);
|
|
86
|
-
return new NoteDao(note, contractAddress, storageSlot, nonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, index, publicKey, noteTypeId);
|
|
87
|
-
}
|
|
88
|
-
toString() {
|
|
89
|
-
return '0x' + this.toBuffer().toString('hex');
|
|
90
|
-
}
|
|
91
|
-
static fromString(str) {
|
|
92
|
-
const hex = str.replace(/^0x/, '');
|
|
93
|
-
return NoteDao.fromBuffer(Buffer.from(hex, 'hex'));
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Returns the size in bytes of the Note Dao.
|
|
97
|
-
* @returns - Its size in bytes.
|
|
98
|
-
*/ getSize() {
|
|
99
|
-
const indexSize = Math.ceil(Math.log2(Number(this.index)));
|
|
100
|
-
const noteSize = 4 + this.note.items.length * Fr.SIZE_IN_BYTES;
|
|
101
|
-
return noteSize + AztecAddress.SIZE_IN_BYTES + Fr.SIZE_IN_BYTES * 4 + TxHash.SIZE + Point.SIZE_IN_BYTES + indexSize;
|
|
102
|
-
}
|
|
103
|
-
static async random({ note = Note.random(), contractAddress = undefined, storageSlot = Fr.random(), nonce = Fr.random(), noteHash = Fr.random(), siloedNullifier = Fr.random(), txHash = TxHash.random(), l2BlockNumber = Math.floor(Math.random() * 1000), l2BlockHash = Fr.random().toString(), index = Fr.random().toBigInt(), addressPoint = undefined, noteTypeId = NoteSelector.random() } = {}) {
|
|
104
|
-
return new NoteDao(note, contractAddress ?? await AztecAddress.random(), storageSlot, nonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, index, addressPoint ?? await Point.random(), noteTypeId);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_test_suite.d.ts","sourceRoot":"","sources":["../../src/test/pxe_test_suite.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAS3D,eAAO,MAAM,YAAY,aAAc,MAAM,YAAY,MAAM,QAAQ,GAAG,CAAC,SAiG1E,CAAC"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
-
import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
5
|
-
import { randomContractArtifact, randomContractInstanceWithAddress, randomDeployedContract } from '@aztec/stdlib/testing';
|
|
6
|
-
import omit from 'lodash.omit';
|
|
7
|
-
export const pxeTestSuite = (testName, pxeSetup)=>{
|
|
8
|
-
describe(testName, ()=>{
|
|
9
|
-
let pxe;
|
|
10
|
-
beforeAll(async ()=>{
|
|
11
|
-
pxe = await pxeSetup();
|
|
12
|
-
}, 120_000);
|
|
13
|
-
it('registers an account and returns it as an account only and not as a recipient', async ()=>{
|
|
14
|
-
const randomSecretKey = Fr.random();
|
|
15
|
-
const randomPartialAddress = Fr.random();
|
|
16
|
-
const completeAddress = await pxe.registerAccount(randomSecretKey, randomPartialAddress);
|
|
17
|
-
// Check that the account is correctly registered using the getAccounts and getRecipients methods
|
|
18
|
-
const accounts = await pxe.getRegisteredAccounts();
|
|
19
|
-
expect(accounts).toContainEqual(completeAddress);
|
|
20
|
-
});
|
|
21
|
-
it('does not throw when registering the same account twice (just ignores the second attempt)', async ()=>{
|
|
22
|
-
const randomSecretKey = Fr.random();
|
|
23
|
-
const randomPartialAddress = Fr.random();
|
|
24
|
-
await pxe.registerAccount(randomSecretKey, randomPartialAddress);
|
|
25
|
-
await pxe.registerAccount(randomSecretKey, randomPartialAddress);
|
|
26
|
-
});
|
|
27
|
-
it('successfully adds a contract', async ()=>{
|
|
28
|
-
const contracts = await Promise.all([
|
|
29
|
-
randomDeployedContract(),
|
|
30
|
-
randomDeployedContract()
|
|
31
|
-
]);
|
|
32
|
-
for (const contract of contracts){
|
|
33
|
-
await pxe.registerContract(contract);
|
|
34
|
-
}
|
|
35
|
-
const expectedContractAddresses = contracts.map((contract)=>contract.instance.address);
|
|
36
|
-
const contractAddresses = await pxe.getContracts();
|
|
37
|
-
expect(contractAddresses).toEqual(expect.arrayContaining(expectedContractAddresses));
|
|
38
|
-
});
|
|
39
|
-
it('registers a class and adds a contract for it', async ()=>{
|
|
40
|
-
const artifact = randomContractArtifact();
|
|
41
|
-
const contractClass = await getContractClassFromArtifact(artifact);
|
|
42
|
-
const contractClassId = contractClass.id;
|
|
43
|
-
const instance = await randomContractInstanceWithAddress({
|
|
44
|
-
contractClassId
|
|
45
|
-
});
|
|
46
|
-
await pxe.registerContractClass(artifact);
|
|
47
|
-
expect((await pxe.getContractClassMetadata(contractClassId)).contractClass).toMatchObject(omit(contractClass, 'privateFunctionsRoot', 'publicBytecodeCommitment'));
|
|
48
|
-
await pxe.registerContract({
|
|
49
|
-
instance
|
|
50
|
-
});
|
|
51
|
-
expect((await pxe.getContractMetadata(instance.address)).contractInstance).toEqual(instance);
|
|
52
|
-
});
|
|
53
|
-
it('refuses to register a class with a mismatched address', async ()=>{
|
|
54
|
-
const artifact = randomContractArtifact();
|
|
55
|
-
const contractClass = await getContractClassFromArtifact(artifact);
|
|
56
|
-
const contractClassId = contractClass.id;
|
|
57
|
-
const instance = await randomContractInstanceWithAddress({
|
|
58
|
-
contractClassId
|
|
59
|
-
});
|
|
60
|
-
await expect(pxe.registerContract({
|
|
61
|
-
instance: {
|
|
62
|
-
...instance,
|
|
63
|
-
address: await AztecAddress.random()
|
|
64
|
-
},
|
|
65
|
-
artifact
|
|
66
|
-
})).rejects.toThrow(/Added a contract in which the address does not match the contract instance./);
|
|
67
|
-
});
|
|
68
|
-
it('refuses to register a contract with a class that has not been registered', async ()=>{
|
|
69
|
-
const instance = await randomContractInstanceWithAddress();
|
|
70
|
-
await expect(pxe.registerContract({
|
|
71
|
-
instance
|
|
72
|
-
})).rejects.toThrow(/DB has no contract class with id/i);
|
|
73
|
-
});
|
|
74
|
-
it('refuses to register a contract with an artifact with mismatching class id', async ()=>{
|
|
75
|
-
const artifact = randomContractArtifact();
|
|
76
|
-
const instance = await randomContractInstanceWithAddress();
|
|
77
|
-
await expect(pxe.registerContract({
|
|
78
|
-
instance,
|
|
79
|
-
artifact
|
|
80
|
-
})).rejects.toThrow(/Artifact does not match/i);
|
|
81
|
-
});
|
|
82
|
-
// Note: Not testing a successful run of `proveTx`, `sendTx`, `getTxReceipt` and `simulateUnconstrained` here as it requires
|
|
83
|
-
// a larger setup and it's sufficiently tested in the e2e tests.
|
|
84
|
-
// Note: Not testing `getContractData`, `getPublicLogs` and `getPublicStorageAt` here as these
|
|
85
|
-
// functions only call AztecNode and these methods are frequently used by the e2e tests.
|
|
86
|
-
it('successfully gets a block number', async ()=>{
|
|
87
|
-
const blockNum = await pxe.getBlockNumber();
|
|
88
|
-
expect(blockNum).toBeGreaterThanOrEqual(INITIAL_L2_BLOCK_NUM);
|
|
89
|
-
});
|
|
90
|
-
it('successfully gets node info', async ()=>{
|
|
91
|
-
const nodeInfo = await pxe.getNodeInfo();
|
|
92
|
-
expect(typeof nodeInfo.protocolVersion).toEqual('number');
|
|
93
|
-
expect(typeof nodeInfo.l1ChainId).toEqual('number');
|
|
94
|
-
expect(nodeInfo.l1ContractAddresses.rollupAddress.toString()).toMatch(/0x[a-fA-F0-9]+/);
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
};
|
package/src/bin/index.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env -S node --no-warnings
|
|
2
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
-
import { createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
|
|
4
|
-
|
|
5
|
-
import { getPXEServiceConfig } from '../config/index.js';
|
|
6
|
-
import { createPXEService } from '../entrypoints/server/utils.js';
|
|
7
|
-
import { startPXEHttpServer } from '../pxe_http/index.js';
|
|
8
|
-
|
|
9
|
-
const { PXE_PORT = 8080, AZTEC_NODE_URL = 'http://localhost:8079' } = process.env;
|
|
10
|
-
|
|
11
|
-
const logger = createLogger('pxe:service');
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Create and start a new PXE HTTP Server
|
|
15
|
-
*/
|
|
16
|
-
async function main() {
|
|
17
|
-
logger.info(`Setting up PXE...`);
|
|
18
|
-
|
|
19
|
-
const pxeConfig = getPXEServiceConfig();
|
|
20
|
-
const nodeRpcClient = createAztecNodeClient(AZTEC_NODE_URL, {});
|
|
21
|
-
const pxeService = await createPXEService(nodeRpcClient, pxeConfig);
|
|
22
|
-
|
|
23
|
-
const shutdown = () => {
|
|
24
|
-
logger.info('Shutting down...');
|
|
25
|
-
process.exit(0);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
process.once('SIGINT', shutdown);
|
|
29
|
-
process.once('SIGTERM', shutdown);
|
|
30
|
-
|
|
31
|
-
startPXEHttpServer(pxeService, PXE_PORT);
|
|
32
|
-
logger.info(`PXE listening on port ${PXE_PORT}`);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
main().catch(err => {
|
|
36
|
-
logger.error(err);
|
|
37
|
-
process.exit(1);
|
|
38
|
-
});
|