current fixes
This commit is contained in:
parent
37d260a519
commit
83968977a1
6 changed files with 24 additions and 16 deletions
|
|
@ -38,25 +38,25 @@ POP_VS_WARNINGS
|
|||
catch (const tools::error::daemon_busy& e) \
|
||||
{ \
|
||||
er.code = WALLET_RPC_ERROR_CODE_DAEMON_IS_BUSY; \
|
||||
er.message = e.what(); \
|
||||
er.message = std::string("WALLET_RPC_ERROR_CODE_DAEMON_IS_BUSY") + e.what(); \
|
||||
return false; \
|
||||
} \
|
||||
catch (const tools::error::not_enough_money& e) \
|
||||
{ \
|
||||
er.code = WALLET_RPC_ERROR_CODE_GENERIC_TRANSFER_ERROR; \
|
||||
er.message = e.error_code(); \
|
||||
er.code = WALLET_RPC_ERROR_CODE_NOT_ENOUGH_MONEY; \
|
||||
er.message = std::string("WALLET_RPC_ERROR_CODE_NOT_ENOUGH_MONEY") + e.error_code(); \
|
||||
return false; \
|
||||
} \
|
||||
catch (const tools::error::wallet_error& e) \
|
||||
{ \
|
||||
er.code = WALLET_RPC_ERROR_CODE_GENERIC_TRANSFER_ERROR; \
|
||||
er.message = e.error_code(); \
|
||||
er.message = std::string("WALLET_RPC_ERROR_CODE_GENERIC_TRANSFER_ERROR") + e.error_code(); \
|
||||
return false; \
|
||||
} \
|
||||
catch (const std::exception& e) \
|
||||
{ \
|
||||
er.code = WALLET_RPC_ERROR_CODE_GENERIC_TRANSFER_ERROR; \
|
||||
er.message = e.what(); \
|
||||
er.message = std::string("WALLET_RPC_ERROR_CODE_GENERIC_TRANSFER_ERROR") + e.what(); \
|
||||
return false; \
|
||||
} \
|
||||
catch (...) \
|
||||
|
|
|
|||
|
|
@ -13,3 +13,4 @@
|
|||
#define WALLET_RPC_ERROR_CODE_GENERIC_TRANSFER_ERROR -4
|
||||
#define WALLET_RPC_ERROR_CODE_WRONG_PAYMENT_ID -5
|
||||
#define WALLET_RPC_ERROR_CODE_WRONG_ARGUMENT -6
|
||||
#define WALLET_RPC_ERROR_CODE_NOT_ENOUGH_MONEY -7
|
||||
|
|
|
|||
|
|
@ -34,11 +34,15 @@ POP_VS_WARNINGS
|
|||
|
||||
void test_plain_wallet()
|
||||
{
|
||||
|
||||
std::string res = plain_wallet::init("195.201.107.230", "33336", "C:\\Users\\roky\\home\\", 0);
|
||||
//std::string res = plain_wallet::init("195.201.107.230", "33336", "E:\\tmp\\", 0);
|
||||
std::string res = plain_wallet::init("127.0.0.1", "12111", "C:\\Users\\roky\\home\\", 0);
|
||||
|
||||
uint64_t instance_id = 0;
|
||||
res = plain_wallet::open("SEGA_2", "Test2");
|
||||
res = plain_wallet::open("test_restored.zan", "111");
|
||||
//res = plain_wallet::restore("heart level clear fate sorrow childhood sent fate ceiling party third steel came ask mix neither message already almost vast date glide tumble color okay space",
|
||||
// "test_restored.zan", "111", "");
|
||||
|
||||
|
||||
while(true)
|
||||
{
|
||||
epee::misc_utils::sleep_no_w(2000);
|
||||
|
|
@ -50,16 +54,18 @@ void test_plain_wallet()
|
|||
}
|
||||
|
||||
|
||||
std::string invoke_body = "{\"method\":\"get_recent_txs_and_info\",\"params\":{\"offset\":0,\"count\":30,\"update_provision_info\":true}}";
|
||||
|
||||
res = plain_wallet::sync_call("invoke", instance_id, invoke_body);
|
||||
std::string invoke_body = "{\"method\":\"store\",\"params\":{}}";
|
||||
//std::string res1 = plain_wallet::sync_call("invoke", instance_id, invoke_body);
|
||||
|
||||
invoke_body = "{\"method\":\"assets_whitelist_get\",\"params\":{}}";
|
||||
invoke_body = "{\"method\":\"get_recent_txs_and_info\",\"params\":{\"offset\":0,\"count\":30,\"update_provision_info\":true}}";
|
||||
std::string res2 = plain_wallet::sync_call("invoke", instance_id, invoke_body);
|
||||
|
||||
res = plain_wallet::sync_call("invoke", instance_id, invoke_body);
|
||||
invoke_body = "{\"method\":\"getbalance\",\"params\":{}}";
|
||||
std::string res3 = plain_wallet::sync_call("invoke", instance_id, invoke_body);
|
||||
|
||||
|
||||
res = plain_wallet::close_wallet(instance_id);
|
||||
invoke_body = "{\r\n \"method\": \"transfer\",\r\n \"params\": {\r\n \"destinations\": [\r\n {\r\n \"amount\": \"1000000000000\",\r\n \"address\": \"ZxD9oVwGwW6ULix9Pqttnr7JDpaoLvDVA1KJ9eA9KRxPMRZT5X7WwtU94XH1Z6q6XTMxNbHmbV2xfZ429XxV6fST2DxEg4BQV\",\r\n \"asset_id\": \"cc4e69455e63f4a581257382191de6856c2156630b3fba0db4bdd73ffcfb36b6\"\r\n }\r\n ],\r\n \"fee\": 10000000000,\r\n \"mixin\": 10,\r\n \"payment_id\": \"\",\r\n \"comment\": \"\",\r\n \"push_payer\": false,\r\n \"hide_receiver\": true\r\n }\r\n}";
|
||||
std::string res4 = plain_wallet::sync_call("invoke", instance_id, invoke_body);
|
||||
|
||||
LOG_PRINT_L0(res);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ public:
|
|||
m_bob.generate();
|
||||
|
||||
uint64_t block_reward_without_fee = 0;
|
||||
|
||||
uint64_t block_reward = 0;
|
||||
if(!construct_miner_tx(0, 0, 0, 2, 0, m_bob.get_keys().account_address, m_bob.get_keys().account_address, m_tx, block_reward_without_fee, block_reward, TRANSACTION_VERSION_PRE_HF4, blobdata(), CURRENCY_MINER_TX_MAX_OUTS))
|
||||
return false;
|
||||
|
||||
m_tx_pub_key = get_tx_pub_key_from_extra(m_tx);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
1
utils/test_api_files/get_alias_by_address.json
Normal file
1
utils/test_api_files/get_alias_by_address.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"method": "get_alias_details","params": {"alias": "zoidb"}}
|
||||
|
|
@ -1 +1 @@
|
|||
{"method": "get_alias_details","params": {"alias": "zoidb"}}
|
||||
{"method": "get_alias_details","params": "ZxCjF84feY7GQZ1fdy9r3ZJABwaFjmb2Dd25H5qANWZ2VufpmyNu7ZnShMBDpiw8VW2k1EjPZswgFZnx3v1EYgJ32Rjn64mq9"}
|
||||
Loading…
Add table
Reference in a new issue