@@ -39,6 +39,7 @@ on a proposal multiple times as long as the total voting power of these votes do
3939-   [ Function ` get_required_proposer_stake ` ] ( #0x1_aptos_governance_get_required_proposer_stake ) 
4040-   [ Function ` has_entirely_voted ` ] ( #0x1_aptos_governance_has_entirely_voted ) 
4141-   [ Function ` get_remaining_voting_power ` ] ( #0x1_aptos_governance_get_remaining_voting_power ) 
42+ -   [ Function ` assert_proposal_expiration ` ] ( #0x1_aptos_governance_assert_proposal_expiration ) 
4243-   [ Function ` create_proposal ` ] ( #0x1_aptos_governance_create_proposal ) 
4344-   [ Function ` create_proposal_v2 ` ] ( #0x1_aptos_governance_create_proposal_v2 ) 
4445-   [ Function ` create_proposal_v2_impl ` ] ( #0x1_aptos_governance_create_proposal_v2_impl ) 
@@ -74,6 +75,7 @@ on a proposal multiple times as long as the total voting power of these votes do
7475    -   [ Function ` get_required_proposer_stake ` ] ( #@Specification_1_get_required_proposer_stake ) 
7576    -   [ Function ` has_entirely_voted ` ] ( #@Specification_1_has_entirely_voted ) 
7677    -   [ Function ` get_remaining_voting_power ` ] ( #@Specification_1_get_remaining_voting_power ) 
78+     -   [ Function ` assert_proposal_expiration ` ] ( #@Specification_1_assert_proposal_expiration ) 
7779    -   [ Function ` create_proposal ` ] ( #@Specification_1_create_proposal ) 
7880    -   [ Function ` create_proposal_v2 ` ] ( #@Specification_1_create_proposal_v2 ) 
7981    -   [ Function ` create_proposal_v2_impl ` ] ( #@Specification_1_create_proposal_v2_impl ) 
@@ -758,6 +760,16 @@ Partial voting feature hasn't been properly initialized.
758760
759761
760762
763+ <a  id =" 0x1_aptos_governance_EPROPOSAL_EXPIRED " ></a >
764+ 
765+ The proposal has expired.
766+ 
767+ 
768+ <pre ><code ><b >const</b > <a  href =" aptos_governance.md#0x1_aptos_governance_EPROPOSAL_EXPIRED " >EPROPOSAL_EXPIRED</a >: u64 = 15;
769+ </code ></pre >
770+ 
771+ 
772+ 
761773<a  id =" 0x1_aptos_governance_EPROPOSAL_NOT_RESOLVABLE_YET " ></a >
762774
763775Proposal is not ready to be resolved. Waiting on time or votes
@@ -1160,6 +1172,43 @@ Note: a stake pool's voting power on a proposal could increase over time(e.g. re
11601172
11611173
11621174
1175+ </details >
1176+ 
1177+ <a  id =" 0x1_aptos_governance_assert_proposal_expiration " ></a >
1178+ 
1179+ ## Function ` assert_proposal_expiration `   
1180+ 
1181+ 
1182+ 
1183+ <pre ><code ><b >public</b > <b >fun</b > <a  href =" aptos_governance.md#0x1_aptos_governance_assert_proposal_expiration " >assert_proposal_expiration</a >(stake_pool: <b >address</b >, proposal_id: u64)
1184+ </code ></pre >
1185+ 
1186+ 
1187+ 
1188+ <details >
1189+ <summary >Implementation</summary >
1190+ 
1191+ 
1192+ <pre ><code ><b >public</b > <b >fun</b > <a  href =" aptos_governance.md#0x1_aptos_governance_assert_proposal_expiration " >assert_proposal_expiration</a >(stake_pool: <b >address</b >, proposal_id: u64) {
1193+     <a  href =" aptos_governance.md#0x1_aptos_governance_assert_voting_initialization " >assert_voting_initialization</a >();
1194+     <b >let</b > proposal_expiration = <a  href =" voting.md#0x1_voting_get_proposal_expiration_secs " >voting::get_proposal_expiration_secs</a >< ; GovernanceProposal> ; (
1195+         @aptos_framework,
1196+         proposal_id
1197+     );
1198+     // The voter's <a  href =" stake.md#0x1_stake " >stake</a > needs <b >to</b > be locked up at least <b >as</b > long <b >as</b > the proposal's expiration.
1199+     <b >assert</b >!(
1200+         proposal_expiration < ; = <a  href =" stake.md#0x1_stake_get_lockup_secs " >stake::get_lockup_secs</a >(stake_pool),
1201+         <a  href =" ../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument " >error::invalid_argument</a >(<a  href =" aptos_governance.md#0x1_aptos_governance_EINSUFFICIENT_STAKE_LOCKUP " >EINSUFFICIENT_STAKE_LOCKUP</a >),
1202+     );
1203+     <b >assert</b >!(
1204+         <a  href =" timestamp.md#0x1_timestamp_now_seconds " >timestamp::now_seconds</a >() < ; = proposal_expiration,
1205+         <a  href =" ../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument " >error::invalid_argument</a >(<a  href =" aptos_governance.md#0x1_aptos_governance_EPROPOSAL_EXPIRED " >EPROPOSAL_EXPIRED</a >),
1206+     );
1207+ }
1208+ </code ></pre >
1209+ 
1210+ 
1211+ 
11631212</details >
11641213
11651214<a  id =" 0x1_aptos_governance_create_proposal " ></a >
@@ -1498,15 +1547,7 @@ cannot vote on the proposal even after partial governance voting is enabled.
14981547    <b >let</b > voter_address = <a  href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer_address_of " >signer::address_of</a >(voter);
14991548    <b >assert</b >!(<a  href =" stake.md#0x1_stake_get_delegated_voter " >stake::get_delegated_voter</a >(stake_pool) == voter_address, <a  href =" ../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument " >error::invalid_argument</a >(<a  href =" aptos_governance.md#0x1_aptos_governance_ENOT_DELEGATED_VOTER " >ENOT_DELEGATED_VOTER</a >));
15001549
1501-     // The voter's <a  href =" stake.md#0x1_stake " >stake</a > needs <b >to</b > be locked up at least <b >as</b > long <b >as</b > the proposal's expiration.
1502-     <b >let</b > proposal_expiration = <a  href =" voting.md#0x1_voting_get_proposal_expiration_secs " >voting::get_proposal_expiration_secs</a >< ; GovernanceProposal> ; (
1503-         @aptos_framework,
1504-         proposal_id
1505-     );
1506-     <b >assert</b >!(
1507-         <a  href =" stake.md#0x1_stake_get_lockup_secs " >stake::get_lockup_secs</a >(stake_pool) > ; = proposal_expiration,
1508-         <a  href =" ../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument " >error::invalid_argument</a >(<a  href =" aptos_governance.md#0x1_aptos_governance_EINSUFFICIENT_STAKE_LOCKUP " >EINSUFFICIENT_STAKE_LOCKUP</a >),
1509-     );
1550+     <a  href =" aptos_governance.md#0x1_aptos_governance_assert_proposal_expiration " >assert_proposal_expiration</a >(stake_pool, proposal_id);
15101551
15111552    // If a <a  href =" stake.md#0x1_stake " >stake</a > pool <b >has</b > already voted on a proposal before partial governance <a  href =" voting.md#0x1_voting " >voting</a > is enabled,
15121553    // `get_remaining_voting_power` returns 0.
@@ -2435,6 +2476,28 @@ Abort if structs have already been created.
24352476
24362477
24372478
2479+ <a  id =" @Specification_1_assert_proposal_expiration " ></a >
2480+ 
2481+ ### Function ` assert_proposal_expiration `   
2482+ 
2483+ 
2484+ <pre ><code ><b >public</b > <b >fun</b > <a  href =" aptos_governance.md#0x1_aptos_governance_assert_proposal_expiration " >assert_proposal_expiration</a >(stake_pool: <b >address</b >, proposal_id: u64)
2485+ </code ></pre >
2486+ 
2487+ 
2488+ 
2489+ 
2490+ <pre ><code ><b >include</b > <a  href =" aptos_governance.md#0x1_aptos_governance_VotingInitializationAbortIfs " >VotingInitializationAbortIfs</a >;
2491+ <b >include</b > <a  href =" voting.md#0x1_voting_AbortsIfNotContainProposalID " >voting::AbortsIfNotContainProposalID</a >< ; GovernanceProposal> ; {voting_forum_address: @aptos_framework};
2492+ <b >let</b > proposal_expiration = <a  href =" voting.md#0x1_voting_spec_get_proposal_expiration_secs " >voting::spec_get_proposal_expiration_secs</a >< ; GovernanceProposal> ; (@aptos_framework, proposal_id);
2493+ <b >aborts_if</b > !<a  href =" stake.md#0x1_stake_stake_pool_exists " >stake::stake_pool_exists</a >(stake_pool);
2494+ <b >aborts_if</b > proposal_expiration > ;  <a  href =" stake.md#0x1_stake_spec_get_lockup_secs " >stake::spec_get_lockup_secs</a >(stake_pool);
2495+ <b >aborts_if</b > !<b >exists</b >< ; <a  href =" timestamp.md#0x1_timestamp_CurrentTimeMicroseconds " >timestamp::CurrentTimeMicroseconds</a >> ; (@aptos_framework);
2496+ <b >aborts_if</b > <a  href =" timestamp.md#0x1_timestamp_now_seconds " >timestamp::now_seconds</a >() > ;  proposal_expiration;
2497+ </code ></pre >
2498+ 
2499+ 
2500+ 
24382501<a  id =" @Specification_1_create_proposal " ></a >
24392502
24402503### Function ` create_proposal `   
0 commit comments