BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
libraries
chain
genesis_state.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 Cryptonomex, Inc., and contributors.
3
*
4
* The MIT License
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to deal
8
* in the Software without restriction, including without limitation the rights
9
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
* copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included in
14
* all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
* THE SOFTWARE.
23
*/
24
25
#include <
graphene/chain/genesis_state.hpp
>
26
#include <
graphene/protocol/fee_schedule.hpp
>
27
28
#include <
fc/io/raw.hpp
>
29
30
namespace
graphene
{
namespace
chain {
31
32
chain_id_type
genesis_state_type::compute_chain_id
()
const
33
{
34
return
initial_chain_id
;
35
}
36
37
void
genesis_state_type::override_witness_signing_keys
(
const
std::string& new_key )
38
{
39
public_key_type
new_pubkey( new_key );
40
for
(
auto
& wit :
initial_witness_candidates
)
41
{
42
wit.block_signing_key = new_pubkey;
43
}
44
}
45
46
} }
// graphene::chain
47
48
FC_REFLECT_DERIVED_NO_TYPENAME
(
graphene::chain::genesis_state_type::initial_account_type
, BOOST_PP_SEQ_NIL,
49
(name)(owner_key)(active_key)(is_lifetime_member) )
50
51
FC_REFLECT_DERIVED_NO_TYPENAME
(
graphene::chain::genesis_state_type::initial_asset_type
, BOOST_PP_SEQ_NIL,
52
(symbol)(issuer_name)(description)(precision)(max_supply)(accumulated_fees)(is_bitasset)
53
(collateral_records))
54
55
FC_REFLECT_DERIVED_NO_TYPENAME
(
graphene::chain::genesis_state_type::initial_asset_type::initial_collateral_position
,
56
BOOST_PP_SEQ_NIL, (owner)(collateral)(debt))
57
58
FC_REFLECT_DERIVED_NO_TYPENAME
(
graphene::chain::genesis_state_type::initial_balance_type
, BOOST_PP_SEQ_NIL,
59
(owner)(asset_symbol)(amount))
60
61
FC_REFLECT_DERIVED_NO_TYPENAME
(
graphene::chain::genesis_state_type::initial_vesting_balance_type
, BOOST_PP_SEQ_NIL,
62
(owner)(asset_symbol)(amount)(begin_timestamp)(vesting_duration_seconds)(begin_balance))
63
64
FC_REFLECT_DERIVED_NO_TYPENAME
(
graphene::chain::genesis_state_type::initial_witness_type
, BOOST_PP_SEQ_NIL,
65
(owner_name)(block_signing_key))
66
67
FC_REFLECT_DERIVED_NO_TYPENAME
(
graphene::chain::genesis_state_type::initial_committee_member_type
, BOOST_PP_SEQ_NIL,
68
(owner_name))
69
70
FC_REFLECT_DERIVED_NO_TYPENAME
(
graphene::chain::genesis_state_type::initial_worker_type
, BOOST_PP_SEQ_NIL,
71
(owner_name)(daily_pay))
72
73
FC_REFLECT_DERIVED_NO_TYPENAME
(
graphene::chain::genesis_state_type
, BOOST_PP_SEQ_NIL,
74
(initial_timestamp)(max_core_supply)(initial_parameters)(initial_accounts)(initial_assets)
75
(initial_balances)(initial_vesting_balances)(initial_active_witnesses)(initial_witness_candidates)
76
(initial_committee_candidates)(initial_worker_candidates)
77
(immutable_parameters))
78
79
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION
(
graphene::chain::genesis_state_type::initial_account_type
)
80
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION
(
graphene::chain::genesis_state_type::initial_asset_type
)
81
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION
(
graphene::chain::genesis_state_type::initial_asset_type::initial_collateral_position
)
82
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION
(
graphene::chain::genesis_state_type::initial_balance_type
)
83
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION
(
graphene::chain::genesis_state_type::initial_vesting_balance_type
)
84
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION
(
graphene::chain::genesis_state_type::initial_witness_type
)
85
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION
(
graphene::chain::genesis_state_type::initial_committee_member_type
)
86
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION
(
graphene::chain::genesis_state_type::initial_worker_type
)
87
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION
(
graphene::chain::genesis_state_type
)
graphene::chain::genesis_state_type::initial_asset_type::initial_collateral_position
Definition:
genesis_state.hpp:57
genesis_state.hpp
graphene::chain::genesis_state_type::initial_witness_candidates
vector< initial_witness_type > initial_witness_candidates
Definition:
genesis_state.hpp:112
graphene::chain::genesis_state_type::compute_chain_id
chain_id_type compute_chain_id() const
Definition:
genesis_state.cpp:32
graphene::chain::genesis_state_type::initial_chain_id
chain_id_type initial_chain_id
Definition:
genesis_state.hpp:119
fee_schedule.hpp
fc::sha256
Definition:
sha256.hpp:10
graphene::chain::genesis_state_type::initial_witness_type
Definition:
genesis_state.hpp:88
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION
#define GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION(type)
Definition:
types.hpp:86
graphene::protocol::public_key_type
Definition:
types.hpp:312
graphene::chain::genesis_state_type::initial_asset_type
Definition:
genesis_state.hpp:56
graphene::chain::genesis_state_type::initial_worker_type
Definition:
genesis_state.hpp:97
graphene::chain::genesis_state_type::initial_vesting_balance_type
Definition:
genesis_state.hpp:80
graphene::chain::genesis_state_type::initial_account_type
Definition:
genesis_state.hpp:41
FC_REFLECT_DERIVED_NO_TYPENAME
#define FC_REFLECT_DERIVED_NO_TYPENAME(TYPE, INHERITS, MEMBERS)
Definition:
reflect.hpp:357
graphene::chain::genesis_state_type::initial_balance_type
Definition:
genesis_state.hpp:75
graphene::chain::genesis_state_type::override_witness_signing_keys
void override_witness_signing_keys(const std::string &new_key)
Method to override initial witness signing keys for debug.
Definition:
genesis_state.cpp:37
graphene::chain::genesis_state_type
Definition:
genesis_state.hpp:40
graphene::chain::genesis_state_type::initial_committee_member_type
Definition:
genesis_state.hpp:93
graphene
Definition:
api.cpp:48
raw.hpp
Generated on Fri Dec 15 2023 06:12:42 for BitShares-Core by
1.8.17