BitShares-Core  5.0.0
BitShares blockchain implementation and command-line interface software
proposal_evaluator.hpp
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  */
24 #pragma once
25 
28 
29 namespace graphene { namespace chain {
30 
32  {
33  public:
34  typedef void result_type;
35 
36  uint64_t max_update_instance = 0;
37  uint64_t nested_update_count = 0;
38 
39  template<typename T>
40  void operator()(const T &v) const {}
41 
43 
45 
46  // loop and self visit in proposals
48  };
49 
50  class proposal_create_evaluator : public evaluator<proposal_create_evaluator>
51  {
52  public:
54 
55  void_result do_evaluate( const proposal_create_operation& o );
56  object_id_type do_apply( const proposal_create_operation& o );
57 
59  flat_set<account_id_type> _required_active_auths;
60  flat_set<account_id_type> _required_owner_auths;
61 
63  };
64 
65  class proposal_update_evaluator : public evaluator<proposal_update_evaluator>
66  {
67  public:
69 
70  void_result do_evaluate( const proposal_update_operation& o );
71  void_result do_apply( const proposal_update_operation& o );
72 
73  const proposal_object* _proposal = nullptr;
75  bool _executed_proposal = false;
76  bool _proposal_failed = false;
77  };
78 
79  class proposal_delete_evaluator : public evaluator<proposal_delete_evaluator>
80  {
81  public:
83 
84  void_result do_evaluate( const proposal_delete_operation& o );
85  void_result do_apply(const proposal_delete_operation&);
86 
87  const proposal_object* _proposal = nullptr;
88  };
89 
90 } } // graphene::chain
Definition: api.cpp:56
The proposal_delete_operation deletes an existing transaction proposalThis operation allows the early...
Definition: proposal.hpp:156
groups operations that should be applied atomically
Definition: transaction.hpp:68
The proposal_create_operation creates a transaction proposal, for use in multi-sig scenariosCreates a...
Definition: proposal.hpp:70
flat_set< account_id_type > _required_active_auths
The proposal_update_operation updates an existing transaction proposalThis operation allows accounts ...
Definition: proposal.hpp:119
flat_set< account_id_type > _required_owner_auths
captures the result of evaluating the operations contained in the transaction
tracks the approval of a partially approved transaction