|
4 | 4 | import static org.tron.core.Constant.CREATE_ACCOUNT_TRANSACTION_MIN_BYTE_SIZE; |
5 | 5 | import static org.tron.core.Constant.DYNAMIC_ENERGY_INCREASE_FACTOR_RANGE; |
6 | 6 | import static org.tron.core.Constant.DYNAMIC_ENERGY_MAX_FACTOR_RANGE; |
| 7 | +import static org.tron.core.Constant.MAX_PROPOSAL_VOTING_WINDOW; |
| 8 | +import static org.tron.core.Constant.MIN_PROPOSAL_VOTING_WINDOW; |
7 | 9 | import static org.tron.core.config.Parameter.ChainConstant.ONE_YEAR_BLOCK_NUMBERS; |
8 | 10 |
|
9 | 11 | import org.tron.common.utils.ForkController; |
@@ -839,6 +841,20 @@ public static void validator(DynamicPropertiesStore dynamicPropertiesStore, |
839 | 841 | } |
840 | 842 | break; |
841 | 843 | } |
| 844 | + case PROPOSAL_VOTING_WINDOW: { |
| 845 | + if (!forkController.pass(ForkBlockVersionEnum.VERSION_4_8_1)) { |
| 846 | + throw new ContractValidateException( |
| 847 | + "Bad chain parameter id [PROPOSAL_VOTING_WINDOW]"); |
| 848 | + } |
| 849 | + if (value <= MIN_PROPOSAL_VOTING_WINDOW |
| 850 | + || value > MAX_PROPOSAL_VOTING_WINDOW) { |
| 851 | + throw new ContractValidateException( |
| 852 | + "This value[PROPOSAL_VOTING_WINDOW] is only allowed to be greater than " |
| 853 | + + MIN_PROPOSAL_VOTING_WINDOW + " and less than or equal to " |
| 854 | + + MAX_PROPOSAL_VOTING_WINDOW + "!"); |
| 855 | + } |
| 856 | + break; |
| 857 | + } |
842 | 858 | default: |
843 | 859 | break; |
844 | 860 | } |
@@ -921,7 +937,8 @@ public enum ProposalType { // current value, value range |
921 | 937 | ALLOW_TVM_CANCUN(83), // 0, 1 |
922 | 938 | ALLOW_STRICT_MATH(87), // 0, 1 |
923 | 939 | CONSENSUS_LOGIC_OPTIMIZATION(88), // 0, 1 |
924 | | - ALLOW_TVM_BLOB(89); // 0, 1 |
| 940 | + ALLOW_TVM_BLOB(89), // 0, 1 |
| 941 | + PROPOSAL_VOTING_WINDOW(92); // (0, 10512000] |
925 | 942 |
|
926 | 943 | private long code; |
927 | 944 |
|
|
0 commit comments