BitShares-Core  6.1.0
BitShares blockchain implementation and command-line interface software
proposal_evaluator.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2018 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  */
27 #include <graphene/chain/hardfork.hpp>
28 
29 namespace graphene { namespace chain {
30 
31 namespace detail {
32  void check_asset_options_hf_1774(const fc::time_point_sec& block_time, const asset_options& options);
33 
34  void check_asset_options_hf_bsip_48_75(const fc::time_point_sec& block_time, const asset_options& options);
35  void check_bitasset_options_hf_bsip_48_75(const fc::time_point_sec& block_time, const bitasset_options& options);
37  const asset_update_operation::ext& extensions );
38 
40  const asset_publish_feed_operation::ext& extensions );
41  void check_bitasset_options_hf_bsip77(const fc::time_point_sec& block_time, const bitasset_options& options);
42 
44  const bitasset_options& options); // HF_REMOVABLE
45 
46  void check_asset_options_hf_bsip81(const fc::time_point_sec& block_time, const asset_options& options);
47 
49  const bitasset_options& options); // HF_REMOVABLE
50 
52  const asset_claim_fees_operation& op); // HF_REMOVABLE
53 
54  void check_asset_options_hf_core2281(const fc::time_point_sec& next_maint_time, const asset_options& options);
55  void check_asset_options_hf_core2467(const fc::time_point_sec& next_maint_time, const asset_options& options);
56  void check_bitasset_opts_hf_core2467(const fc::time_point_sec& next_maint_time, const bitasset_options& options);
57 }
58 
60 {
61  typedef void result_type;
62  const database& db;
65 
67  : db( _db ), block_time(bt), next_maintenance_time( db.get_dynamic_global_properties().next_maintenance_time ) {}
68 
69  template<typename T>
70  void operator()(const T &v) const {}
71 
76  detail::check_asset_options_hf_core2281( next_maintenance_time, v.common_options ); // HF_REMOVABLE
77  detail::check_asset_options_hf_core2467( next_maintenance_time, v.common_options ); // HF_REMOVABLE
78  if( v.bitasset_opts.valid() ) {
80  detail::check_bitasset_options_hf_bsip74( block_time, *v.bitasset_opts ); // HF_REMOVABLE
81  detail::check_bitasset_options_hf_bsip77( block_time, *v.bitasset_opts ); // HF_REMOVABLE
82  detail::check_bitasset_options_hf_bsip87( block_time, *v.bitasset_opts ); // HF_REMOVABLE
83  detail::check_bitasset_opts_hf_core2467( next_maintenance_time, *v.bitasset_opts ); // HF_REMOVABLE
84  }
85 
86  // TODO move as many validations as possible to validate() if not triggered before hardfork
87  if( HARDFORK_CORE_2281_PASSED( next_maintenance_time ) )
88  {
90  }
91  else if( HARDFORK_BSIP_48_75_PASSED( block_time ) )
92  {
93  // do not allow the 'disable_collateral_bidding' bit
94  v.common_options.validate_flags( v.bitasset_opts.valid(), false );
95  }
96  }
97 
102  detail::check_asset_options_hf_core2281( next_maintenance_time, v.new_options ); // HF_REMOVABLE
103  detail::check_asset_options_hf_core2467( next_maintenance_time, v.new_options ); // HF_REMOVABLE
104 
106 
107  // TODO move as many validations as possible to validate() if not triggered before hardfork
108  if( HARDFORK_CORE_2281_PASSED( next_maintenance_time ) )
109  {
110  v.new_options.validate_flags( true );
111  }
112  else if( HARDFORK_BSIP_48_75_PASSED( block_time ) )
113  {
114  // do not allow the 'disable_collateral_bidding' bit
115  v.new_options.validate_flags( true, false );
116  }
117 
118  }
119 
122  detail::check_bitasset_options_hf_bsip74( block_time, v.new_options ); // HF_REMOVABLE
123  detail::check_bitasset_options_hf_bsip77( block_time, v.new_options ); // HF_REMOVABLE
124  detail::check_bitasset_options_hf_bsip87( block_time, v.new_options ); // HF_REMOVABLE
125  detail::check_bitasset_opts_hf_core2467( next_maintenance_time, v.new_options ); // HF_REMOVABLE
126  }
127 
129  detail::check_asset_claim_fees_hardfork_87_74_collatfee(block_time, v); // HF_REMOVABLE
130  }
131 
133 
135 
136  }
137 
139  if (block_time < HARDFORK_CORE_1468_TIME) {
140  FC_ASSERT(!op.new_parameters.extensions.value.updatable_htlc_options.valid(),
141  "Unable to set HTLC options before hardfork 1468");
145  }
146  if (!HARDFORK_BSIP_40_PASSED(block_time)) {
147  FC_ASSERT(!op.new_parameters.extensions.value.custom_authority_options.valid(),
148  "Unable to set Custom Authority Options before hardfork BSIP 40");
150  "Unable to define fees for custom authority operations prior to hardfork BSIP 40");
152  "Unable to define fees for custom authority operations prior to hardfork BSIP 40");
154  "Unable to define fees for custom authority operations prior to hardfork BSIP 40");
155  }
156  if (!HARDFORK_BSIP_85_PASSED(block_time)) {
157  FC_ASSERT(!op.new_parameters.extensions.value.maker_fee_discount_percent.valid(),
158  "Unable to set maker_fee_discount_percent before hardfork BSIP 85");
159  }
160  if (!HARDFORK_BSIP_86_PASSED(block_time)) {
161  FC_ASSERT(!op.new_parameters.extensions.value.market_fee_network_percent.valid(),
162  "Unable to set market_fee_network_percent before hardfork BSIP 86");
163  }
164  if (!HARDFORK_CORE_2103_PASSED(block_time)) {
166  "Unable to define fees for ticket operations prior to hardfork 2103");
168  "Unable to define fees for ticket operations prior to hardfork 2103");
169  }
170  if (!HARDFORK_LIQUIDITY_POOL_PASSED(block_time)) {
172  "Unable to define fees for liquidity pool operations prior to the LP hardfork");
174  "Unable to define fees for liquidity pool operations prior to the LP hardfork");
176  "Unable to define fees for liquidity pool operations prior to the LP hardfork");
178  "Unable to define fees for liquidity pool operations prior to the LP hardfork");
180  "Unable to define fees for liquidity pool operations prior to the LP hardfork");
181  }
182  if (!HARDFORK_CORE_2351_PASSED(block_time)) {
184  "Unable to define fees for samet fund operations prior to the core-2351 hardfork");
186  "Unable to define fees for samet fund operations prior to the core-2351 hardfork");
188  "Unable to define fees for samet fund operations prior to the core-2351 hardfork");
190  "Unable to define fees for samet fund operations prior to the core-2351 hardfork");
192  "Unable to define fees for samet fund operations prior to the core-2351 hardfork");
193  }
194  if (!HARDFORK_CORE_2362_PASSED(block_time)) {
196  "Unable to define fees for credit offer operations prior to the core-2362 hardfork");
198  "Unable to define fees for credit offer operations prior to the core-2362 hardfork");
200  "Unable to define fees for credit offer operations prior to the core-2362 hardfork");
202  "Unable to define fees for credit offer operations prior to the core-2362 hardfork");
204  "Unable to define fees for credit offer operations prior to the core-2362 hardfork");
206  "Unable to define fees for credit offer operations prior to the core-2362 hardfork");
207  }
208  }
210  FC_ASSERT( block_time >= HARDFORK_CORE_1468_TIME, "Not allowed until hardfork 1468" );
211  if (block_time < HARDFORK_CORE_BSIP64_TIME)
212  {
213  // memo field added at harfork BSIP64
214  // NOTE: both of these checks can be removed after hardfork time
215  FC_ASSERT( !op.extensions.value.memo.valid(),
216  "Memo unavailable until after HARDFORK BSIP64");
217  // HASH160 added at hardfork BSIP64
219  "HASH160 unavailable until after HARDFORK BSIP64" );
220  }
221  }
223  FC_ASSERT( block_time >= HARDFORK_CORE_1468_TIME, "Not allowed until hardfork 1468" );
224  }
226  FC_ASSERT( block_time >= HARDFORK_CORE_1468_TIME, "Not allowed until hardfork 1468" );
227  }
229  FC_ASSERT( HARDFORK_BSIP_40_PASSED(block_time), "Not allowed until hardfork BSIP 40" );
230  }
232  FC_ASSERT( HARDFORK_BSIP_40_PASSED(block_time), "Not allowed until hardfork BSIP 40" );
233  }
235  FC_ASSERT( HARDFORK_BSIP_40_PASSED(block_time), "Not allowed until hardfork BSIP 40" );
236  }
238  FC_ASSERT( HARDFORK_CORE_2103_PASSED(block_time), "Not allowed until hardfork 2103" );
239  }
241  FC_ASSERT( HARDFORK_CORE_2103_PASSED(block_time), "Not allowed until hardfork 2103" );
242  }
244  FC_ASSERT( HARDFORK_LIQUIDITY_POOL_PASSED(block_time), "Not allowed until the LP hardfork" );
245  }
247  FC_ASSERT( HARDFORK_LIQUIDITY_POOL_PASSED(block_time), "Not allowed until the LP hardfork" );
248  }
250  FC_ASSERT( HARDFORK_LIQUIDITY_POOL_PASSED(block_time), "Not allowed until the LP hardfork" );
251  }
253  FC_ASSERT( HARDFORK_LIQUIDITY_POOL_PASSED(block_time), "Not allowed until the LP hardfork" );
254  }
256  FC_ASSERT( HARDFORK_LIQUIDITY_POOL_PASSED(block_time), "Not allowed until the LP hardfork" );
257  }
259  FC_ASSERT( HARDFORK_CORE_2351_PASSED(block_time), "Not allowed until the core-2351 hardfork" );
260  }
262  FC_ASSERT( HARDFORK_CORE_2351_PASSED(block_time), "Not allowed until the core-2351 hardfork" );
263  }
265  FC_ASSERT( HARDFORK_CORE_2351_PASSED(block_time), "Not allowed until the core-2351 hardfork" );
266  }
268  FC_ASSERT( HARDFORK_CORE_2351_PASSED(block_time), "Not allowed until the core-2351 hardfork" );
269  }
271  FC_ASSERT( HARDFORK_CORE_2351_PASSED(block_time), "Not allowed until the core-2351 hardfork" );
272  }
274  FC_ASSERT( HARDFORK_CORE_2362_PASSED(block_time), "Not allowed until the core-2362 hardfork" );
275  }
277  FC_ASSERT( HARDFORK_CORE_2362_PASSED(block_time), "Not allowed until the core-2362 hardfork" );
278  }
280  FC_ASSERT( HARDFORK_CORE_2362_PASSED(block_time), "Not allowed until the core-2362 hardfork" );
281  }
283  FC_ASSERT( HARDFORK_CORE_2362_PASSED(block_time), "Not allowed until the core-2362 hardfork" );
284  }
286  FC_ASSERT( HARDFORK_CORE_2362_PASSED(block_time), "Not allowed until the core-2362 hardfork" );
287  }
288  // Note: credit_deal_expired_operation is a virtual operation thus no need to add code here
289 
290  // loop and self visit in proposals
292  bool already_contains_proposal_update = false;
293 
294  for (const op_wrapper &op : v.proposed_ops)
295  {
296  op.op.visit(*this);
297  // Do not allow more than 1 proposal_update in a proposal
299  {
300  FC_ASSERT( !already_contains_proposal_update,
301  "At most one proposal update can be nested in a proposal!" );
302  already_contains_proposal_update = true;
303  }
304  }
305  }
306 };
307 
308 struct hardfork_visitor_214 // non-recursive proposal visitor
309 {
310  typedef void result_type;
311 
312  template<typename T>
313  void operator()(const T &v) const {}
314 
315  void operator()(const proposal_update_operation &v) const {
316  FC_ASSERT(false, "Not allowed until hardfork 214");
317  }
318 };
319 
321 {
322  if( nested_update_count == 0 || v.proposal.instance.value > max_update_instance )
323  max_update_instance = v.proposal.instance.value;
324  nested_update_count++;
325 }
326 
328 {
329  if( nested_update_count == 0 || v.proposal.instance.value > max_update_instance )
330  max_update_instance = v.proposal.instance.value;
331  nested_update_count++;
332 }
333 
334 // loop and self visit in proposals
336 {
337  for (const op_wrapper &op : v.proposed_ops)
338  op.op.visit(*this);
339 }
340 
342 { try {
343  const database& d = db();
344 
345  // Calling the proposal hardfork visitor
346  const fc::time_point_sec block_time = d.head_block_time();
347  proposal_operation_hardfork_visitor vtor( d, block_time );
348  vtor( o );
349  if( block_time < HARDFORK_CORE_214_TIME )
350  {
351  // cannot be removed after hf, unfortunately
352  hardfork_visitor_214 hf214;
353  for( const op_wrapper &op : o.proposed_ops )
354  op.op.visit( hf214 );
355  }
356  vtor_1479( o );
357 
358  const auto& global_parameters = d.get_global_properties().parameters;
359 
360  FC_ASSERT( o.expiration_time > block_time, "Proposal has already expired on creation." );
361  FC_ASSERT( o.expiration_time <= block_time + global_parameters.maximum_proposal_lifetime,
362  "Proposal expiration time is too far in the future." );
364  fc::seconds( *o.review_period_seconds ) < ( o.expiration_time - block_time ),
365  "Proposal review period must be less than its overall lifetime." );
366 
367  // Find all authorities required by the proposed operations
368  flat_set<account_id_type> tmp_required_active_auths;
369  vector<authority> other;
370  for( auto& op : o.proposed_ops )
371  {
372  operation_get_required_authorities( op.op, tmp_required_active_auths, _required_owner_auths, other,
373  MUST_IGNORE_CUSTOM_OP_REQD_AUTHS( block_time ) );
374  }
375  // All accounts which must provide both owner and active authority should be omitted from the
376  // active authority set; owner authority approval implies active authority approval.
377  std::set_difference( tmp_required_active_auths.begin(), tmp_required_active_auths.end(),
378  _required_owner_auths.begin(), _required_owner_auths.end(),
379  std::inserter( _required_active_auths, _required_active_auths.begin() ) );
380 
381  // TODO: what about other???
382  FC_ASSERT ( other.empty(),
383  "Proposals containing operations requiring non-account authorities are not yet implemented." );
384 
385  // If we're dealing with the committee authority, make sure this transaction has a sufficient review period.
386  if( _required_active_auths.count( GRAPHENE_COMMITTEE_ACCOUNT ) > 0 ||
387  _required_owner_auths.count( GRAPHENE_COMMITTEE_ACCOUNT ) > 0 )
388  {
390  proposal_create_review_period_required,
391  "Review period not given, but at least ${min} required",
392  ("min", global_parameters.committee_proposal_review_period) );
393  GRAPHENE_ASSERT( *o.review_period_seconds >= global_parameters.committee_proposal_review_period,
394  proposal_create_review_period_insufficient,
395  "Review period of ${t} specified, but at least ${min} required",
396  ("t", *o.review_period_seconds)
397  ("min", global_parameters.committee_proposal_review_period) );
398  }
399 
400  for( const op_wrapper& op : o.proposed_ops )
401  _proposed_trx.operations.push_back( op.op );
402 
403  _proposed_trx.validate();
404 
405  return void_result();
406 } FC_CAPTURE_AND_RETHROW( (o) ) }
407 
409 { try {
410  database& d = db();
411  auto chain_time = d.head_block_time();
412 
413  const proposal_object& proposal = d.create<proposal_object>( [&o, this, chain_time](proposal_object& proposal) {
414  _proposed_trx.expiration = o.expiration_time;
415  proposal.proposed_transaction = _proposed_trx;
416  proposal.expiration_time = o.expiration_time;
417  proposal.proposer = o.fee_paying_account;
418  if( o.review_period_seconds )
419  proposal.review_period_time = o.expiration_time - *o.review_period_seconds;
420 
421  //Populate the required approval sets
422  proposal.required_owner_approvals.insert( _required_owner_auths.begin(), _required_owner_auths.end() );
423  proposal.required_active_approvals.insert( _required_active_auths.begin(), _required_active_auths.end() );
424 
425  if( chain_time > HARDFORK_CORE_1479_TIME )
426  FC_ASSERT( vtor_1479.nested_update_count == 0 || proposal.id.instance() > vtor_1479.max_update_instance,
427  "Cannot update/delete a proposal with a future id!" );
428  else if( vtor_1479.nested_update_count > 0 && proposal.id.instance() <= vtor_1479.max_update_instance )
429  {
430  // Note: This happened on mainnet, proposal 1.10.17503
431  // prevent approval
432  transfer_operation top;
436  proposal.proposed_transaction.operations.emplace_back( top );
437  }
438  });
439 
440  return proposal.id;
441 } FC_CAPTURE_AND_RETHROW( (o) ) }
442 
444 { try {
445  database& d = db();
446 
447  _proposal = &o.proposal(d);
448 
449  if( _proposal->review_period_time && d.head_block_time() >= *_proposal->review_period_time )
451  "This proposal is in its review period. No new approvals may be added." );
452 
453  for( account_id_type id : o.active_approvals_to_remove )
454  {
455  FC_ASSERT( _proposal->available_active_approvals.find(id) != _proposal->available_active_approvals.end(),
456  "", ("id", id)("available", _proposal->available_active_approvals) );
457  }
458  for( account_id_type id : o.owner_approvals_to_remove )
459  {
460  FC_ASSERT( _proposal->available_owner_approvals.find(id) != _proposal->available_owner_approvals.end(),
461  "", ("id", id)("available", _proposal->available_owner_approvals) );
462  }
463 
464  return void_result();
465 } FC_CAPTURE_AND_RETHROW( (o) ) }
466 
468 { try {
469  database& d = db();
470 
471  // Potential optimization: if _executed_proposal is true, we can skip the modify step and make push_proposal
472  // skip signature checks. This isn't done now because I just wrote all the proposals code, and I'm not yet
473  // 100% sure the required approvals are sufficient to authorize the transaction.
474  d.modify(*_proposal, [&o](proposal_object& p) {
477  for( account_id_type id : o.active_approvals_to_remove )
478  p.available_active_approvals.erase(id);
479  for( account_id_type id : o.owner_approvals_to_remove )
480  p.available_owner_approvals.erase(id);
481  for( const auto& id : o.key_approvals_to_add )
482  p.available_key_approvals.insert(id);
483  for( const auto& id : o.key_approvals_to_remove )
484  p.available_key_approvals.erase(id);
485  });
486 
487  // If the proposal has a review period, don't bother attempting to authorize/execute it.
488  // Proposals with a review period may never be executed except at their expiration.
489  if( _proposal->review_period_time )
490  return void_result();
491 
492  if( _proposal->is_authorized_to_execute(d) )
493  {
494  // All required approvals are satisfied. Execute!
495  _executed_proposal = true;
496  try {
497  _processed_transaction = d.push_proposal(*_proposal);
498  } catch(fc::exception& e) {
499  d.modify(*_proposal, [&e](proposal_object& p) {
501  });
502  wlog("Proposed transaction ${id} failed to apply once approved with exception:\n----\n${reason}\n----\nWill try again when it expires.",
503  ("id", o.proposal)("reason", e.to_detail_string()));
504  _proposal_failed = true;
505  }
506  }
507 
508  return void_result();
509 } FC_CAPTURE_AND_RETHROW( (o) ) }
510 
512 { try {
513  database& d = db();
514 
515  _proposal = &o.proposal(d);
516 
517  auto required_approvals = o.using_owner_authority? &_proposal->required_owner_approvals
518  : &_proposal->required_active_approvals;
519  FC_ASSERT( required_approvals->find(o.fee_paying_account) != required_approvals->end(),
520  "Provided authority is not authoritative for this proposal.",
521  ("provided", o.fee_paying_account)("required", *required_approvals));
522 
523  return void_result();
524 } FC_CAPTURE_AND_RETHROW( (o) ) }
525 
527 { try {
528  db().remove(*_proposal);
529 
530  return void_result();
531 } FC_CAPTURE_AND_RETHROW( (o) ) }
532 
533 
534 } } // graphene::chain
void operator()(const graphene::chain::htlc_redeem_operation &) const
void modify(const T &obj, const Lambda &m)
void operator()(const graphene::chain::proposal_create_operation &v) const
void operator()(const graphene::chain::samet_fund_create_operation &) const
proposal_operation_hardfork_visitor(const database &_db, const fc::time_point_sec bt)
void operator()(const graphene::chain::liquidity_pool_deposit_operation &) const
void operator()(const graphene::chain::custom_authority_update_operation &) const
void check_asset_options_hf_bsip81(const fc::time_point_sec &block_time, const asset_options &options)
void check_bitasset_options_hf_bsip74(const fc::time_point_sec &block_time, const bitasset_options &options)
void operator()(const graphene::chain::samet_fund_delete_operation &) const
necessary to support nested operations inside the proposal_create_operation
Definition: operations.hpp:152
void check_bitasset_options_hf_bsip87(const fc::time_point_sec &block_time, const bitasset_options &options)
void check_asset_options_hf_core2467(const fc::time_point_sec &next_maint_time, const asset_options &options)
vector< operation > operations
Definition: transaction.hpp:89
void operator()(const graphene::chain::samet_fund_borrow_operation &) const
time_point_sec head_block_time() const
Definition: db_getter.cpp:67
flat_set< account_id_type > available_active_approvals
tracks the blockchain state in an extensible manner
Definition: database.hpp:70
Definition: api.cpp:48
std::string to_string(log_level ll=log_level::info) const
Definition: exception.cpp:227
void operator()(const graphene::chain::ticket_update_operation &) const
used to transfer accumulated fees back to the issuer&#39;s balance.
Definition: asset_ops.hpp:529
The proposal_delete_operation deletes an existing transaction proposalThis operation allows the early...
Definition: proposal.hpp:156
void_result do_evaluate(const proposal_update_operation &o)
void check_bitasset_options_hf_bsip_48_75(const fc::time_point_sec &block_time, const bitasset_options &options)
void operator()(const graphene::chain::custom_authority_create_operation &) const
void check_bitasset_opts_hf_core2467(const fc::time_point_sec &next_maint_time, const bitasset_options &options)
processed_transaction push_proposal(const proposal_object &proposal)
Definition: db_block.cpp:329
Used to generate a useful error report when an exception is thrown.At each level in the stack where t...
Definition: exception.hpp:56
void operator()(const graphene::chain::ticket_create_operation &) const
void operator()(const graphene::chain::liquidity_pool_delete_operation &) const
flat_set< account_id_type > required_owner_approvals
void check_asset_publish_feed_extensions_hf_bsip77(const fc::time_point_sec &block_time, const asset_publish_feed_operation::ext &extensions)
visitor::result_type visit(visitor &v)
Accept a creadit offer and create a credit deal.
Updates an existing ticket.
Definition: ticket.hpp:66
#define wlog(FORMAT,...)
Definition: logger.hpp:123
void_result do_apply(const proposal_update_operation &o)
Publish price feeds for market-issued assetsPrice feed providers use this operation to publish their ...
Definition: asset_ops.hpp:462
Create a new SameT Fund objectA SameT Fund is a fund which can be used by a borrower and have to be r...
Definition: samet_fund.hpp:36
flat_set< account_id_type > available_owner_approvals
uint64_t instance() const
Definition: object_id.hpp:49
The proposal_create_operation creates a transaction proposal, for use in multi-sig scenariosCreates a...
Definition: proposal.hpp:70
extension< additional_options_type > extensions
Definition: htlc.hpp:72
void operator()(const proposal_update_operation &v) const
void operator()(const graphene::chain::samet_fund_repay_operation &) const
void operator()(const graphene::chain::asset_update_operation &v) const
void validate_flags(bool is_market_issued, bool allow_disable_collateral_bid=true) const
Definition: asset_ops.cpp:312
void operator()(const graphene::chain::asset_publish_feed_operation &v) const
flat_set< public_key_type > key_approvals_to_remove
Definition: proposal.hpp:134
void operator()(const graphene::chain::htlc_create_operation &op) const
Transfers an amount of one asset from one account to another.
Definition: transfer.hpp:45
object_id_type id
Definition: object.hpp:69
flat_set< account_id_type > active_approvals_to_remove
Definition: proposal.hpp:130
microseconds seconds(int64_t s)
Definition: time.hpp:34
flat_set< account_id_type > owner_approvals_to_remove
Definition: proposal.hpp:132
void operator()(const graphene::chain::asset_update_bitasset_operation &v) const
bool valid() const
Definition: optional.hpp:186
#define GRAPHENE_COMMITTEE_ACCOUNT
Definition: config.hpp:140
void operator()(const graphene::chain::liquidity_pool_exchange_operation &) const
std::shared_ptr< const fee_schedule > current_fees
current schedule of fees
#define FC_CAPTURE_AND_RETHROW(...)
Definition: exception.hpp:479
Update options specific to BitAssetsBitAssets have some options which are not relevant to other asset...
Definition: asset_ops.hpp:398
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
Definition: exception.hpp:345
void operator()(const graphene::chain::credit_deal_repay_operation &) const
void_result do_evaluate(const proposal_create_operation &o)
object_id_type do_apply(const proposal_create_operation &o)
A credit deal expired without being fully repaid.
#define GRAPHENE_NULL_ACCOUNT
Represents the canonical account with NO authority (nobody can access funds in null account) ...
Definition: config.hpp:146
Update options common to all assetsThere are a number of options which all assets in the network use...
Definition: asset_ops.hpp:351
optional< time_point_sec > review_period_time
void operator()(const graphene::chain::asset_claim_fees_operation &v) const
void operator()(const graphene::chain::credit_offer_delete_operation &) const
void operator()(const graphene::chain::credit_offer_create_operation &) const
void operator()(const graphene::chain::liquidity_pool_create_operation &) const
void_result do_apply(const proposal_delete_operation &)
flat_set< account_id_type > required_active_approvals
#define GRAPHENE_RELAXED_COMMITTEE_ACCOUNT
Represents the current committee members.
Definition: config.hpp:144
flat_set< public_key_type > key_approvals_to_add
Definition: proposal.hpp:133
std::string to_detail_string(log_level ll=log_level::all) const
Definition: exception.cpp:183
void check_asset_update_extensions_hf_bsip_48_75(const fc::time_point_sec &block_time, const asset_update_operation::ext &extensions)
void check_asset_claim_fees_hardfork_87_74_collatfee(const fc::time_point_sec &block_time, const asset_claim_fees_operation &op)
void operator()(const graphene::chain::htlc_extend_operation &) const
void check_bitasset_options_hf_bsip77(const fc::time_point_sec &block_time, const bitasset_options &options)
asset amount
The amount of asset to transfer from from to to.
Definition: transfer.hpp:58
void check_asset_options_hf_bsip_48_75(const fc::time_point_sec &block_time, const asset_options &options)
void operator()(const graphene::chain::committee_member_update_global_parameters_operation &op) const
The proposal_update_operation updates an existing transaction proposalThis operation allows accounts ...
Definition: proposal.hpp:119
optional< bitasset_options > bitasset_opts
Options only available for BitAssets. MUST be non-null if and only if the asset is market-issued...
Definition: asset_ops.hpp:217
account_id_type from
Account to transfer asset from.
Definition: transfer.hpp:54
void operator()(const graphene::chain::samet_fund_update_operation &) const
constexpr int64_t GRAPHENE_MAX_SHARE_SUPPLY(1000000000000000LL)
#define GRAPHENE_ASSERT(expr, exc_type, FORMAT,...)
Definition: exceptions.hpp:28
void check_asset_options_hf_core2281(const fc::time_point_sec &next_maint_time, const asset_options &options)
Used by committee_members to update the global parameters of the blockchain.This operation allows the...
void operator()(const graphene::chain::asset_create_operation &v) const
flat_set< account_id_type > owner_approvals_to_add
Definition: proposal.hpp:131
void operator()(const graphene::chain::credit_offer_update_operation &) const
flat_set< public_key_type > available_key_approvals
void check_asset_options_hf_1774(const fc::time_point_sec &block_time, const asset_options &options)
void operator()(const graphene::chain::credit_offer_accept_operation &) const
void operator()(const graphene::chain::custom_authority_delete_operation &) const
void operation_get_required_authorities(const operation &op, flat_set< account_id_type > &active, flat_set< account_id_type > &owner, vector< authority > &other, bool ignore_custom_operation_required_auths)
Definition: operations.cpp:103
flat_set< account_id_type > active_approvals_to_add
Definition: proposal.hpp:129
account_id_type to
Account to transfer asset to.
Definition: transfer.hpp:56
void_result do_evaluate(const proposal_delete_operation &o)
void operator()(const graphene::chain::liquidity_pool_withdraw_operation &) const
const T & create(F &&constructor)
Create a new credit offerA credit offer is a fund that can be used by other accounts who provide cert...
const global_property_object & get_global_properties() const
Definition: db_getter.cpp:47
tracks the approval of a partially approved transaction