跳到主要内容

libraries/eosiolib/capi/eosio/privileged.h

Functions

Name
attribute((eosio_wasm_import) )

Attributes

Name
int64_t *ram_bytes
int64_t int64_t *net_weight
int64_t int64_t int64_t *cpu_weight
uint32_tproducer_data_size
char *producer_data
boolis_priv
uint32_tdatalen

Functions Documentation

function attribute

__attribute__(
(eosio_wasm_import)
)

Parameters:

  • account - name of the account whose resource limit to get
  • ram_bytes - pointer to int64_t to hold retrieved ram limit in absolute bytes
  • net_weight - pointer to int64_t to hold net limit
  • cpu_weight - pointer to int64_t to hold cpu limit
  • account - name of the account whose resource limit to be set
  • ram_bytes - ram limit in absolute bytes
  • net_weight - fractionally proportionate net limit of available resources based on (weight / total_weight_of_all_accounts)
  • cpu_weight - fractionally proportionate cpu limit of available resources based on (weight / total_weight_of_all_accounts)
  • producer_data - packed data of produce_keys in the appropriate producer schedule order
  • producer_data_size - size of the data buffer
  • producer_data_format - format of the producer data blob
  • producer_data - packed data of representing the producer schedule in the format indicated.
  • producer_data_size - size of the data buffer
  • account - name of the account to be checked
  • account - name of the account whose privileged account to be set
  • is_priv - privileged status
  • data - pointer to blockchain parameters packed as bytes
  • datalen - size of the packed blockchain parameters
  • data - output buffer of the blockchain parameters, only retrieved if sufficent size to hold packed data.
  • datalen - size of the data buffer, 0 to report required size.
  • data - pointer to KV parameters packed as bytes
  • datalen - size of the packed KV parameters
  • feature_digest - digest of the protocol feature to pre-activate

Return:

  • -1 if proposing a new producer schedule was unsuccessful, otherwise returns the version of the new proposed schedule
  • -1 if proposing a new producer schedule was unsuccessful, otherwise returns the version of the new proposed schedule
  • true if the account is privileged
  • false if the account is not privileged
  • size of the blockchain parameters

Note:

  • Once the block that contains the proposal becomes irreversible, the schedule is promoted to "pending" automatically. Once the block that promotes the schedule is irreversible, the schedule will become "active"
  • Once the block that contains the proposal becomes irreversible, the schedule is promoted to "pending" automatically. Once the block that promotes the schedule is irreversible, the schedule will become "active"

Precondition:

  • data is a valid pointer to a range of memory at least datalen bytes long that contains packed blockchain params data
  • data is a valid pointer to a range of memory at least datalen bytes long
  • data is a valid pointer to a range of memory at least datalen bytes long that contains packed KV params data

Postcondition: data is filled with packed blockchain parameters

Get the resource limits of an account

Set the resource limits of an account

Proposes a schedule change

This is exactly equivalent to calling set_proposed_producers_ex(0, producer_data, producer_data_size)

Proposes a schedule change with extended features

Valid formats: 0 : serialized array of producer_key's. using this format is exactly equivalent to set_proposed_producers(producer_data, producer_data_size) 1 : serialized array of producer_authority's

Check if an account is privileged

Set the privileged status of an account

Set the blockchain parameters

Retrieve the blolckchain parameters

Set the KV parameters

Pre-activate protocol feature

Attributes Documentation

variable ram_bytes

int64_t * ram_bytes;

variable net_weight

int64_t int64_t * net_weight;

variable cpu_weight

int64_t int64_t int64_t * cpu_weight;

variable producer_data_size

uint32_t producer_data_size;

variable producer_data

char * producer_data;

variable is_priv

bool is_priv;

variable datalen

uint32_t datalen;

Source code

#pragma once
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif

__attribute__((eosio_wasm_import))
void get_resource_limits( capi_name account, int64_t* ram_bytes, int64_t* net_weight, int64_t* cpu_weight );

__attribute__((eosio_wasm_import))
void set_resource_limits( capi_name account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight );

__attribute__((eosio_wasm_import))
int64_t set_proposed_producers( char *producer_data, uint32_t producer_data_size );

__attribute__((eosio_wasm_import))
int64_t set_proposed_producers_ex( uint64_t producer_data_format, char *producer_data, uint32_t producer_data_size );


__attribute__((eosio_wasm_import))
bool is_privileged( capi_name account );

__attribute__((eosio_wasm_import))
void set_privileged( capi_name account, bool is_priv );

__attribute__((eosio_wasm_import))
void set_blockchain_parameters_packed( char* data, uint32_t datalen );

__attribute__((eosio_wasm_import))
uint32_t get_blockchain_parameters_packed( char* data, uint32_t datalen );

__attribute__((eosio_wasm_import))
void set_kv_parameters_packed( const char* data, uint32_t datalen );

__attribute__((eosio_wasm_import))
void preactivate_feature( const struct capi_checksum256* feature_digest );

#ifdef __cplusplus
}
#endif

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