当前位置: 首页>>代码示例>>Java>>正文


Java BlockchainConfig类代码示例

本文整理汇总了Java中org.ethereum.config.BlockchainConfig的典型用法代码示例。如果您正苦于以下问题:Java BlockchainConfig类的具体用法?Java BlockchainConfig怎么用?Java BlockchainConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BlockchainConfig类属于org.ethereum.config包,在下文中一共展示了BlockchainConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getContractForAddress

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
public static PrecompiledContract getContractForAddress(DataWord address, BlockchainConfig config) {

        if (address == null) return identity;
        if (address.equals(ecRecoverAddr)) return ecRecover;
        if (address.equals(sha256Addr)) return sha256;
        if (address.equals(ripempd160Addr)) return ripempd160;
        if (address.equals(identityAddr)) return identity;

        // Byzantium precompiles
        if (address.equals(modExpAddr) && config.eip198()) return modExp;
        if (address.equals(altBN128AddAddr) && config.eip213()) return altBN128Add;
        if (address.equals(altBN128MulAddr) && config.eip213()) return altBN128Mul;
        if (address.equals(altBN128PairingAddr) && config.eip212()) return altBN128Pairing;

        return null;
    }
 
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:17,代码来源:PrecompiledContracts.java

示例2: add

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
public void add(long startBlockNumber, BlockchainConfig config) {
    if (count >= blockNumbers.length) {
        throw new RuntimeException();
    }
    if (count > 0 && blockNumbers[count] >= startBlockNumber) {
        throw new RuntimeException("Block numbers should increase");
    }
    if (count == 0 && startBlockNumber > 0) {
        throw new RuntimeException("First config should start from block 0");
    }

    blockNumbers[count] = startBlockNumber;
    configs[count] = config;
    count++;
}
 
开发者ID:rsksmart,项目名称:rskj,代码行数:16,代码来源:AbstractNetConfig.java

示例3: getConfigForBlock

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
@Override
public BlockchainConfig getConfigForBlock(long blockNumber) {
    for (int i = 0; i < count; i++) {
        if (blockNumber < blockNumbers[i]) {
            return configs[i - 1];
        }
    }
    return configs[count - 1];
}
 
开发者ID:rsksmart,项目名称:rskj,代码行数:10,代码来源:AbstractNetConfig.java

示例4: add

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
public void add(long startBlockNumber, BlockchainConfig config) {
    if (count >= blockNumbers.length) throw new RuntimeException();
    if (count > 0 && blockNumbers[count] >= startBlockNumber)
        throw new RuntimeException("Block numbers should increase");
    if (count == 0 && startBlockNumber > 0) throw new RuntimeException("First config should start from block 0");
    blockNumbers[count] = startBlockNumber;
    configs[count] = config;
    count++;
}
 
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:10,代码来源:BaseNetConfig.java

示例5: getConfigForBlock

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
@Override
public BlockchainConfig getConfigForBlock(long blockNumber) {
    for (int i = 0; i < count; i++) {
        if (blockNumber < blockNumbers[i]) return configs[i - 1];
    }
    return configs[count - 1];
}
 
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:8,代码来源:BaseNetConfig.java

示例6: Eip160HFConfig

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
public Eip160HFConfig(BlockchainConfig parent) {
    super(parent);
    constants = new ConstantsAdapter(parent.getConstants()) {
        @Override
        public int getMAX_CONTRACT_SZIE() {
            return 0x6000;
        }
    };
}
 
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:10,代码来源:Eip160HFConfig.java

示例7: initDaoConfig

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
@Override
protected void initDaoConfig(BlockchainConfig parent, long forkBlockNumber) {
    super.initDaoConfig(parent, forkBlockNumber);
    try {
        ObjectMapper objectMapper = new ObjectMapper();
        DaoAcct[] daoAccts = objectMapper.readValue(accountsJson.replace('\'', '"'), DaoAcct[].class);
        for (DaoAcct daoAcct : daoAccts) {
            daoAccounts.add(Hex.decode(daoAcct.address.substring(2)));
            daoAccounts.add(Hex.decode(daoAcct.extraBalanceAccount.substring(2)));
        }
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:15,代码来源:DaoHFConfig.java

示例8: ByzantiumConfig

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
public ByzantiumConfig(BlockchainConfig parent) {
    super(parent);
    constants = new ConstantsAdapter(super.getConstants()) {
        private final BigInteger BLOCK_REWARD = new BigInteger("3000000000000000000");

        @Override
        public BigInteger getBLOCK_REWARD() {
            return BLOCK_REWARD;
        }
    };
}
 
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:12,代码来源:ByzantiumConfig.java

示例9: initDaoConfig

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
protected void initDaoConfig(BlockchainConfig parent, long forkBlockNumber) {
    this.parent = parent;
    this.constants = parent.getConstants();
    this.forkBlockNumber = forkBlockNumber;
    BlockHeaderRule rule = new ExtraDataPresenceRule(DAO_EXTRA_DATA, supportFork);
    headerValidators().add(Pair.of(forkBlockNumber, new BlockHeaderValidator(rule)));
}
 
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:8,代码来源:AbstractDaoConfig.java

示例10: getConfigForBlock

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
@Override
public BlockchainConfig getConfigForBlock(long blockHeader) {
    return this;
}
 
开发者ID:rsksmart,项目名称:rskj,代码行数:5,代码来源:AbstractConfig.java

示例11: getBlockchainConfig

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
public BlockchainConfig getBlockchainConfig() {
    return blockchainConfig;
}
 
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:4,代码来源:Program.java

示例12: DaoNoHFConfig

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
public DaoNoHFConfig(BlockchainConfig parent, long forkBlockNumber) {
    initDaoConfig(parent, forkBlockNumber);
}
 
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:4,代码来源:DaoNoHFConfig.java

示例13: RopstenConfig

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
public RopstenConfig(BlockchainConfig parent) {
    super(parent);
    headerValidators().add(Pair.of(CHECK_BLOCK_NUMBER, new BlockHeaderValidator(new BlockCustomHashRule(CHECK_BLOCK_HASH))));
}
 
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:5,代码来源:RopstenConfig.java

示例14: DaoHFConfig

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
public DaoHFConfig(BlockchainConfig parent, long forkBlockNumber) {
    initDaoConfig(parent, forkBlockNumber);
}
 
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:4,代码来源:DaoHFConfig.java

示例15: Eip150HFConfig

import org.ethereum.config.BlockchainConfig; //导入依赖的package包/类
public Eip150HFConfig(BlockchainConfig parent) {
    this.parent = parent;
}
 
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:4,代码来源:Eip150HFConfig.java


注:本文中的org.ethereum.config.BlockchainConfig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。