Block, BitcoinNetwork, BitcoinNetworkParams, KeyChainGroupTest: use _000 in constants to improve readability

This commit is contained in:
Sean Gilligan 2023-03-18 12:08:49 -07:00 committed by Andreas Schildbach
parent 2061555afa
commit 0f216d328f
4 changed files with 5 additions and 5 deletions

View File

@ -51,7 +51,7 @@ public enum BitcoinNetwork implements Network {
/**
* The maximum number of coins to be generated
*/
private static final long MAX_COINS = 21000000;
private static final long MAX_COINS = 21_000_000;
/**
* The maximum money to be generated

View File

@ -88,7 +88,7 @@ public class Block extends Message {
* upgrade everyone to change this, so Bitcoin can continue to grow. For now it exists as an anti-DoS measure to
* avoid somebody creating a titanically huge but valid block and forcing everyone to download/store it forever.
*/
public static final int MAX_BLOCK_SIZE = 1 * 1000 * 1000;
public static final int MAX_BLOCK_SIZE = 1_000_000;
/**
* A "sigop" is a signature verification operation. Because they're expensive we also impose a separate limit on
* the number in a block to prevent somebody mining a huge block that has way more sigops than normal, so is very

View File

@ -59,7 +59,7 @@ public abstract class BitcoinNetworkParams extends NetworkParameters {
/**
* Block reward halving interval (number of blocks)
*/
public static final int REWARD_HALVING_INTERVAL = 210000;
public static final int REWARD_HALVING_INTERVAL = 210_000;
private static final Logger log = LoggerFactory.getLogger(BitcoinNetworkParams.class);

View File

@ -409,9 +409,9 @@ public class KeyChainGroupTest {
Instant now = TimeUtils.currentTime().truncatedTo(ChronoUnit.SECONDS);
TimeUtils.setMockClock(now);
assertEquals(now, group.earliestKeyCreationTime());
TimeUtils.rollMockClock(Duration.ofSeconds(10000));
TimeUtils.rollMockClock(Duration.ofSeconds(10_000));
group.freshKey(KeyChain.KeyPurpose.RECEIVE_FUNDS);
TimeUtils.rollMockClock(Duration.ofSeconds(10000));
TimeUtils.rollMockClock(Duration.ofSeconds(10_000));
group.freshKey(KeyChain.KeyPurpose.RECEIVE_FUNDS);
// Check that all keys are assumed to be created at the same instant the seed is.
assertEquals(now, group.earliestKeyCreationTime());