Skip to content

Commit

Permalink
add dummy precondition
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometer1729 committed Sep 18, 2024
1 parent 3061057 commit 7fd583f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/lib/mina/precondition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ const Preconditions = {
ignoreAll(): Preconditions {
return {
account: AccountPrecondition.ignoreAll(),
test: AccountPrecondition.ignoreAll(),
network: NetworkPrecondition.ignoreAll(),
validWhile: GlobalSlotPrecondition.ignoreAll(),
};
Expand All @@ -147,6 +148,7 @@ function preconditions(accountUpdate: AccountUpdate, isSelf: boolean) {
initializePreconditions(accountUpdate, isSelf);
return {
account: Account(accountUpdate),
test: Account(accountUpdate),
network: Network(accountUpdate),
currentSlot: CurrentSlot(accountUpdate),
};
Expand Down Expand Up @@ -644,7 +646,7 @@ function ensureConsistentPrecondition(
let errorMessage = `
Precondition Error: Precondition Error: Attempting to set a precondition that is already set for '${name}'.
'${name}' represents the field or value you're trying to set a precondition for.
Preconditions must be set only once to avoid overwriting previous assertions.
Preconditions must be set only once to avoid overwriting previous assertions.
For example, do not use 'requireBetween()' or 'requireEquals()' multiple times on the same field.
Recommendation:
Expand Down
2 changes: 1 addition & 1 deletion src/mina
Submodule mina updated 60 files
+46 −0 graphql_schema.json
+1 −0 src/app/archive/lib/load_data.ml
+2 −4 src/app/batch_txn_tool/batch_txn_tool.ml
+24 −18 src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml
+8 −10 src/app/cli/src/init/client.ml
+7 −6 src/app/cli/src/init/mina_run.ml
+1 −0 src/app/disk_caching_stats/disk_caching_stats.ml
+1 −0 src/app/test_executive/hard_fork.ml
+1 −0 src/app/test_executive/payments_test.ml
+1 −0 src/app/test_executive/test_executive.ml
+1 −0 src/app/test_executive/verification_key_update.ml
+1 −0 src/app/test_executive/zkapps.ml
+7 −0 src/app/test_executive/zkapps_nonce_test.ml
+2 −0 src/app/test_executive/zkapps_timing.ml
+1 −0 src/app/zkapps_examples/test/actions/actions.ml
+1 −0 src/app/zkapps_examples/test/add_events/add_events.ml
+1 −0 src/app/zkapps_examples/test/big_circuit/big_circuit.ml
+1 −0 src/app/zkapps_examples/test/calls/calls.ml
+1 −0 src/app/zkapps_examples/test/empty_update/empty_update.ml
+1 −0 src/app/zkapps_examples/test/initialize_state/initialize_state.ml
+2 −0 src/app/zkapps_examples/zkapps_examples.ml
+13 −18 src/lib/block_producer/block_producer.ml
+1 −1 src/lib/cli_lib/dune
+0 −60 src/lib/genesis_ledger_helper/lib/genesis_ledger_helper_lib.ml
+2 −0 src/lib/integration_test_cloud_engine/kubernetes_network.ml
+1 −1 src/lib/integration_test_cloud_engine/mina_automation.ml
+1 −0 src/lib/integration_test_lib/dune
+2 −0 src/lib/integration_test_lib/intf.ml
+2 −1 src/lib/integration_test_lib/test_config.ml
+2 −0 src/lib/integration_test_local_engine/docker_network.ml
+1 −1 src/lib/integration_test_local_engine/mina_docker.ml
+1 −1 src/lib/logger/fake/logger.ml
+5 −1 src/lib/logger/logger.mli
+0 −1 src/lib/logger/native/dune
+15 −5 src/lib/logger/native/logger.ml
+13 −3 src/lib/mina_base/account_update.ml
+1 −0 src/lib/mina_base/test/helpers/zkapp_cmd_builder.ml
+2 −2 src/lib/mina_compile_config/dune
+195 −42 src/lib/mina_compile_config/mina_compile_config.ml
+0 −41 src/lib/mina_compile_config/mina_compile_config.mli
+1 −0 src/lib/mina_generators/zkapp_command_generators.ml
+7 −16 src/lib/mina_graphql/mina_graphql.ml
+2 −0 src/lib/mina_lib/config.ml
+27 −13 src/lib/mina_lib/mina_lib.ml
+10 −0 src/lib/mina_lib/mina_lib.mli
+9 −0 src/lib/mina_lib/tests/tests.ml
+1 −0 src/lib/mina_wire_types/mina_base/mina_base_account_update.ml
+7 −0 src/lib/mina_wire_types/mina_base/mina_base_zkapp_precondition.ml
+4 −0 src/lib/network_pool/test/indexed_pool_tests.ml
+8 −0 src/lib/network_pool/transaction_pool.ml
+1 −0 src/lib/runtime_config/dune
+1 −1 src/lib/runtime_config/runtime_config.ml
+2 −0 src/lib/transaction_logic/mina_transaction_logic.ml
+4 −0 src/lib/transaction_snark/test/access_permission/transaction_snark_test_access_permission.ml
+4 −0 src/lib/transaction_snark/test/multisig_account/multisig_account.ml
+4 −0 src/lib/transaction_snark/test/ring_sig.ml
+2 −0 src/lib/transaction_snark/test/zkapp_payments/zkapp_payments.ml
+14 −0 src/lib/transaction_snark/test/zkapp_preconditions/zkapp_preconditions.ml
+10 −0 src/lib/transaction_snark/transaction_snark.ml
+1 −0 src/lib/zkapp_command_builder/zkapp_command_builder.ml
4 changes: 4 additions & 0 deletions src/mina-signer/src/sign-zkapp-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ function accountUpdateFromFeePayer({
isSome: Bool(true),
value: { lower: nonce, upper: nonce },
};
body.preconditions.test.nonce = {
isSome: Bool(true),
value: { lower: nonce, upper: nonce },
};
body.useFullCommitment = Bool(true);
body.implicitAccountCreationFee = Bool(true);
body.authorizationKind = {
Expand Down
10 changes: 10 additions & 0 deletions src/mina-signer/src/test-vectors/accountUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ let accountUpdateExample: Json.AccountUpdate = {
provedState: null,
isNew: true,
},
test: {
balance: { lower: '1000000000', upper: '1000000000' },
nonce: null,
receiptChainHash: null,
delegate: 'B62qrja1a2wu3ciKygrqNiNoDZUsHCcE1VfF4LZQtQkzszWhogpWN9i',
state: ['9', null, null, null, null, null, null, null],
actionState: null,
provedState: null,
isNew: true,
},
validWhile: null,
},
useFullCommitment: false,
Expand Down

0 comments on commit 7fd583f

Please sign in to comment.