Skip to content

Commit b6ad8c7

Browse files
authored
Adjust init_mint for invalid rent key, update dependency, update scripts (#101)
A few proofs are now passing with the updated dependency and added tests
1 parent c8a0898 commit b6ad8c7

File tree

4 files changed

+37
-33
lines changed

4 files changed

+37
-33
lines changed

p-token/src/entrypoint-runtime-verification.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,8 @@ pub fn test_process_initialize_mint_freeze(
849849
assert_eq!(result, Err(ProgramError::NotEnoughAccountKeys))
850850
} else if accounts[0].data_len() != Mint::LEN {
851851
assert_eq!(result, Err(ProgramError::InvalidAccountData))
852+
} else if accounts[1].key() != &pinocchio::sysvars::rent::RENT_ID {
853+
assert_eq!(result, Err(ProgramError::InvalidArgument))
852854
} else if mint_is_initialised_prior.is_err() {
853855
assert_eq!(result, Err(ProgramError::InvalidAccountData))
854856
} else if mint_is_initialised_prior.unwrap() {
@@ -903,6 +905,8 @@ pub fn test_process_initialize_mint_no_freeze(
903905
assert_eq!(result, Err(ProgramError::NotEnoughAccountKeys))
904906
} else if accounts[0].data_len() != Mint::LEN {
905907
assert_eq!(result, Err(ProgramError::InvalidAccountData))
908+
} else if accounts[1].key() != &pinocchio::sysvars::rent::RENT_ID {
909+
assert_eq!(result, Err(ProgramError::InvalidArgument))
906910
} else if mint_is_initialised_prior.is_err() {
907911
assert_eq!(result, Err(ProgramError::InvalidAccountData))
908912
} else if mint_is_initialised_prior.unwrap() {
Submodule mir-semantics updated 30 files

p-token/test-properties/run-proofs.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Run all start symbols given as arguments (or read them from proofs.md
44
# table if -a given) with given run options (-o) and timeout (-t).
55
# Options and defaults:
6-
# -t NUM : timeout in seconds (default 1h=3600)
7-
# -o STRING: prove-rs options. Default "--max-iterations 500 --max-depth 2000"
6+
# -t NUM : timeout in seconds (default 2h=7200)
7+
# -o STRING: prove-rs options. Default "--max-iterations 1000 --max-depth 2000"
88
# -a : run all start symbols from first table in `proofs.md` (1st column)
99
# -m : run all start symbols from multisig table in `proofs.md` (2nd column)
1010
# -c : continue existing proofs instead of reloading (which is default)
@@ -23,8 +23,8 @@ ARTIFACT_BASENAME="${ARTIFACT_BASENAME:-p-token}"
2323
ALL_NAMES=$(sed -n -e 's/^| \(test_p[a-zA-Z0-9:_]*\) *|.*/\1/p' proofs.md)
2424
MULTISIG_NAMES=$(sed -n -e 's/^| m | \(test_p[a-zA-Z0-9:_]*\) *|.*/\1/p' proofs.md)
2525

26-
TIMEOUT=3600
27-
PROVE_OPTS="--max-iterations 500 --max-depth 2000"
26+
TIMEOUT=7200
27+
PROVE_OPTS="--max-iterations 1000 --max-depth 2000"
2828
RELOAD_OPT="--reload"
2929
LOG_FILE=""
3030

p-token/test-properties/select-proofs.sh

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,49 +21,49 @@ fi
2121

2222
sed -n -e "/^| ${HEADING}.*/,/^\$/ {/| ${HEADING}.*/d; /^\$/q; s/^| \(test_p[a-zA-Z0-9_]*\) .*/\1/p}" <<EOF
2323
24-
| Passing |
24+
| Passing |
25+
|-----------------------------------------|
26+
| test_ptoken_domain_data |
27+
| test_process_initialize_account2 |
28+
| test_process_initialize_account |
29+
| test_process_get_account_data_size |
30+
| test_process_initialize_immutable_owner |
31+
| test_process_initialize_mint_freeze |
32+
| test_process_initialize_mint_no_freeze |
33+
| test_process_revoke |
34+
| test_process_set_authority_mint |
35+
| test_process_sync_native |
36+
37+
| Failing nodes |
2538
|-----------------------------------------------|
26-
| test_ptoken_domain_data |
27-
| test_process_burn |
2839
| test_process_approve_checked |
29-
| test_process_withdraw_excess_lamports_account |
30-
| test_process_transfer |
31-
| test_process_mint_to |
3240
| test_process_approve |
3341
| test_process_close_account |
34-
| test_process_sync_native |
35-
| test_process_burn_checked |
36-
| test_process_revoke |
3742
| test_process_freeze_account |
38-
| test_process_thaw_account |
43+
| test_process_initialize_account3 |
44+
| test_process_initialize_mint2_freeze |
45+
| test_process_initialize_mint2_no_freeze |
3946
| test_process_mint_to_checked |
40-
| test_process_transfer_checked |
41-
| test_process_get_account_data_size |
42-
| test_process_initialize_immutable_owner |
47+
| test_process_mint_to |
4348
| test_process_set_authority_account |
49+
| test_process_thaw_account |
50+
| test_process_withdraw_excess_lamports_account |
51+
| test_process_withdraw_excess_lamports_mint |
4452
45-
| Failing nodes |
46-
|-----------------------------------------|
47-
| test_process_initialize_account |
48-
| test_process_initialize_account2 |
49-
| test_process_initialize_account3 |
50-
| test_process_initialize_mint_freeze |
51-
| test_process_initialize_mint2_freeze |
52-
| test_process_initialize_mint_no_freeze |
53-
| test_process_initialize_mint2_no_freeze |
53+
| Long-running (2h+) |
54+
|-------------------------------|
55+
| test_process_burn_checked |
56+
| test_process_burn |
57+
| test_process_transfer_checked |
58+
| test_process_transfer |
5459
5560
| Other issues |
5661
|----------------------------------|
5762
| test_process_amount_to_ui_amount |
5863
| test_process_ui_amount_to_amount |
5964
60-
| Performance issues |
61-
|--------------------------------------------|
62-
| test_process_withdraw_excess_lamports_mint |
63-
| test_process_set_authority_mint |
64-
6565
66-
| Missing Multisig cheat code |
66+
| Multisig |
6767
|---------------------------------------------------------|
6868
| test_process_withdraw_excess_lamports_multisig |
6969
| test_process_approve_multisig |

0 commit comments

Comments
 (0)