#include "gtest/gtest.h"
#include <sstream>
#include "wallet/wallet.h"
#include "rpc/core_rpc_server.h"
#include "cryptonote_basic/account.h"
#include "net/http_client_abstract_invoke.h"
Go to the source code of this file.
|
| | TEST (Transfers, Transfers) |
| |
◆ ACCS
◆ TEST()
| TEST |
( |
Transfers |
, |
|
|
Transfers |
|
|
) |
| |
Definition at line 46 of file transfers.cpp.
48 log_space::get_set_log_detalisation_level(
true, LOG_LEVEL_3);
49 log_space::log_singletone::add_logger(LOGGER_CONSOLE, NULL, NULL);
51 cout <<
"TESTING: transfers" << endl;
54 wallet
miner, accs[100], receiver;
58 cout <<
"miner: " <<
miner.get_account().get_public_address_str(
false) << endl;
60 for (
int i = 0; i <
ACCS; i++) {
62 s <<
"acc" << setw(2) << setfill(
'0') << i <<
".b2wallet";
64 assert(accs[i].
init());
65 assert(accs[i].store(s.str()));
68 assert(receiver.init());
69 receiver.store(
"receiver.b2wallet");
72 COMMAND_RPC_START_MINE::request req;
73 req.miner_address =
miner.get_account().get_public_address_str(
false);
74 req.threads_count = 1;
76 bool r = net_utils::http::invoke_http_json_remote_command(
daemon_address +
"/start_mine", req,
res, http_client);
84 cout <<
"miner balance: " <<
miner.balance() << endl;
86 vector<pair<account_public_address, uint64_t>> d_accs;
87 for (
int i = 0; i <
ACCS; i++)
88 d_accs.push_back(make_pair(accs[i].get_account().get_keys().m_account_address, 1));
93 for (
int i = 0; i <
ACCS; i++) {
95 ASSERT_TRUE(accs[i].transfer(receiver.get_account().get_keys().m_account_address, 1));
99 cout <<
"wait for block" << endl;
103 cout <<
"OK" << endl;
epee::misc_utils::struct_init< response_t > response
bool init(const boost::program_options::variables_map &vm, network_type nettype, bool fallback_to_pow=false)
#define ASSERT_TRUE(condition)
◆ daemon_address
| string daemon_address = "http://localhost:23400" |