message: 4297 delegatebw with buyram
diff: @@ -1103,6 +1103,7 @@ struct delegate_bandwidth_subcommand {
  string stake_net_amount;
  string stake_cpu_amount;
  string stake_storage_amount;
  + string buy_ram_amount;
  bool transfer = false;
  delegate_bandwidth_subcommand(CLI::App* actionRoot) {
  @@ -1111,10 +1112,25 @@ struct delegate_bandwidth_subcommand {
  delegate_bandwidth->add_option("receiver", receiver_str, localized("The account to receive the delegated bandwidth"))->required();
  delegate_bandwidth->add_option("stake_net_quantity", stake_net_amount, localized("The amount of EOS to stake for network bandwidth"))->required();
  delegate_bandwidth->add_option("stake_cpu_quantity", stake_cpu_amount, localized("The amount of EOS to stake for CPU bandwidth"))->required();
  + delegate_bandwidth->add_option("--buyram", buy_ram_amount, localized("The amount of EOS to buyram"));
  delegate_bandwidth->add_flag("--transfer", transfer, localized("Transfer voting power and right to unstake EOS to receiver"));
  add_standard_transaction_options(delegate_bandwidth);
  delegate_bandwidth->set_callback([this] {
  + if (buy_ram_amount.length()) {
  + fc::variant act_payload = fc::mutable_variant_object()
  + ("from", from_str)
  + ("receiver", receiver_str)
  + ("stake_net_quantity", to_asset(stake_net_amount))
  + ("stake_cpu_quantity", to_asset(stake_cpu_amount))
  + ("transfer", transfer);
  + fc::variant act_payload2 = fc::mutable_variant_object()
  + ("payer", from_str)
  + ("receiver", receiver_str)
  + ("quant", to_asset(buy_ram_amount));
  + send_actions({create_action({permission_level{from_str,config::active_name}}, config::system_account_name, N(delegatebw), act_payload),
  + create_action({permission_level{from_str,config::active_name}}, config::system_account_name, N(buyram), act_payload2)});
  + } else {
  fc::variant act_payload = fc::mutable_variant_object()
  ("from", from_str)
  ("receiver", receiver_str)
  @@ -1124,6 +1140,7 @@ struct delegate_bandwidth_subcommand {
  ;
  wdump((act_payload));
  send_actions({create_action({permission_level{from_str,config::active_name}}, config::system_account_name, N(delegatebw), act_payload)});
  + }
  });
  }
  };
  