Scorum
block_header.hpp
Go to the documentation of this file.
1 #pragma once
3 
4 namespace scorum {
5 namespace protocol {
6 
8 {
9  digest_type digest() const;
11 
12  uint32_t block_num() const
13  {
14  return num_from_id(previous) + 1;
15  }
16 
17  fc::time_point_sec timestamp;
18  std::string witness;
21 
22  static uint32_t num_from_id(const block_id_type& id);
23 };
24 
26 {
27  block_id_type id() const;
28  fc::ecc::public_key signee() const;
29  void sign(const fc::ecc::private_key& signer);
30  bool validate_signee(const fc::ecc::public_key& expected_signee) const;
31 
33 };
34 }
35 } // scorum::protocol
36 
37 FC_REFLECT(scorum::protocol::block_header, (previous)(timestamp)(witness)(transaction_merkle_root)(extensions))
38 FC_REFLECT_DERIVED(scorum::protocol::signed_block_header, (scorum::protocol::block_header), (witness_signature))
FC_REFLECT(appender_args,(appender)(stream)) FC_REFLECT_DERIVED(file_appender_args
fc::ripemd160 checksum_type
Definition: types.hpp:64
flat_set< block_header_extensions > block_header_extensions_type
Definition: base.hpp:82
fc::sha256 digest_type
Definition: types.hpp:66
fc::ripemd160 block_id_type
Definition: types.hpp:63
fc::ecc::compact_signature signature_type
Definition: types.hpp:67
Definition: asset.cpp:15
static uint32_t num_from_id(const block_id_type &id)
Definition: block.cpp:14
block_header_extensions_type extensions
digest_type digest() const
Definition: block.cpp:9
fc::time_point_sec timestamp
fc::ecc::public_key signee() const
Definition: block.cpp:30
void sign(const fc::ecc::private_key &signer)
Definition: block.cpp:35
bool validate_signee(const fc::ecc::public_key &expected_signee) const
Definition: block.cpp:40
block_id_type id() const
Definition: block.cpp:19