BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface 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 
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;
64  };
65 
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;
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_parameters_type& k)const { return k.fee; }
122  };
123 
124 } } // graphene::protocol
125 
129 
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))
account_id_type account
Account which owns the custom authority to update; also pays the fee.
custom_authority_id_type authority_to_update
ID of the custom authority to update.
future_extensions::flat_set_type extensions_type
Definition: base.hpp:128
vector< restriction > restrictions
Restrictions on operations this custom authority can authenticate.
Identifies a weighted set of keys and accounts that must approve operations.
Definition: authority.hpp:34
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:386
optional< time_point_sec > new_valid_to
Change to the custom authority expiration date.
Definition: api.cpp:56
account_id_type account
Account which owns the custom authority to update; also pays the fee.
optional< bool > new_enabled
Change to whether the custom authority is enabled or not.
bool enabled
Whether the custom authority is enabled or not.
custom_authority_id_type authority_to_delete
ID of the custom authority to delete.
provides stack-based nullable value similar to boost::optional
Definition: optional.hpp:20
share_type calculate_fee(const fee_parameters_type &k) const
time_point_sec valid_to
Expiration date for custom authority.
time_point_sec valid_from
Date when custom authority becomes active.
vector< restriction > restrictions_to_add
Vector of new restrictions.
#define GRAPHENE_BLOCKCHAIN_PRECISION
Definition: config.hpp:29
optional< authority > new_auth
Change to the authentication for the custom authority.
optional< time_point_sec > new_valid_from
Change to the custom authority begin date.
account_id_type account
Account which is setting the custom authority; also pays the fee.
unsigned_int operation_type
Tag of the operation this custom authority can authorize.
authority auth
Authentication requirements for the custom authority.
share_type calculate_fee(const fee_parameters_type &k) const
flat_set< uint16_t > restrictions_to_remove
Set of IDs of restrictions to remove.