message: rename cleos sudo command to wrap; also allow user to override contract account
diff: @@ -3053,19 +3053,21 @@ int main( int argc, char** argv ) {
  }
  );
  - // sudo subcommand
  - auto sudo = app.add_subcommand("sudo", localized("Sudo contract commands"), false);
  - sudo->require_subcommand();
  + // wrap subcommand
  + auto wrap = app.add_subcommand("wrap", localized("Wrap contract commands"), false);
  + wrap->require_subcommand();
  - // sudo exec
  + // wrap exec
  + con = "eosio.wrap";
  executer = "";
  string trx_to_exec;
  - auto sudo_exec = sudo->add_subcommand("exec", localized("Execute a transaction while bypassing authorization checks"));
  - add_standard_transaction_options(sudo_exec);
  - sudo_exec->add_option("executer", executer, localized("Account executing the transaction and paying for the deferred transaction RAM"))->required();
  - sudo_exec->add_option("transaction", trx_to_exec, localized("The JSON string or filename defining the transaction to execute"))->required();
  + auto wrap_exec = wrap->add_subcommand("exec", localized("Execute a transaction while bypassing authorization checks"));
  + add_standard_transaction_options(wrap_exec);
  + wrap_exec->add_option("executer", executer, localized("Account executing the transaction and paying for the deferred transaction RAM"))->required();
  + wrap_exec->add_option("transaction", trx_to_exec, localized("The JSON string or filename defining the transaction to execute"))->required();
  + wrap_exec->add_option("--contract,-c", con, localized("The contract which controls the wrap contract"));
  - sudo_exec->set_callback([&] {
  + wrap_exec->set_callback([&] {
  fc::variant trx_var;
  try {
  trx_var = json_from_file_or_string(trx_to_exec);
  @@ -3073,14 +3075,14 @@ int main( int argc, char** argv ) {
  auto accountPermissions = get_account_permissions(tx_permission);
  if( accountPermissions.empty() ) {
  - accountPermissions = vector<permission_level>{{executer, config::active_name}, {"eosio.sudo", config::active_name}};
  + accountPermissions = vector<permission_level>{{executer, config::active_name}, {con, config::active_name}};
  }
  auto args = fc::mutable_variant_object()
  ("executer", executer )
  ("trx", trx_var);
  - send_actions({chain::action{accountPermissions, "eosio.sudo", "exec", variant_to_bin( N(eosio.sudo), N(exec), args ) }});
  + send_actions({chain::action{accountPermissions, con, "exec", variant_to_bin( con, N(exec), args ) }});
  });
  // system subcommand
  