private void initConst(SystemProperties config) { minerCoinbase = config.getMinerCoinbase(); minerExtraData = config.getMineExtraData(); UNCLE_LIST_LIMIT = config.getBlockchainConfig().getCommonConstants().getUNCLE_LIST_LIMIT(); UNCLE_GENERATION_LIMIT = config.getBlockchainConfig().getCommonConstants().getUNCLE_GENERATION_LIMIT(); }
public GasLimitRule(SystemProperties config) { MIN_GAS_LIMIT = config.getBlockchainConfig(). getCommonConstants().getMIN_GAS_LIMIT(); }
public BestNumberRule(SystemProperties config) { BEST_NUMBER_DIFF_LIMIT = config.getBlockchainConfig(). getCommonConstants().getBEST_NUMBER_DIFF_LIMIT(); }
public AccountState(SystemProperties config) { this(config.getBlockchainConfig().getCommonConstants().getInitialNonce(), BigInteger.ZERO); }
public ParentGasLimitRule(SystemProperties config) { GAS_LIMIT_BOUND_DIVISOR = config.getBlockchainConfig(). getCommonConstants().getGAS_LIMIT_BOUND_DIVISOR(); }
public ExtraDataRule(SystemProperties config) { MAXIMUM_EXTRA_DATA_SIZE = config.getBlockchainConfig(). getCommonConstants().getMAXIMUM_EXTRA_DATA_SIZE(); }
public TransactionExecutor withCommonConfig(CommonConfig commonConfig) { this.commonConfig = commonConfig; this.config = commonConfig.systemProperties(); this.blockchainConfig = config.getBlockchainConfig().getConfigForBlock(currentBlock.getNumber()); return this; }
static SystemProperties getSpringDefault() { if (CONFIG == null) { CONFIG = new SystemProperties(); } return CONFIG; }
public EthashMiner(SystemProperties config) { this.config = config; cpuThreads = config.getMineCpuThreads(); fullMining = config.isMineFullDataset(); }
@Test(expected = RuntimeException.class) public void helper_shouldExit_whenDifferentVersionAndFlag() { final SystemProperties props1 = withConfig(1, null); resetHelper.process(props1); final SystemProperties props2 = withConfig(2, EXIT); resetHelper.process(props2); }
public Eip160HFConfig(BlockchainConfig parent) { super(parent); constants = new ConstantsAdapter(parent.getConstants()) { @Override public int getMAX_CONTRACT_SZIE() { return 0x6000; } }; }
private String getGeneratedNodePrivateKey() { if (generatedNodePrivateKey == null) { generatedNodePrivateKey = generateNodeIdStrategy.getNodePrivateKey(); } return generatedNodePrivateKey; }
/** * Returns the static config instance. If the config is passed * as a Spring bean by the application this instance shouldn't * be used * This method is mainly used for testing purposes * (Autowired fields are initialized with this static instance * but when running within Spring context they replaced with the * bean config instance) */ public static SystemProperties getDefault() { return useOnlySpringConfig ? null : getSpringDefault(); }
public static CommonConfig getDefault() { if (defaultInstance == null && !SystemProperties.isUseOnlySpringConfig()) { defaultInstance = new CommonConfig() { @Override public Source<byte[], ProgramPrecompile> precompileSource() { return null; } }; } return defaultInstance; }
public boolean accept(Node node) { for (Entry entry : entries) { if (entry.accept(node)) return true; } return false; }
/** * @return home node if config defines it as public, otherwise null */ Node getPublicHomeNode() { if (config.isPublicHomeNode()) { return homeNode; } return null; }
@Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof SystemProperties) { initConfig((SystemProperties) bean); } return bean; }
@Override public synchronized AccountState createAccount(byte[] addr) { AccountState state = new AccountState(config.getBlockchainConfig().getCommonConstants().getInitialNonce(), BigInteger.ZERO); accountStateCache.put(addr, state); return state; }
@Override public Constants getCommonConstants() { // TODO make a guard wrapper which throws exception if the requested constant differs among configs return configs[0].getConstants(); }
public boolean accept(InetAddress nodeAddr) { for (Entry entry : entries) { if (entry.accept(nodeAddr)) return true; } return false; }