BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
custom_authority.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 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
29 
30 namespace graphene { namespace protocol {
31 
37  struct fee_params_t {
40  };
41 
45  account_id_type account;
47  bool enabled;
57  vector<restriction> restrictions;
58 
60 
61  account_id_type fee_payer()const { return account; }
62  void validate()const;
63  share_type calculate_fee(const fee_params_t& k)const;
64  };
65 
71  struct fee_params_t {
74  };
75 
79  account_id_type account;
81  custom_authority_id_type authority_to_update;
91  flat_set<uint16_t> restrictions_to_remove;
93  vector<restriction> restrictions_to_add;
94 
96 
97  account_id_type fee_payer()const { return account; }
98  void validate()const;
99  share_type calculate_fee(const fee_params_t& k)const;
100  };
101 
102 
109 
113  account_id_type account;
115  custom_authority_id_type authority_to_delete;
116 
118 
119  account_id_type fee_payer()const { return account; }
120  void validate()const;
121  share_type calculate_fee(const fee_params_t& k)const { return k.fee; }
122  };
123 
124 } } // graphene::protocol
125 
129 
131  (fee)(account)(enabled)(valid_from)(valid_to)(operation_type)(auth)(restrictions)(extensions))
132 
134  (fee)(account)(authority_to_update)(new_enabled)(new_valid_from)
135  (new_valid_to)(new_auth)(restrictions_to_remove)(restrictions_to_add)(extensions))
136 FC_REFLECT(graphene::protocol::custom_authority_delete_operation, (fee)(account)(authority_to_delete)(extensions))
graphene::protocol::custom_authority_update_operation::fee_payer
account_id_type fee_payer() const
Definition: custom_authority.hpp:97
graphene::protocol::custom_authority_create_operation::valid_to
time_point_sec valid_to
Expiration date for custom authority.
Definition: custom_authority.hpp:51
graphene::protocol::custom_authority_create_operation::fee_params_t::price_per_byte
uint32_t price_per_byte
Definition: custom_authority.hpp:39
graphene::protocol::custom_authority_create_operation::account
account_id_type account
Account which is setting the custom authority; also pays the fee.
Definition: custom_authority.hpp:45
graphene::protocol::custom_authority_delete_operation::fee_payer
account_id_type fee_payer() const
Definition: custom_authority.hpp:119
graphene::protocol::custom_authority_delete_operation::fee_params_t::fee
uint64_t fee
Definition: custom_authority.hpp:108
graphene::protocol::custom_authority_create_operation::operation_type
unsigned_int operation_type
Tag of the operation this custom authority can authorize.
Definition: custom_authority.hpp:53
graphene::protocol::custom_authority_create_operation
Create a new custom authority.
Definition: custom_authority.hpp:36
graphene::protocol::custom_authority_update_operation::new_enabled
optional< bool > new_enabled
Change to whether the custom authority is enabled or not.
Definition: custom_authority.hpp:83
graphene::protocol::custom_authority_update_operation::calculate_fee
share_type calculate_fee(const fee_params_t &k) const
Definition: custom_authority.cpp:61
graphene::protocol::custom_authority_update_operation::fee_params_t::basic_fee
uint64_t basic_fee
Definition: custom_authority.hpp:72
graphene::protocol::custom_authority_delete_operation::calculate_fee
share_type calculate_fee(const fee_params_t &k) const
Definition: custom_authority.hpp:121
graphene::protocol::custom_authority_delete_operation::validate
void validate() const
Definition: custom_authority.cpp:90
graphene::protocol::custom_authority_update_operation::new_valid_to
optional< time_point_sec > new_valid_to
Change to the custom authority expiration date.
Definition: custom_authority.hpp:87
graphene::protocol::custom_authority_create_operation::fee_payer
account_id_type fee_payer() const
Definition: custom_authority.hpp:61
graphene::protocol::base_operation
Definition: base.hpp:124
graphene::protocol::custom_authority_update_operation::restrictions_to_remove
flat_set< uint16_t > restrictions_to_remove
Set of IDs of restrictions to remove.
Definition: custom_authority.hpp:91
graphene::protocol::custom_authority_create_operation::fee_params_t
Definition: custom_authority.hpp:37
graphene::protocol::custom_authority_create_operation::auth
authority auth
Authentication requirements for the custom authority.
Definition: custom_authority.hpp:55
graphene::protocol::custom_authority_update_operation::fee_params_t::price_per_byte
uint32_t price_per_byte
Definition: custom_authority.hpp:73
graphene::protocol::custom_authority_create_operation::valid_from
time_point_sec valid_from
Date when custom authority becomes active.
Definition: custom_authority.hpp:49
graphene::protocol::custom_authority_delete_operation
Delete a custom authority.
Definition: custom_authority.hpp:107
graphene::protocol::custom_authority_delete_operation::extensions
extensions_type extensions
Definition: custom_authority.hpp:117
graphene::protocol::custom_authority_update_operation::restrictions_to_add
vector< restriction > restrictions_to_add
Vector of new restrictions.
Definition: custom_authority.hpp:93
GRAPHENE_BLOCKCHAIN_PRECISION
#define GRAPHENE_BLOCKCHAIN_PRECISION
Definition: config.hpp:29
graphene::protocol::custom_authority_update_operation::validate
void validate() const
Definition: custom_authority.cpp:71
fc::unsigned_int
Definition: varint.hpp:6
restriction.hpp
fc::time_point_sec
Definition: time.hpp:74
graphene::protocol::custom_authority_update_operation::new_auth
optional< authority > new_auth
Change to the authentication for the custom authority.
Definition: custom_authority.hpp:89
graphene::protocol::custom_authority_create_operation::restrictions
vector< restriction > restrictions
Restrictions on operations this custom authority can authenticate.
Definition: custom_authority.hpp:57
authority.hpp
graphene::protocol::custom_authority_create_operation::validate
void validate() const
Definition: custom_authority.cpp:40
graphene::protocol::custom_authority_delete_operation::fee
asset fee
Operation fee.
Definition: custom_authority.hpp:111
graphene::protocol::custom_authority_update_operation
Update a custom authority.
Definition: custom_authority.hpp:70
graphene::protocol::custom_authority_create_operation::fee
asset fee
Operation fee.
Definition: custom_authority.hpp:43
base.hpp
graphene::protocol::custom_authority_update_operation::fee
asset fee
Operation fee.
Definition: custom_authority.hpp:77
graphene::protocol::custom_authority_create_operation::calculate_fee
share_type calculate_fee(const fee_params_t &k) const
Definition: custom_authority.cpp:32
graphene::protocol::custom_authority_delete_operation::fee_params_t
Definition: custom_authority.hpp:108
graphene::protocol::custom_authority_create_operation::enabled
bool enabled
Whether the custom authority is enabled or not.
Definition: custom_authority.hpp:47
FC_REFLECT
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:388
graphene::protocol::custom_authority_create_operation::extensions
extensions_type extensions
Definition: custom_authority.hpp:59
graphene::protocol::authority
Identifies a weighted set of keys and accounts that must approve operations.
Definition: authority.hpp:34
fc::optional
provides stack-based nullable value similar to boost::optional
Definition: optional.hpp:20
graphene::protocol::custom_authority_update_operation::account
account_id_type account
Account which owns the custom authority to update; also pays the fee.
Definition: custom_authority.hpp:79
graphene::protocol::custom_authority_update_operation::authority_to_update
custom_authority_id_type authority_to_update
ID of the custom authority to update.
Definition: custom_authority.hpp:81
graphene::protocol::custom_authority_delete_operation::account
account_id_type account
Account which owns the custom authority to update; also pays the fee.
Definition: custom_authority.hpp:113
graphene::protocol::custom_authority_update_operation::new_valid_from
optional< time_point_sec > new_valid_from
Change to the custom authority begin date.
Definition: custom_authority.hpp:85
graphene::protocol::asset
Definition: asset.hpp:31
asset.hpp
graphene::protocol::custom_authority_delete_operation::authority_to_delete
custom_authority_id_type authority_to_delete
ID of the custom authority to delete.
Definition: custom_authority.hpp:115
graphene::protocol::custom_authority_create_operation::fee_params_t::basic_fee
uint64_t basic_fee
Definition: custom_authority.hpp:38
graphene
Definition: api.cpp:48
graphene::protocol::custom_authority_update_operation::fee_params_t
Definition: custom_authority.hpp:71
graphene::protocol::extensions_type
future_extensions::flat_set_type extensions_type
Definition: base.hpp:156
graphene::protocol::custom_authority_update_operation::extensions
extensions_type extensions
Definition: custom_authority.hpp:95
fc::safe
Definition: safe.hpp:26