This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 291
/
producer_schedule.hpp
78 lines (64 loc) · 1.79 KB
/
producer_schedule.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#pragma once
#include <vector>
#include "../../core/eosio/name.hpp"
#include "../../core/eosio/crypto.hpp"
namespace eosio {
/**
* @defgroup producer_key Producer Key
* @ingroup contracts
* @ingroup types
* @brief Maps producer with its signing key, used for producer schedule
*/
/**
* Maps producer with its signing key, used for producer schedule
*
* @ingroup producer_key
*/
struct producer_key {
/**
* Name of the producer
*
* @ingroup producer_key
*/
name producer_name;
/**
* Block signing key used by this producer
*
* @ingroup producer_key
*/
public_key block_signing_key;
/// @cond OPERATORS
friend constexpr bool operator < ( const producer_key& a, const producer_key& b ) {
return a.producer_name < b.producer_name;
}
/// @endcond
EOSLIB_SERIALIZE( producer_key, (producer_name)(block_signing_key) )
};
/**
* @defgroup producer_schedule Producer Schedule
* @ingroup contracts
* @ingroup types
* @brief Defines both the order, account name, and signing keys of the active set of producers.
*/
/**
* Defines both the order, account name, and signing keys of the active set of producers.
*
* @ingroup producer_schedule
*/
struct producer_schedule {
/**
* Version number of the schedule. It is sequentially incrementing version number
*/
uint32_t version;
/**
* List of producers for this schedule, including its signing key
*/
std::vector<producer_key> producers;
};
/**
* Returns back the list of active producer names.
*
* @ingroup producer_schedule
*/
std::vector<name> get_active_producers();
} /// namespace eosio