BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
proposal.hpp
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 #pragma once
27 
28 namespace graphene { namespace protocol {
60  struct op_wrapper;
71  {
72  struct fee_params_t {
74  uint32_t price_per_kbyte = 10;
75  };
76 
78  account_id_type fee_paying_account;
79  vector<op_wrapper> proposed_ops;
83 
95 
96  account_id_type fee_payer()const { return fee_paying_account; }
97  void validate()const;
98  share_type calculate_fee(const fee_params_t& k)const;
99  };
100 
120  {
121  struct fee_params_t {
123  uint32_t price_per_kbyte = 10;
124  };
125 
126  account_id_type fee_paying_account;
128  proposal_id_type proposal;
129  flat_set<account_id_type> active_approvals_to_add;
130  flat_set<account_id_type> active_approvals_to_remove;
131  flat_set<account_id_type> owner_approvals_to_add;
132  flat_set<account_id_type> owner_approvals_to_remove;
133  flat_set<public_key_type> key_approvals_to_add;
134  flat_set<public_key_type> key_approvals_to_remove;
136 
137  account_id_type fee_payer()const { return fee_paying_account; }
138  void validate()const;
139  share_type calculate_fee(const fee_params_t& k)const;
140  void get_required_authorities( vector<authority>& )const;
141  void get_required_active_authorities( flat_set<account_id_type>& )const;
142  void get_required_owner_authorities( flat_set<account_id_type>& )const;
143  };
144 
157  {
159 
160  account_id_type fee_paying_account;
161  bool using_owner_authority = false;
163  proposal_id_type proposal;
165 
166  account_id_type fee_payer()const { return fee_paying_account; }
167  void validate()const;
168  };
170 
171 }} // graphene::protocol
172 
176 
177 FC_REFLECT( graphene::protocol::proposal_create_operation, (fee)(fee_paying_account)(expiration_time)
178  (proposed_ops)(review_period_seconds)(extensions) )
179 FC_REFLECT( graphene::protocol::proposal_update_operation, (fee)(fee_paying_account)(proposal)
180  (active_approvals_to_add)(active_approvals_to_remove)(owner_approvals_to_add)(owner_approvals_to_remove)
181  (key_approvals_to_add)(key_approvals_to_remove)(extensions) )
182 FC_REFLECT( graphene::protocol::proposal_delete_operation, (fee)(fee_paying_account)(using_owner_authority)(proposal)(extensions) )
183 
graphene::protocol::proposal_update_operation
The proposal_update_operation updates an existing transaction proposal.
Definition: proposal.hpp:119
graphene::protocol::proposal_update_operation::key_approvals_to_remove
flat_set< public_key_type > key_approvals_to_remove
Definition: proposal.hpp:134
graphene::protocol::proposal_delete_operation::extensions
extensions_type extensions
Definition: proposal.hpp:164
graphene::protocol::proposal_update_operation::fee_params_t
Definition: proposal.hpp:121
graphene::protocol::proposal_delete_operation::proposal
proposal_id_type proposal
Definition: proposal.hpp:163
graphene::protocol::proposal_update_operation::fee_paying_account
account_id_type fee_paying_account
Definition: proposal.hpp:126
graphene::protocol::proposal_create_operation::extensions
extensions_type extensions
Definition: proposal.hpp:82
graphene::protocol::proposal_create_operation::fee_params_t::price_per_kbyte
uint32_t price_per_kbyte
Definition: proposal.hpp:74
graphene::protocol::proposal_update_operation::extensions
extensions_type extensions
Definition: proposal.hpp:135
graphene::protocol::proposal_update_operation::owner_approvals_to_add
flat_set< account_id_type > owner_approvals_to_add
Definition: proposal.hpp:131
graphene::protocol::proposal_update_operation::fee_payer
account_id_type fee_payer() const
Definition: proposal.hpp:137
graphene::protocol::base_operation
Definition: base.hpp:124
graphene::protocol::proposal_update_operation::fee_params_t::fee
uint64_t fee
Definition: proposal.hpp:122
graphene::protocol::proposal_update_operation::key_approvals_to_add
flat_set< public_key_type > key_approvals_to_add
Definition: proposal.hpp:133
graphene::protocol::proposal_create_operation::calculate_fee
share_type calculate_fee(const fee_params_t &k) const
Definition: proposal.cpp:46
graphene::protocol::proposal_create_operation::fee
asset fee
Definition: proposal.hpp:77
GRAPHENE_BLOCKCHAIN_PRECISION
#define GRAPHENE_BLOCKCHAIN_PRECISION
Definition: config.hpp:29
graphene::protocol::proposal_delete_operation::fee_payer
account_id_type fee_payer() const
Definition: proposal.hpp:166
graphene::protocol::proposal_create_operation::fee_payer
account_id_type fee_payer() const
Definition: proposal.hpp:96
graphene::protocol::proposal_update_operation::calculate_fee
share_type calculate_fee(const fee_params_t &k) const
Definition: proposal.cpp:79
fc::time_point_sec
Definition: time.hpp:74
graphene::protocol::proposal_update_operation::get_required_authorities
void get_required_authorities(vector< authority > &) const
Definition: proposal.cpp:84
graphene::protocol::proposal_update_operation::fee
asset fee
Definition: proposal.hpp:127
GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
Definition: types.hpp:85
graphene::protocol::proposal_create_operation::fee_params_t
Definition: proposal.hpp:72
graphene::protocol::proposal_create_operation::fee_params_t::fee
uint64_t fee
Definition: proposal.hpp:73
graphene::protocol::proposal_create_operation::validate
void validate() const
Definition: proposal.cpp:40
graphene::protocol::chain_parameters
Definition: chain_parameters.hpp:46
graphene::protocol::proposal_create_operation::fee_paying_account
account_id_type fee_paying_account
Definition: proposal.hpp:78
graphene::protocol::proposal_update_operation::active_approvals_to_add
flat_set< account_id_type > active_approvals_to_add
Definition: proposal.hpp:129
graphene::protocol::proposal_create_operation::expiration_time
time_point_sec expiration_time
Definition: proposal.hpp:80
graphene::protocol::proposal_delete_operation
The proposal_delete_operation deletes an existing transaction proposal.
Definition: proposal.hpp:156
graphene::protocol::proposal_delete_operation::fee_params_t
Definition: proposal.hpp:158
graphene::protocol::proposal_delete_operation::using_owner_authority
bool using_owner_authority
Definition: proposal.hpp:161
base.hpp
graphene::protocol::proposal_update_operation::get_required_active_authorities
void get_required_active_authorities(flat_set< account_id_type > &) const
Definition: proposal.cpp:97
graphene::protocol::proposal_delete_operation::fee_paying_account
account_id_type fee_paying_account
Definition: proposal.hpp:160
graphene::protocol::proposal_update_operation::owner_approvals_to_remove
flat_set< account_id_type > owner_approvals_to_remove
Definition: proposal.hpp:132
graphene::protocol::proposal_update_operation::get_required_owner_authorities
void get_required_owner_authorities(flat_set< account_id_type > &) const
Definition: proposal.cpp:103
graphene::protocol::proposal_update_operation::validate
void validate() const
Definition: proposal.cpp:51
graphene::protocol::proposal_update_operation::active_approvals_to_remove
flat_set< account_id_type > active_approvals_to_remove
Definition: proposal.hpp:130
FC_REFLECT
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:388
graphene::protocol::proposal_create_operation::review_period_seconds
optional< uint32_t > review_period_seconds
Definition: proposal.hpp:81
fc::optional
provides stack-based nullable value similar to boost::optional
Definition: optional.hpp:20
graphene::protocol::proposal_update_operation::proposal
proposal_id_type proposal
Definition: proposal.hpp:128
graphene::protocol::proposal_create_operation::proposed_ops
vector< op_wrapper > proposed_ops
Definition: proposal.hpp:79
graphene::protocol::asset
Definition: asset.hpp:31
graphene::protocol::proposal_create_operation::committee_proposal
static proposal_create_operation committee_proposal(const chain_parameters &param, fc::time_point_sec head_block_time)
Definition: proposal.cpp:31
graphene::protocol::proposal_create_operation
The proposal_create_operation creates a transaction proposal, for use in multi-sig scenarios.
Definition: proposal.hpp:70
asset.hpp
graphene::protocol::proposal_delete_operation::fee_params_t::fee
uint64_t fee
Definition: proposal.hpp:158
graphene::protocol::proposal_delete_operation::validate
void validate() const
Definition: proposal.cpp:74
graphene::protocol::proposal_delete_operation::fee
asset fee
Definition: proposal.hpp:162
graphene::protocol::proposal_update_operation::fee_params_t::price_per_kbyte
uint32_t price_per_kbyte
Definition: proposal.hpp:123
graphene
Definition: api.cpp:48
graphene::protocol::extensions_type
future_extensions::flat_set_type extensions_type
Definition: base.hpp:156
fc::safe
Definition: safe.hpp:26