Skip to content

Commit dc10d93

Browse files
committed
feat(conf): make compatible with old configurations
1 parent 27ff277 commit dc10d93

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

common/src/main/java/org/tron/core/Constant.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class Constant {
4040
public static final long PB_DEFAULT_ENERGY_LIMIT = 0L;
4141
public static final long CREATOR_DEFAULT_ENERGY_LIMIT = 1000 * 10_000L;
4242
public static final long MIN_PROPOSAL_EXPIRE_TIME = 0L; // 0 ms
43-
public static final long MAX_PROPOSAL_EXPIRE_TIME = 31536000000L; // ms of 365 days
43+
public static final long MAX_PROPOSAL_EXPIRE_TIME = 31536003000L; // ms of 365 days + 3000 ms
4444
public static final long DEFAULT_PROPOSAL_EXPIRE_TIME = 259200000L; // ms of 3 days
4545

4646

framework/src/test/java/org/tron/core/services/ProposalServiceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,14 @@ public void testProposalExpireTime() {
141141
Assert.assertEquals(proposalExpireTime, defaultWindow);
142142

143143
Proposal proposal = Proposal.newBuilder().putParameters(PROPOSAL_EXPIRE_TIME.getCode(),
144-
MAX_PROPOSAL_EXPIRE_TIME).build();
144+
31536000000L).build();
145145
ProposalCapsule proposalCapsule = new ProposalCapsule(proposal);
146146
proposalCapsule.setExpirationTime(1627279200000L);
147147
boolean result = ProposalService.process(dbManager, proposalCapsule);
148148
Assert.assertTrue(result);
149149

150150
long window = dbManager.getDynamicPropertiesStore().getProposalExpireTime();
151-
Assert.assertEquals(MAX_PROPOSAL_EXPIRE_TIME, window);
151+
Assert.assertEquals(MAX_PROPOSAL_EXPIRE_TIME - 3000, window);
152152
}
153153

154154
}

0 commit comments

Comments
 (0)