Skip to content

Commit

Permalink
trivial new precondition tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometer1729 committed Sep 19, 2024
1 parent 1f36c41 commit 908f869
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 18 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.

15 changes: 14 additions & 1 deletion src/lib/mina/precondition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,19 @@ const AccountPrecondition = {
},
};

type PermissionsPrecondition = Preconditions['permissions'];
const PermissionsPrecondition = {
ignoreAll(): PermissionsPrecondition {
let appState: Array<OrIgnore<Field>> = [];
for (let i = 0; i < ZkappStateLength; ++i) {
appState.push(ignore(Field(0)));
}
return {
dummyBool: ignore(Bool(true)),
};
},
};

type GlobalSlotPrecondition = Preconditions['validWhile'];
const GlobalSlotPrecondition = {
ignoreAll(): GlobalSlotPrecondition {
Expand All @@ -137,7 +150,7 @@ const Preconditions = {
ignoreAll(): Preconditions {
return {
account: AccountPrecondition.ignoreAll(),
test: AccountPrecondition.ignoreAll(),
permissions: PermissionsPrecondition.ignoreAll(),
network: NetworkPrecondition.ignoreAll(),
validWhile: GlobalSlotPrecondition.ignoreAll(),
};
Expand Down
2 changes: 1 addition & 1 deletion src/mina
Submodule mina updated 31 files
+51 −6 graphql_schema.json
+1 −1 src/app/archive/lib/load_data.ml
+1 −1 src/app/disk_caching_stats/disk_caching_stats.ml
+1 −1 src/app/test_executive/verification_key_update.ml
+2 −6 src/app/test_executive/zkapps_nonce_test.ml
+1 −2 src/app/test_executive/zkapps_timing.ml
+1 −1 src/app/zkapps_examples/test/actions/actions.ml
+1 −1 src/app/zkapps_examples/test/add_events/add_events.ml
+1 −1 src/app/zkapps_examples/test/big_circuit/big_circuit.ml
+1 −1 src/app/zkapps_examples/test/calls/calls.ml
+1 −1 src/app/zkapps_examples/test/empty_update/empty_update.ml
+1 −1 src/app/zkapps_examples/test/initialize_state/initialize_state.ml
+8 −2 src/app/zkapps_examples/zkapps_examples.ml
+81 −13 src/lib/mina_base/account_update.ml
+1 −1 src/lib/mina_base/test/helpers/zkapp_cmd_builder.ml
+6 −0 src/lib/mina_base/test/zero_vesting_period.ml
+134 −0 src/lib/mina_base/zkapp_precondition.ml
+6 −2 src/lib/mina_generators/zkapp_command_generators.ml
+7 −1 src/lib/mina_wire_types/mina_base/mina_base_account_update.ml
+5 −4 src/lib/mina_wire_types/mina_base/mina_base_zkapp_precondition.ml
+2 −4 src/lib/network_pool/test/indexed_pool_tests.ml
+2 −8 src/lib/network_pool/transaction_pool.ml
+2 −0 src/lib/transaction/transaction_hash.ml
+2 −2 src/lib/transaction_logic/mina_transaction_logic.ml
+2 −4 src/lib/transaction_snark/test/access_permission/transaction_snark_test_access_permission.ml
+2 −4 src/lib/transaction_snark/test/multisig_account/multisig_account.ml
+2 −4 src/lib/transaction_snark/test/ring_sig.ml
+2 −2 src/lib/transaction_snark/test/zkapp_payments/zkapp_payments.ml
+10 −14 src/lib/transaction_snark/test/zkapp_preconditions/zkapp_preconditions.ml
+3 −10 src/lib/transaction_snark/transaction_snark.ml
+1 −1 src/lib/zkapp_command_builder/zkapp_command_builder.ml
5 changes: 1 addition & 4 deletions src/mina-signer/src/sign-zkapp-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,7 @@ function accountUpdateFromFeePayer({
isSome: Bool(true),
value: { lower: nonce, upper: nonce },
};
body.preconditions.test.nonce = {
isSome: Bool(true),
value: { lower: nonce, upper: nonce },
};
// TODO set permisions here?
body.useFullCommitment = Bool(true);
body.implicitAccountCreationFee = Bool(true);
body.authorizationKind = {
Expand Down
11 changes: 2 additions & 9 deletions src/mina-signer/src/test-vectors/accountUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,8 @@ 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,
permissions: {
dummyBool: true,
},
validWhile: null,
},
Expand Down

0 comments on commit 908f869

Please sign in to comment.