Package io.nem.symbol.catapult.builders
Class ImportanceBlockHeaderBuilder
- java.lang.Object
-
- io.nem.symbol.catapult.builders.BlockHeaderBuilder
-
- io.nem.symbol.catapult.builders.ImportanceBlockHeaderBuilder
-
- All Implemented Interfaces:
Serializer
public class ImportanceBlockHeaderBuilder extends BlockHeaderBuilder implements Serializer
Binary layout for an importance block header
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedImportanceBlockHeaderBuilder(SignatureDto signature, KeyDto signerPublicKey, byte version, NetworkTypeDto network, EntityTypeDto type, HeightDto height, TimestampDto timestamp, DifficultyDto difficulty, VrfProofBuilder generationHashProof, Hash256Dto previousBlockHash, Hash256Dto transactionsHash, Hash256Dto receiptsHash, Hash256Dto stateHash, AddressDto beneficiaryAddress, BlockFeeMultiplierDto feeMultiplier, int votingEligibleAccountsCount, long harvestingEligibleAccountsCount, AmountDto totalVotingBalance, Hash256Dto previousImportanceBlockHash)Constructor.protectedImportanceBlockHeaderBuilder(java.io.DataInputStream stream)Constructor - Creates an object from stream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImportanceBlockHeaderBuildercreate(SignatureDto signature, KeyDto signerPublicKey, byte version, NetworkTypeDto network, EntityTypeDto type, HeightDto height, TimestampDto timestamp, DifficultyDto difficulty, VrfProofBuilder generationHashProof, Hash256Dto previousBlockHash, Hash256Dto transactionsHash, Hash256Dto receiptsHash, Hash256Dto stateHash, AddressDto beneficiaryAddress, BlockFeeMultiplierDto feeMultiplier, int votingEligibleAccountsCount, long harvestingEligibleAccountsCount, AmountDto totalVotingBalance, Hash256Dto previousImportanceBlockHash)Creates an instance of ImportanceBlockHeaderBuilder.longgetHarvestingEligibleAccountsCount()Gets number of harvesting eligible accounts.Hash256DtogetPreviousImportanceBlockHash()Gets previous importance block hash.intgetSize()Gets the size of the object.AmountDtogetTotalVotingBalance()Gets total balance eligible for voting.intgetVotingEligibleAccountsCount()Gets number of voting eligible accounts.static ImportanceBlockHeaderBuilderloadFromBinary(java.io.DataInputStream stream)Creates an instance of ImportanceBlockHeaderBuilder from a stream.byte[]serialize()Serializes an object to bytes.-
Methods inherited from class io.nem.symbol.catapult.builders.BlockHeaderBuilder
create, getBeneficiaryAddress, getDifficulty, getFeeMultiplier, getGenerationHashProof, getHeight, getNetwork, getPreviousBlockHash, getReceiptsHash, getSignature, getSignerPublicKey, getStateHash, getStreamSize, getTimestamp, getTransactionsHash, getType, getVersion
-
-
-
-
Constructor Detail
-
ImportanceBlockHeaderBuilder
protected ImportanceBlockHeaderBuilder(java.io.DataInputStream stream)
Constructor - Creates an object from stream.- Parameters:
stream- Byte stream to use to serialize the object.
-
ImportanceBlockHeaderBuilder
protected ImportanceBlockHeaderBuilder(SignatureDto signature, KeyDto signerPublicKey, byte version, NetworkTypeDto network, EntityTypeDto type, HeightDto height, TimestampDto timestamp, DifficultyDto difficulty, VrfProofBuilder generationHashProof, Hash256Dto previousBlockHash, Hash256Dto transactionsHash, Hash256Dto receiptsHash, Hash256Dto stateHash, AddressDto beneficiaryAddress, BlockFeeMultiplierDto feeMultiplier, int votingEligibleAccountsCount, long harvestingEligibleAccountsCount, AmountDto totalVotingBalance, Hash256Dto previousImportanceBlockHash)
Constructor.- Parameters:
signature- Entity signature.signerPublicKey- Entity signer's public key.version- Entity version.network- Entity network.type- Entity type.height- Block height.timestamp- Number of milliseconds elapsed since creation of nemesis block.difficulty- Block difficulty.generationHashProof- Generation hash proof.previousBlockHash- Previous block hash.transactionsHash- Hash of the transactions in this block.receiptsHash- Hash of the receipts generated by this block.stateHash- Hash of the global chain state at this block.beneficiaryAddress- Beneficiary address designated by harvester.feeMultiplier- Fee multiplier applied to block transactions.votingEligibleAccountsCount- Number of voting eligible accounts.harvestingEligibleAccountsCount- Number of harvesting eligible accounts.totalVotingBalance- Total balance eligible for voting.previousImportanceBlockHash- Previous importance block hash.
-
-
Method Detail
-
loadFromBinary
public static ImportanceBlockHeaderBuilder loadFromBinary(java.io.DataInputStream stream)
Creates an instance of ImportanceBlockHeaderBuilder from a stream.- Parameters:
stream- Byte stream to use to serialize the object.- Returns:
- Instance of ImportanceBlockHeaderBuilder.
-
create
public static ImportanceBlockHeaderBuilder create(SignatureDto signature, KeyDto signerPublicKey, byte version, NetworkTypeDto network, EntityTypeDto type, HeightDto height, TimestampDto timestamp, DifficultyDto difficulty, VrfProofBuilder generationHashProof, Hash256Dto previousBlockHash, Hash256Dto transactionsHash, Hash256Dto receiptsHash, Hash256Dto stateHash, AddressDto beneficiaryAddress, BlockFeeMultiplierDto feeMultiplier, int votingEligibleAccountsCount, long harvestingEligibleAccountsCount, AmountDto totalVotingBalance, Hash256Dto previousImportanceBlockHash)
Creates an instance of ImportanceBlockHeaderBuilder.- Parameters:
signature- Entity signature.signerPublicKey- Entity signer's public key.version- Entity version.network- Entity network.type- Entity type.height- Block height.timestamp- Number of milliseconds elapsed since creation of nemesis block.difficulty- Block difficulty.generationHashProof- Generation hash proof.previousBlockHash- Previous block hash.transactionsHash- Hash of the transactions in this block.receiptsHash- Hash of the receipts generated by this block.stateHash- Hash of the global chain state at this block.beneficiaryAddress- Beneficiary address designated by harvester.feeMultiplier- Fee multiplier applied to block transactions.votingEligibleAccountsCount- Number of voting eligible accounts.harvestingEligibleAccountsCount- Number of harvesting eligible accounts.totalVotingBalance- Total balance eligible for voting.previousImportanceBlockHash- Previous importance block hash.- Returns:
- Instance of ImportanceBlockHeaderBuilder.
-
getVotingEligibleAccountsCount
public int getVotingEligibleAccountsCount()
Gets number of voting eligible accounts.- Returns:
- Number of voting eligible accounts.
-
getHarvestingEligibleAccountsCount
public long getHarvestingEligibleAccountsCount()
Gets number of harvesting eligible accounts.- Returns:
- Number of harvesting eligible accounts.
-
getTotalVotingBalance
public AmountDto getTotalVotingBalance()
Gets total balance eligible for voting.- Returns:
- Total balance eligible for voting.
-
getPreviousImportanceBlockHash
public Hash256Dto getPreviousImportanceBlockHash()
Gets previous importance block hash.- Returns:
- Previous importance block hash.
-
getSize
public int getSize()
Gets the size of the object.- Specified by:
getSizein interfaceSerializer- Overrides:
getSizein classBlockHeaderBuilder- Returns:
- Size in bytes.
-
serialize
public byte[] serialize()
Serializes an object to bytes.- Specified by:
serializein interfaceSerializer- Overrides:
serializein classBlockHeaderBuilder- Returns:
- Serialized bytes.
-
-