본문으로 건너뛰기

libraries/eosiolib/contracts/eosio/producer_schedule.hpp

Namespaces

Name
eosio

Classes

Name
structeosio::producer_key
structeosio::producer_schedule
structeosio::key_weight
structeosio::block_signing_authority_v0
weighted threshold multi-sig authority
structeosio::producer_authority
Maps producer with its signing key.

Source code

#pragma once
#include <vector>
#include "../../core/eosio/name.hpp"
#include "../../core/eosio/crypto.hpp"

namespace eosio {

struct producer_key {

name producer_name;

public_key block_signing_key;


friend constexpr bool operator < ( const producer_key& a, const producer_key& b ) {
return a.producer_name < b.producer_name;
}


CDT_REFLECT(producer_name, block_signing_key);
};

struct producer_schedule {
uint32_t version;

std::vector<producer_key> producers;

CDT_REFLECT(version, producers);
};

struct key_weight {
public_key key;

uint16_t weight;

CDT_REFLECT(key, weight);
};

struct block_signing_authority_v0 {
uint32_t threshold;

std::vector<key_weight> keys;

bool is_valid()const;

CDT_REFLECT(threshold, keys);
};

using block_signing_authority = std::variant<block_signing_authority_v0>;

struct producer_authority {

name producer_name;

block_signing_authority authority;

friend constexpr bool operator < ( const producer_authority& a, const producer_authority& b ) {
return a.producer_name < b.producer_name;
}

CDT_REFLECT(producer_name, authority);
};

std::vector<name> get_active_producers();

}

Updated on 2022-12-05 at 15:38:08 +0000