@Test public void name() throws IOException, NulsException { ChainParameters parameters = new ChainParameters(2, 1, 5242880, 1800000, (byte) 3, 1000, 1000, 1000, (byte) 60, (byte) 1, (byte) 10, 1024, 60000, (byte) 6, (byte) 10, "INFO", 15000, 5000, "", 20971520); byte[] bytes = parameters.serialize(); ChainParameters p = new ChainParameters(); p.parse(new NulsByteBuffer(bytes)); Assert.assertEquals(parameters, p); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.chainId = byteBuffer.readUint16(); this.assetId = byteBuffer.readUint16(); this.blockMaxSize = byteBuffer.readUint32(); this.resetTime = byteBuffer.readUint32(); this.chainSwtichThreshold = byteBuffer.readByte(); this.cacheSize = byteBuffer.readUint16(); this.heightRange = byteBuffer.readUint16(); this.maxRollback = byteBuffer.readUint16(); this.consistencyNodePercent = byteBuffer.readByte(); this.minNodeAmount = byteBuffer.readByte(); this.downloadNumber = byteBuffer.readByte(); this.extendMaxSize = byteBuffer.readUint16(); this.validBlockInterval = byteBuffer.readUint16(); this.smallBlockCache = byteBuffer.readByte(); this.orphanChainMaxAge = byteBuffer.readByte(); this.logLevel = byteBuffer.readString(); this.singleDownloadTimeout = byteBuffer.readUint16(); this.waitNetworkInterval = byteBuffer.readUint16(); this.genesisBlockPath = byteBuffer.readString(); this.cachedBlockSizeLimit = byteBuffer.readUint32(); }
ChainParameters extends BaseNulsData { @Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.chainId = byteBuffer.readUint16(); this.assetId = byteBuffer.readUint16(); this.blockMaxSize = byteBuffer.readUint32(); this.resetTime = byteBuffer.readUint32(); this.chainSwtichThreshold = byteBuffer.readByte(); this.cacheSize = byteBuffer.readUint16(); this.heightRange = byteBuffer.readUint16(); this.maxRollback = byteBuffer.readUint16(); this.consistencyNodePercent = byteBuffer.readByte(); this.minNodeAmount = byteBuffer.readByte(); this.downloadNumber = byteBuffer.readByte(); this.extendMaxSize = byteBuffer.readUint16(); this.validBlockInterval = byteBuffer.readUint16(); this.smallBlockCache = byteBuffer.readByte(); this.orphanChainMaxAge = byteBuffer.readByte(); this.logLevel = byteBuffer.readString(); this.singleDownloadTimeout = byteBuffer.readUint16(); this.waitNetworkInterval = byteBuffer.readUint16(); this.genesisBlockPath = byteBuffer.readString(); this.cachedBlockSizeLimit = byteBuffer.readUint32(); } }
ChainParameters extends BaseNulsData { @Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.chainId = byteBuffer.readUint16(); this.assetId = byteBuffer.readUint16(); this.blockMaxSize = byteBuffer.readUint32(); this.resetTime = byteBuffer.readUint32(); this.chainSwtichThreshold = byteBuffer.readByte(); this.cacheSize = byteBuffer.readUint16(); this.heightRange = byteBuffer.readUint16(); this.maxRollback = byteBuffer.readUint16(); this.consistencyNodePercent = byteBuffer.readByte(); this.minNodeAmount = byteBuffer.readByte(); this.downloadNumber = byteBuffer.readByte(); this.extendMaxSize = byteBuffer.readUint16(); this.validBlockInterval = byteBuffer.readUint16(); this.smallBlockCache = byteBuffer.readByte(); this.orphanChainMaxAge = byteBuffer.readByte(); this.logLevel = byteBuffer.readString(); this.singleDownloadTimeout = byteBuffer.readUint16(); this.waitNetworkInterval = byteBuffer.readUint16(); this.genesisBlockPath = byteBuffer.readString(); this.cachedBlockSizeLimit = byteBuffer.readUint32(); } ChainParameters(int chainId, int assetId, long blockMaxSize, long resetTime, byte chainSwtichThreshold, int cacheSize, int heightRange, int maxRollback, byte consistencyNodePercent, byte minNodeAmount, byte downloadNumber, int extendMaxSize, int validBlockInterval, byte smallBlockCache, byte orphanChainMaxAge, String logLevel, int singleDownloadTimeout, int waitNetworkInterval, String genesisBlockPath, long cachedBlockSizeLimit);  ChainParameters(); }
ChainParameters extends BaseNulsData { @Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.chainId = byteBuffer.readUint16(); this.assetId = byteBuffer.readUint16(); this.blockMaxSize = byteBuffer.readUint32(); this.resetTime = byteBuffer.readUint32(); this.chainSwtichThreshold = byteBuffer.readByte(); this.cacheSize = byteBuffer.readUint16(); this.heightRange = byteBuffer.readUint16(); this.maxRollback = byteBuffer.readUint16(); this.consistencyNodePercent = byteBuffer.readByte(); this.minNodeAmount = byteBuffer.readByte(); this.downloadNumber = byteBuffer.readByte(); this.extendMaxSize = byteBuffer.readUint16(); this.validBlockInterval = byteBuffer.readUint16(); this.smallBlockCache = byteBuffer.readByte(); this.orphanChainMaxAge = byteBuffer.readByte(); this.logLevel = byteBuffer.readString(); this.singleDownloadTimeout = byteBuffer.readUint16(); this.waitNetworkInterval = byteBuffer.readUint16(); this.genesisBlockPath = byteBuffer.readString(); this.cachedBlockSizeLimit = byteBuffer.readUint32(); } ChainParameters(int chainId, int assetId, long blockMaxSize, long resetTime, byte chainSwtichThreshold, int cacheSize, int heightRange, int maxRollback, byte consistencyNodePercent, byte minNodeAmount, byte downloadNumber, int extendMaxSize, int validBlockInterval, byte smallBlockCache, byte orphanChainMaxAge, String logLevel, int singleDownloadTimeout, int waitNetworkInterval, String genesisBlockPath, long cachedBlockSizeLimit);  ChainParameters(); int getChainId(); void setChainId(int chainId); int getAssetId(); void setAssetId(int assetId); long getBlockMaxSize(); void setBlockMaxSize(long blockMaxSize); long getResetTime(); void setResetTime(long resetTime); byte getChainSwtichThreshold(); int getCacheSize(); void setCacheSize(int cacheSize); int getHeightRange(); void setHeightRange(int heightRange); int getMaxRollback(); void setMaxRollback(int maxRollback); void setChainSwtichThreshold(byte chainSwtichThreshold); byte getConsistencyNodePercent(); void setConsistencyNodePercent(byte consistencyNodePercent); byte getMinNodeAmount(); void setMinNodeAmount(byte minNodeAmount); byte getDownloadNumber(); int getExtendMaxSize(); void setExtendMaxSize(int extendMaxSize); int getValidBlockInterval(); void setValidBlockInterval(int validBlockInterval); void setDownloadNumber(byte downloadNumber); byte getSmallBlockCache(); void setSmallBlockCache(byte smallBlockCache); byte getOrphanChainMaxAge(); String getLogLevel(); void setLogLevel(String logLevel); void setOrphanChainMaxAge(byte orphanChainMaxAge); int getSingleDownloadTimeout(); int getWaitNetworkInterval(); void setWaitNetworkInterval(int waitNetworkInterval); void setSingleDownloadTimeout(int singleDownloadTimeout); String getGenesisBlockPath(); void setGenesisBlockPath(String genesisBlockPath); long getCachedBlockSizeLimit(); void setCachedBlockSizeLimit(long cachedBlockSizeLimit); @Override void parse(NulsByteBuffer byteBuffer); @Override int size(); @Override boolean equals(Object o); @Override int hashCode(); }
ChainParameters extends BaseNulsData { @Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.chainId = byteBuffer.readUint16(); this.assetId = byteBuffer.readUint16(); this.blockMaxSize = byteBuffer.readUint32(); this.resetTime = byteBuffer.readUint32(); this.chainSwtichThreshold = byteBuffer.readByte(); this.cacheSize = byteBuffer.readUint16(); this.heightRange = byteBuffer.readUint16(); this.maxRollback = byteBuffer.readUint16(); this.consistencyNodePercent = byteBuffer.readByte(); this.minNodeAmount = byteBuffer.readByte(); this.downloadNumber = byteBuffer.readByte(); this.extendMaxSize = byteBuffer.readUint16(); this.validBlockInterval = byteBuffer.readUint16(); this.smallBlockCache = byteBuffer.readByte(); this.orphanChainMaxAge = byteBuffer.readByte(); this.logLevel = byteBuffer.readString(); this.singleDownloadTimeout = byteBuffer.readUint16(); this.waitNetworkInterval = byteBuffer.readUint16(); this.genesisBlockPath = byteBuffer.readString(); this.cachedBlockSizeLimit = byteBuffer.readUint32(); } ChainParameters(int chainId, int assetId, long blockMaxSize, long resetTime, byte chainSwtichThreshold, int cacheSize, int heightRange, int maxRollback, byte consistencyNodePercent, byte minNodeAmount, byte downloadNumber, int extendMaxSize, int validBlockInterval, byte smallBlockCache, byte orphanChainMaxAge, String logLevel, int singleDownloadTimeout, int waitNetworkInterval, String genesisBlockPath, long cachedBlockSizeLimit);  ChainParameters(); int getChainId(); void setChainId(int chainId); int getAssetId(); void setAssetId(int assetId); long getBlockMaxSize(); void setBlockMaxSize(long blockMaxSize); long getResetTime(); void setResetTime(long resetTime); byte getChainSwtichThreshold(); int getCacheSize(); void setCacheSize(int cacheSize); int getHeightRange(); void setHeightRange(int heightRange); int getMaxRollback(); void setMaxRollback(int maxRollback); void setChainSwtichThreshold(byte chainSwtichThreshold); byte getConsistencyNodePercent(); void setConsistencyNodePercent(byte consistencyNodePercent); byte getMinNodeAmount(); void setMinNodeAmount(byte minNodeAmount); byte getDownloadNumber(); int getExtendMaxSize(); void setExtendMaxSize(int extendMaxSize); int getValidBlockInterval(); void setValidBlockInterval(int validBlockInterval); void setDownloadNumber(byte downloadNumber); byte getSmallBlockCache(); void setSmallBlockCache(byte smallBlockCache); byte getOrphanChainMaxAge(); String getLogLevel(); void setLogLevel(String logLevel); void setOrphanChainMaxAge(byte orphanChainMaxAge); int getSingleDownloadTimeout(); int getWaitNetworkInterval(); void setWaitNetworkInterval(int waitNetworkInterval); void setSingleDownloadTimeout(int singleDownloadTimeout); String getGenesisBlockPath(); void setGenesisBlockPath(String genesisBlockPath); long getCachedBlockSizeLimit(); void setCachedBlockSizeLimit(long cachedBlockSizeLimit); @Override void parse(NulsByteBuffer byteBuffer); @Override int size(); @Override boolean equals(Object o); @Override int hashCode();  }