Browse Source

Added to testRegisterNameFeeIncrease() test to catch the recently detected bug.

new-coins
CalDescent 2 years ago
parent
commit
d03c145189
  1. 9
      src/test/java/org/qortal/test/naming/MiscTests.java

9
src/test/java/org/qortal/test/naming/MiscTests.java

@ -356,8 +356,15 @@ public class MiscTests extends Common {
UnitFeesByTimestamp pastFeeIncrease = new UnitFeesByTimestamp(); UnitFeesByTimestamp pastFeeIncrease = new UnitFeesByTimestamp();
pastFeeIncrease.timestamp = now - 1000L; // 1 second ago pastFeeIncrease.timestamp = now - 1000L; // 1 second ago
pastFeeIncrease.fee = new AmountTypeAdapter().unmarshal("3"); pastFeeIncrease.fee = new AmountTypeAdapter().unmarshal("3");
FieldUtils.writeField(BlockChain.getInstance(), "nameRegistrationUnitFees", Arrays.asList(pastFeeIncrease), true);
// Set another increase in the future
futureFeeIncrease = new UnitFeesByTimestamp();
futureFeeIncrease.timestamp = now + (60 * 60 * 1000L); // 1 hour in the future
futureFeeIncrease.fee = new AmountTypeAdapter().unmarshal("10");
FieldUtils.writeField(BlockChain.getInstance(), "nameRegistrationUnitFees", Arrays.asList(pastFeeIncrease, futureFeeIncrease), true);
assertEquals(pastFeeIncrease.fee, BlockChain.getInstance().getNameRegistrationUnitFeeAtTimestamp(pastFeeIncrease.timestamp)); assertEquals(pastFeeIncrease.fee, BlockChain.getInstance().getNameRegistrationUnitFeeAtTimestamp(pastFeeIncrease.timestamp));
assertEquals(futureFeeIncrease.fee, BlockChain.getInstance().getNameRegistrationUnitFeeAtTimestamp(futureFeeIncrease.timestamp));
// Register a different name // Register a different name
// First try with the default unit fee // First try with the default unit fee

Loading…
Cancel
Save