veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
altintegration::AltBlock Class Reference

Represents a view on Altchain block - i.e. More...

Detailed Description

contains partial info, only required for POP.

Definition at line 29 of file altblock.hpp.

#include <altblock.hpp>

+ Collaboration diagram for altintegration::AltBlock:

Public Types

using height_t = int32_t
 
using hash_t = std::vector< uint8_t >
 
using prev_hash_t = std::vector< uint8_t >
 
using addon_t = StoredAltBlockAddon::addon_t
 
using stored_addon_t = StoredAltBlockAddon
 

Public Member Functions

void toRaw (WriteStream &stream) const
 Convert AltBlock to data stream using AltBlock basic byte format. More...
 
void toVbkEncoding (WriteStream &stream) const
 for AltBlock Raw format == VbkEncoding
 
std::vector< uint8_t > toRaw () const
 Convert AltBlock to bytes data using AltBlock basic byte format. More...
 
size_t estimateSize () const
 
uint32_t getBlockTime () const noexcept
 
const hash_t & getHash () const
 
uint32_t getDifficulty () const
 
std::string toPrettyString () const
 Print this entity. More...
 
hash_t getPreviousBlock () const
 
uint32_t getTimestamp () const
 
height_t getHeight () const
 

Public Attributes

hash_t hash {}
 
hash_t previousBlock {}
 
uint32_t timestamp {}
 
height_t height {}
 

Friends

bool operator== (const AltBlock &a, const AltBlock &b)
 
bool operator!= (const AltBlock &a, const AltBlock &b)
 

Member Typedef Documentation

◆ addon_t

using altintegration::AltBlock::addon_t = StoredAltBlockAddon::addon_t

Definition at line 33 of file altblock.hpp.

◆ hash_t

using altintegration::AltBlock::hash_t = std::vector<uint8_t>

Definition at line 31 of file altblock.hpp.

◆ height_t

using altintegration::AltBlock::height_t = int32_t

Definition at line 30 of file altblock.hpp.

◆ prev_hash_t

using altintegration::AltBlock::prev_hash_t = std::vector<uint8_t>

Definition at line 32 of file altblock.hpp.

◆ stored_addon_t

using altintegration::AltBlock::stored_addon_t = StoredAltBlockAddon

Definition at line 34 of file altblock.hpp.

Member Function Documentation

◆ getDifficulty()

uint32_t altintegration::AltBlock::getDifficulty ( ) const
inline

Definition at line 61 of file altblock.hpp.

61{ return 0; }

◆ getHash()

const hash_t & altintegration::AltBlock::getHash ( ) const
Returns
hash of ALT block.

◆ getHeight()

height_t altintegration::AltBlock::getHeight ( ) const
inline

Definition at line 77 of file altblock.hpp.

77{ return height; }

◆ getPreviousBlock()

hash_t altintegration::AltBlock::getPreviousBlock ( ) const
inline

Definition at line 75 of file altblock.hpp.

75{ return previousBlock; }

◆ getTimestamp()

uint32_t altintegration::AltBlock::getTimestamp ( ) const
inline

Definition at line 76 of file altblock.hpp.

76{ return timestamp; }

◆ toPrettyString()

std::string altintegration::AltBlock::toPrettyString ( ) const
Returns

◆ toRaw() [1/2]

std::vector< uint8_t > altintegration::AltBlock::toRaw ( ) const
Returns
string represantation of the data

◆ toRaw() [2/2]

void altintegration::AltBlock::toRaw ( WriteStream stream) const
Parameters
streamdata stream to write into

Member Data Documentation

◆ hash

hash_t altintegration::AltBlock::hash {}

Definition at line 79 of file altblock.hpp.

◆ height

height_t altintegration::AltBlock::height {}

Definition at line 82 of file altblock.hpp.

◆ previousBlock

hash_t altintegration::AltBlock::previousBlock {}

Definition at line 80 of file altblock.hpp.

◆ timestamp

uint32_t altintegration::AltBlock::timestamp {}

Definition at line 81 of file altblock.hpp.


The documentation for this class was generated from the following file: