Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
vote_producers_subcommand Struct Reference
Collaboration diagram for vote_producers_subcommand:

Public Member Functions

 vote_producers_subcommand (CLI::App *actionRoot)
 

Public Attributes

string voter_str
 
vector< std::string > producer_names
 

Detailed Description

Definition at line 1254 of file main.cpp.

Constructor & Destructor Documentation

◆ vote_producers_subcommand()

vote_producers_subcommand::vote_producers_subcommand ( CLI::App * actionRoot)
inline

Definition at line 1258 of file main.cpp.

1258 {
1259 auto vote_producers = actionRoot->add_subcommand("prods", localized("Vote for one or more producers"));
1260 vote_producers->add_option("voter", voter_str, localized("The voting account"))->required();
1261 vote_producers->add_option("producers", producer_names, localized("The account(s) to vote for. All options from this position and following will be treated as the producer list."))->required();
1262 add_standard_transaction_options(vote_producers, "voter@active");
1263
1264 vote_producers->callback([this] {
1265
1266 std::sort( producer_names.begin(), producer_names.end() );
1267
1269 ("voter", voter_str)
1270 ("proxy", "")
1271 ("producers", producer_names);
1272 auto accountPermissions = get_account_permissions(tx_permission, {name(voter_str), config::active_name});
1273 send_actions({create_action(accountPermissions, config::system_account_name, "voteproducer"_n, act_payload)});
1274 });
1275 }
std::string name
App * add_subcommand(std::string subcommand_name="", std::string subcommand_description="")
Add a subcommand. Inherits INHERITABLE and OptionDefaults, and help flag.
Definition CLI11.hpp:5538
Option * add_option(std::string option_name, callback_t option_callback, std::string option_description="", bool defaulted=false, std::function< std::string()> func={})
Definition CLI11.hpp:5099
CRTP * required(bool value=true)
Set the option as required.
Definition CLI11.hpp:3400
An order-preserving dictionary of variants.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191
#define localized(str,...)
Definition localize.hpp:10
chain::action create_action(const vector< permission_level > &authorization, const account_name &code, const action_name &act, const fc::variant &args)
Definition main.cpp:683
vector< chain::permission_level > get_account_permissions(const vector< string > &permissions)
Definition main.cpp:238
void add_standard_transaction_options(CLI::App *cmd, string default_permission="")
Definition main.cpp:202
void send_actions(std::vector< chain::action > &&actions, packed_transaction::compression_type compression=packed_transaction::compression_type::none)
Definition main.cpp:616
vector< string > tx_permission
Definition main.cpp:198
vector< std::string > producer_names
Definition main.cpp:1256
Here is the call graph for this function:

Member Data Documentation

◆ producer_names

vector<std::string> vote_producers_subcommand::producer_names

Definition at line 1256 of file main.cpp.

◆ voter_str

string vote_producers_subcommand::voter_str

Definition at line 1255 of file main.cpp.


The documentation for this struct was generated from the following file: