BitShares-Core  5.0.0
BitShares blockchain implementation and command-line interface software
liquidity_pool_evaluator.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Abit More, 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
26 
28 
29 namespace graphene { namespace chain {
30 
31  class asset_object;
32  class asset_dynamic_data_object;
33  class liquidity_pool_object;
34 
35  class liquidity_pool_create_evaluator : public evaluator<liquidity_pool_create_evaluator>
36  {
37  public:
39 
42 
43  const asset_object* _share_asset = nullptr;
44  };
45 
46  class liquidity_pool_delete_evaluator : public evaluator<liquidity_pool_delete_evaluator>
47  {
48  public:
50 
53 
54  const liquidity_pool_object* _pool = nullptr;
55  const asset_object* _share_asset = nullptr;
56  };
57 
58  class liquidity_pool_deposit_evaluator : public evaluator<liquidity_pool_deposit_evaluator>
59  {
60  public:
62 
65 
66  const liquidity_pool_object* _pool = nullptr;
67  const asset_dynamic_data_object* _share_asset_dyn_data = nullptr;
71  };
72 
73  class liquidity_pool_withdraw_evaluator : public evaluator<liquidity_pool_withdraw_evaluator>
74  {
75  public:
77 
80 
81  const liquidity_pool_object* _pool = nullptr;
82  const asset_dynamic_data_object* _share_asset_dyn_data = nullptr;
85  };
86 
87  class liquidity_pool_exchange_evaluator : public evaluator<liquidity_pool_exchange_evaluator>
88  {
89  public:
91 
94 
95  const liquidity_pool_object* _pool = nullptr;
96  const asset_object* _pool_pays_asset = nullptr;
97  const asset_object* _pool_receives_asset = nullptr;
103  };
104 
105 } } // graphene::chain
Definition: api.cpp:56
void_result do_evaluate(const liquidity_pool_create_operation &op)
tracks the asset information that changes frequentlyBecause the asset_object is very large it doesn&#39;t...
tracks the parameters of an assetAll assets have a globally unique symbol name that controls how they...
generic_operation_result do_apply(const liquidity_pool_create_operation &op)