Line data Source code
1 : /**
2 : * Copyright Soramitsu Co., Ltd. All Rights Reserved.
3 : * SPDX-License-Identifier: Apache-2.0
4 : */
5 :
6 : #include "model/generators/block_generator.hpp"
7 :
8 : #include "model/sha3_hash.hpp"
9 :
10 : namespace iroha {
11 : namespace model {
12 : namespace generators {
13 : Block BlockGenerator::generateGenesisBlock(
14 : ts64_t created_ts, const std::vector<Transaction> &transactions) {
15 0 : Block block{};
16 0 : block.created_ts = created_ts;
17 0 : block.height = 1;
18 0 : std::fill(block.prev_hash.begin(), block.prev_hash.end(), 0);
19 0 : block.txs_number = 1;
20 0 : block.transactions = transactions;
21 0 : block.hash = hash(block);
22 :
23 0 : return block;
24 0 : }
25 :
26 : } // namespace generators
27 : } // namespace model
28 : } // namespace iroha
|