GetTotalRecievedByAnAddress test added

pull/93/merge
moneroexamples 6 years ago
parent 7c0dfe1801
commit 8f6099c30d

@ -1,11 +1,11 @@
-- phpMyAdmin SQL Dump
-- version 4.8.1
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jun 21, 2018 at 03:02 AM
-- Server version: 10.1.33-MariaDB
-- PHP Version: 7.2.6
-- Generation Time: Jun 26, 2018 at 04:26 AM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.2.7
SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
@ -43,11 +43,6 @@ CREATE TABLE IF NOT EXISTS `Accounts` (
UNIQUE KEY `address` (`address`)
) ENGINE=InnoDB AUTO_INCREMENT=135 DEFAULT CHARSET=utf8;
--
-- Truncate table before insert `Accounts`
--
TRUNCATE TABLE `Accounts`;
--
-- Dumping data for table `Accounts`
--
@ -55,7 +50,7 @@ TRUNCATE TABLE `Accounts`;
INSERT INTO `Accounts` (`id`, `address`, `viewkey_hash`, `scanned_block_height`, `scanned_block_timestamp`, `start_height`, `created`, `modified`) VALUES
(129, '57Hx8QpLUSMjhgoCNkvJ2Ch91mVyxcffESCprnRPrtbphMCv8iGUEfCUJxrpUWUeWrS9vPWnFrnMmTwnFpSKJrSKNuaXc5q', '1acf92d12101afe2ce7392169a38d2d547bd042373148eaaab323a3b5185a9ba', 101610, '2018-06-21 03:00:30', 96783, '2018-06-14 05:20:09', '2018-06-14 05:20:09'),
(130, '59imctBu85zZ9fJDTndqQRikvkeGnnUF6EuLERmdpE5fW2EEJbvbAc92uLfao947dpYpV4JaWg7FfUAenFQ6DMyfNQG8v1C', '1af8e9e4b194d2bf6fc771718d97cd65bec142796445df74855e5502205aa41d', 100871, '2018-06-20 01:37:28', 100480, '2018-06-19 04:39:16', '2018-06-19 04:39:16'),
(131, '55ZbQdMnZHPFS8pmrhHN5jMpgJwnnTXpTDmmM5wkrBBx4xD6aEnpZq7dPkeDeWs67TV9HunDQtT3qF2UGYWzGGxq3zYWCBE', 'c8e858047caf1615dc77759a4b134befc40955ab945bc381de71cf4502047059', 100941, '2018-06-20 03:56:37', 100480, '2018-06-19 04:39:27', '2018-06-19 04:39:27'),
(131, '55ZbQdMnZHPFS8pmrhHN5jMpgJwnnTXpTDmmM5wkrBBx4xD6aEnpZq7dPkeDeWs67TV9HunDQtT3qF2UGYWzGGxq3zYWCBE', 'c8e858047caf1615dc77759a4b134befc40955ab945bc381de71cf4502047059', 105232, '2018-06-26 04:22:22', 100480, '2018-06-19 04:39:27', '2018-06-19 04:39:27'),
(132, '53mqDDKtVkib8inMa41HuNJG4tj9CcaNKGr6EVSbvhWGJdpDQCiNNYBUNF1oDb8BczU5aD68d3HNKXaEsPq8cvbQE2FBkTS', '4fbcd8e59f156553713e0b624930856a7798e98930cb9ae446712b53c44cde9d', 33399, '2018-03-15 00:47:44', 100870, '2018-06-20 01:36:25', '2018-06-20 01:36:25'),
(133, '57hGLsqr6eLjUDoqWwP3Ko9nCJ4GFN5AyezdxNXwpa1PMt6M4AbsBgcHH21hVe2MJrLGSM9C7UTqcEmyBepdhvFE4eyW3Kd', '69b1d4a9f618724fabb85ef1e6631d384a0b8ea75cda94ecc999a8680af2d439', 100871, '2018-06-20 01:37:28', 100871, '2018-06-20 01:38:28', '2018-06-20 01:38:28'),
(134, '5AjfkEY7RFgNGDYvoRQkncfwHXT6Fh7oJBisqFUX5u96i3ZepxDPocQK29tmAwBDuvKRpskZnfA6N8Ra58qFzA4bSA3QZFp', '46efade82358c19fc2f42b86cb10297e524fbe6c39f807fb064a445c5d8b6367', 101610, '2018-06-21 03:00:30', 100937, '2018-06-20 03:49:53', '2018-06-20 03:49:53');
@ -79,13 +74,8 @@ CREATE TABLE IF NOT EXISTS `Inputs` (
KEY `account_id2` (`account_id`),
KEY `tx_id2` (`tx_id`),
KEY `output_id2` (`output_id`)
) ENGINE=InnoDB AUTO_INCREMENT=60805 DEFAULT CHARSET=utf8;
--
-- Truncate table before insert `Inputs`
--
) ENGINE=InnoDB AUTO_INCREMENT=60809 DEFAULT CHARSET=utf8;
TRUNCATE TABLE `Inputs`;
--
-- Dumping data for table `Inputs`
--
@ -157,7 +147,11 @@ INSERT INTO `Inputs` (`id`, `account_id`, `tx_id`, `output_id`, `key_image`, `am
(60801, 134, 106083, 140460833003780, '17d3a9c98911f1a4a400d141164449ec5355618c0f5e0daf110dff3ada0c819d', 00000142897491554500, '2018-06-20 05:15:56'),
(60802, 134, 106084, 140460833003769, 'abc529357f90641d501d5108f822617049c19461569eafa45cb5400ee45bef33', 00000010000000010000, '2018-06-20 05:15:56'),
(60803, 134, 106085, 140460833003775, '0e88fb5f5cea2e233ad4ada1f4c3028a690f9fa4796af109bcd4ba4f3a3d27d8', 00000245678901234500, '2018-06-20 23:40:10'),
(60804, 134, 106086, 140460833003780, 'a44e5fb941db7acb494e866b40186c372bd8eee5e25681b3c88070c095cf20b9', 00000142897491554500, '2018-06-20 23:40:10');
(60804, 134, 106086, 140460833003780, 'a44e5fb941db7acb494e866b40186c372bd8eee5e25681b3c88070c095cf20b9', 00000142897491554500, '2018-06-20 23:40:10'),
(60805, 131, 106088, 140460833003768, '76be2adff021d152b489eb5c4029cc3e305b76b8d266bc47bb9585dc50dd68a4', 00000098984440430000, '2018-06-20 04:41:31'),
(60806, 131, 106089, 428933, '03cc401c8bbc11febf34b72a80cbc46cc37371b2c2170af43d628755c386ed29', 00000029947224183861, '2018-06-20 04:41:31'),
(60807, 131, 106090, 140460833003768, '6287bc622828e80aad58ee39732f5688eb39c6bfb90ffb2e9be7baae5c8600ef', 00000098984440430000, '2018-06-20 04:41:31'),
(60808, 131, 106091, 428933, '5d0447d9510858d83573a48a219fe77d1afc813bcfcf20b81d397871304d6a0b', 00000029947224183861, '2018-06-20 04:41:31');
-- --------------------------------------------------------
@ -183,13 +177,8 @@ CREATE TABLE IF NOT EXISTS `Outputs` (
PRIMARY KEY (`id`),
KEY `account_id` (`account_id`),
KEY `tx_id` (`tx_id`)
) ENGINE=InnoDB AUTO_INCREMENT=140460833003781 DEFAULT CHARSET=utf8;
) ENGINE=InnoDB AUTO_INCREMENT=140460833003782 DEFAULT CHARSET=utf8;
--
-- Truncate table before insert `Outputs`
--
TRUNCATE TABLE `Outputs`;
--
-- Dumping data for table `Outputs`
--
@ -248,7 +237,8 @@ INSERT INTO `Outputs` (`id`, `account_id`, `tx_id`, `out_pub_key`, `rct_outpk`,
(140460833003776, 134, 106069, 'eb0bb695366ef5ea55cd049769656f1428144c2dcceb1fb92c983a6648fdc481', '6d6e3a5005c8022ed3b004d92f8d9a660b0b217aac647e06888123651f0ac91e', '91ff0136a259b147a41f0f7e7bc9a98fea062a1e057e63d56b7c6b767c5fd605', 'f35ada40d635f628dc80a1e51eaed0a16df012b02eb9827a5f2e201999acd202', '07c537636d32c1b6a044eee140ee3147d07f786e8dace1685df3fa950ea09332', 123000, 74292, 4, 15, '2018-06-20 04:41:31'),
(140460833003777, 134, 106070, 'e475a89f6073029a3f6ca09f301d5a88e522e229b0a3e7867b2aa331cb46c8d6', '4a297d61a76e9d352852999229a2f735b8bbefd3fcbb680eec46761959be5c9a', '40d1c4eba4bee47fb53988a6b12fa4fdc661d20446d157eae0ea42a2c69d0800', '8394fb8714a97a9c98858f1f57e1c45530f8ecdebc88a62f8eaa986adcf0940f', '307f043802c7d6460fbf3aab1ad9bddeb417c7a5810382d0b282d2e3ffa860a7', 123677771919210, 74333, 1, 41, '2018-06-20 05:11:39'),
(140460833003778, 129, 106071, 'e4b04f1a4a46e00442df6fbee88056ef5d34fb87d432e232dc3b166be05fdb28', '32e62f9336efcb8a134813c6d9ac94736fea3ae7fa9969bb2acb5697bb361447', '5659ae1d583cd70ef6944164ab2c35f9ec26addba6cdd6d43287a58bf3e0fb0d', 'a0a3784186315a8ea8d8402026cd186c37c794f6d9b4b97f50e6726eda7fca08', '307f043802c7d6460fbf3aab1ad9bddeb417c7a5810382d0b282d2e3ffa860a7', 23000000000100, 74332, 0, 41, '2018-06-20 05:11:39'),
(140460833003780, 134, 106078, 'f0d1a5bf71467e60ffe53a78ec1521ecbb985d4e890d66b54fa3990b500f937c', '59c0ea051400362c876d01b722bf3f42cd9d5d89878f8cbd0aa33437773fefa9', 'f67c6d379d9d7446e8145639e60f08364fdf9037b4b26ddc0374db5f03eb4e02', 'c8933aff04aa77a8a64cb79857f29fd941eb7c1944abdfdc9082adbb09a89d08', 'abd3d37e07a8ae0b83dab63af6a6685fc2a56b2aa7d993ea2bfbb84d3102f98f', 142897491554500, 74343, 1, 21, '2018-06-20 05:15:56');
(140460833003780, 134, 106078, 'f0d1a5bf71467e60ffe53a78ec1521ecbb985d4e890d66b54fa3990b500f937c', '59c0ea051400362c876d01b722bf3f42cd9d5d89878f8cbd0aa33437773fefa9', 'f67c6d379d9d7446e8145639e60f08364fdf9037b4b26ddc0374db5f03eb4e02', 'c8933aff04aa77a8a64cb79857f29fd941eb7c1944abdfdc9082adbb09a89d08', 'abd3d37e07a8ae0b83dab63af6a6685fc2a56b2aa7d993ea2bfbb84d3102f98f', 142897491554500, 74343, 1, 21, '2018-06-20 05:15:56'),
(140460833003781, 131, 106087, 'a2504f3d9c79548295151eaa319a68a40f024dfa7e14e0d0c5db585b16214d9f', '0f84be97948eda224858ff7a93987420bf8732454e70ab812d77e14e5a4c383b', 'b388bfbe30a5f8fbfad47182e359702270970c83c6bd0c5061ab44e901237107', '3f54e39ca8ddc738476b6c859d80ec34e59cc44afdc4a5d2cd2da76ad573ef08', '07c537636d32c1b6a044eee140ee3147d07f786e8dace1685df3fa950ea09332', 100444440000000, 74290, 2, 15, '2018-06-20 04:41:31');
-- --------------------------------------------------------
@ -271,11 +261,6 @@ CREATE TABLE IF NOT EXISTS `Payments` (
UNIQUE KEY `payment_id` (`payment_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
--
-- Truncate table before insert `Payments`
--
TRUNCATE TABLE `Payments`;
--
-- Dumping data for table `Payments`
--
@ -311,13 +296,8 @@ CREATE TABLE IF NOT EXISTS `Transactions` (
PRIMARY KEY (`id`),
UNIQUE KEY `hash` (`hash`,`account_id`),
KEY `account_id_2` (`account_id`)
) ENGINE=InnoDB AUTO_INCREMENT=106087 DEFAULT CHARSET=utf8;
--
-- Truncate table before insert `Transactions`
--
) ENGINE=InnoDB AUTO_INCREMENT=106092 DEFAULT CHARSET=utf8;
TRUNCATE TABLE `Transactions`;
--
-- Dumping data for table `Transactions`
--
@ -383,7 +363,7 @@ INSERT INTO `Transactions` (`id`, `hash`, `prefix_hash`, `tx_pub_key`, `account_
(106059, '3c1dd70ebc3479a312c842bcfe6521031b1e733f701e8ee0fb477bb0d0c00c23', '641aa124c4623ec26e92a7dd44e984f2817b672c7bee249b535408a8975bce44', '711c6aa4c77cc36549fbe9606ba0727755d0daa7c23bf4b77b122dee17a2c82c', 131, 104324, 0, 29945796221618, 0, 100886, 1, 0, 1, 1, '', 8, '2018-06-20 02:24:08'),
(106060, 'dbf41553c9897dd232fd46739662a4e68b43cfa840a68f5ec9e0e97ab839f4ee', '27da497d445883dc52f23ebeb7b4508044f0402c71a65fade583f6b8814102ea', '7151fdf3d3364e6980b320b1533052f0a7d328e431885ae84126d6077a1c5b81', 131, 104387, 0, 500000000000000, 0, 100932, 1, 0, 1, 1, '', 8, '2018-06-20 03:56:48'),
(106061, 'efa653785fd536ec42283985666612eca961a0bf6a8d56c4c43b1027d173a32c', '989c4beeb5b2fbbab9671bf6562b99f6dd01d11c9ac0c13d544cb5db2b0d225c', '9a9d13d0db79aa36f371e51f164aa97394c89bc57ec7040cc72895befd4d70f7', 134, 104396, 1000000000000, 0, 0, 100938, 1, 0, 1, 1, '', 7, '2018-06-20 04:22:24'),
(106062, 'efa653785fd536ec42283985666612eca961a0bf6a8d56c4c43b1027d173a32c', '989c4beeb5b2fbbab9671bf6562b99f6dd01d11c9ac0c13d544cb5db2b0d225c', '9a9d13d0db79aa36f371e51f164aa97394c89bc57ec7040cc72895befd4d70f7', 131, 104396, 98984440430000, 0, 0, 100938, 0, 0, 1, 1, '', 7, '2018-06-20 03:50:19'),
(106062, 'efa653785fd536ec42283985666612eca961a0bf6a8d56c4c43b1027d173a32c', '989c4beeb5b2fbbab9671bf6562b99f6dd01d11c9ac0c13d544cb5db2b0d225c', '9a9d13d0db79aa36f371e51f164aa97394c89bc57ec7040cc72895befd4d70f7', 131, 104396, 98984440430000, 0, 0, 100938, 1, 0, 1, 1, '', 7, '2018-06-26 04:25:32'),
(106063, '00458128c40886b22d15cbf3c02fcbb1a0860cab654d81230dba216b50fe887d', 'df567492d853df6116864f5f77542259c2d77242f97319dabc60783f6670b909', 'cabf4e0df01dfbca8959be74a0d271ad4cc54ee365f1d5660b6e593926f415bc', 134, 104398, 10000000010000, 0, 0, 100939, 1, 0, 1, 1, '8c1018768e798c29', 7, '2018-06-20 04:22:24'),
(106064, 'fc619eeccfa0626f4be78cb1002a232e0ae8c8be6826f800341977d23a5a8e1e', '481f2a3152a85171a6455643874c19a6abaddbac2c447d0553bec029b21100d4', '4e3008466491a4514af0bf7f066752c10b8c280dbca2e22154f96b1618e5c7e5', 134, 104406, 4292247887374, 0, 0, 100943, 1, 0, 1, 2, '', 20, '2018-06-20 05:07:55'),
(106065, '9ba6fa1c6f0277651e38b9f076a2cf674d92d683beac42ad93db1f3cc429cffe', '19d43fa4b46e612d495cccaaf2c0aca36459c45d695fce17a19a47f34d78ab79', 'b7601cb33713f14f730012c76c51122abd243f6f7df056f51a85325ba70c62b2', 134, 104407, 139849921289310, 0, 0, 100943, 1, 0, 1, 2, '', 15, '2018-06-20 05:07:55'),
@ -406,7 +386,12 @@ INSERT INTO `Transactions` (`id`, `hash`, `prefix_hash`, `tx_pub_key`, `account_
(106083, 'fc4b8d5956b30dc4a353b171b4d974697dfc32730778f138a8e7f16c11907691', 'e164f20f5fabe2b43317a16db9316a5e7e87fa1ea59c0a6c09687e1db67c7158', '011f34ac725f4832faa17b2a5232cee54ce97bd75b91e6622f4652d92b68c014', 134, 104642, 0, 142897491554500, 0, 101081, 1, 0, 1, 1, '', 7, '2018-06-20 05:15:56'),
(106084, 'ad3f3d9ff1e2dd2145067950d68d24cbd53db6f9d771f0d275c33fd88e458cf0', '6c534c098fa778b39635b77d5e6468f5a4d532f677eb345e54068a543ee5ff51', '778e5003ad05ea4918114ca5b7ac56b80b6ec4152122afd8e7d8de3c74ffd359', 134, 104706, 0, 10000000010000, 0, 101085, 1, 0, 1, 1, '', 7, '2018-06-20 05:15:56'),
(106085, 'dcb792bba1da7a9872f9c36772ee8625282b1f144380288fbd8acb968f6de56a', '91eb3b6f6d58da76fffefbee2fcb9dea523c326f313ac24fb5f556f3496ceea3', '9af6e066de005ed775d960e6c79b5aea2d91825206eb3772574168ace5b672a2', 134, 105221, 0, 245678901234500, 0, 101553, 1, 0, 1, 1, '', 8, '2018-06-20 23:40:10'),
(106086, 'c8965d4f54de1e39033b07e88bb20cacaa725a0dc266444e2efde6f624b9245d', 'b7d8c731d94e46df8a2825a57153809c89b68574f533c7f6486e4dc1e8eab3a2', '9adfd62107222cbb715a74b546677b743fa0f3cdb3ae87849f58e696304344ba', 134, 105224, 0, 142897491554500, 0, 101554, 1, 0, 1, 1, '', 8, '2018-06-20 23:40:10');
(106086, 'c8965d4f54de1e39033b07e88bb20cacaa725a0dc266444e2efde6f624b9245d', 'b7d8c731d94e46df8a2825a57153809c89b68574f533c7f6486e4dc1e8eab3a2', '9adfd62107222cbb715a74b546677b743fa0f3cdb3ae87849f58e696304344ba', 134, 105224, 0, 142897491554500, 0, 101554, 1, 0, 1, 1, '', 8, '2018-06-20 23:40:10'),
(106087, '3fb5d474378431bfa1b01e61965dcd5a62e1753cb7b3064ba7adb98bcfd398cd', 'c6c641c313a0ed68c296e2425a7404ea6c95e37b27d3b519173a60374ec7d021', '07c537636d32c1b6a044eee140ee3147d07f786e8dace1685df3fa950ea09332', 131, 104419, 100444440000000, 0, 0, 100949, 1, 0, 1, 2, '', 15, '2018-06-20 04:41:31'),
(106088, '87d2560139a4f512a78d9da25ab58848345a3fb457d5da666cd2addfe03eec09', '1f1338762e193362159a6232ea53e2db5c71d13351b7f54a951fcbb3e30cd187', '3e0ec3afcba79374dfb11e1c2a4d0d0e17b71243dc44e8f2e2708e016d83d2ad', 131, 104514, 0, 98984440430000, 0, 101005, 1, 0, 1, 1, '', 8, '2018-06-20 04:41:31'),
(106089, '7aa183514560311b40807db1d962742934c1a826b5b8fabcc488690f600d2a9c', '8930d1107bbc6c6fca64c5e9184adb9b9aef4dd91289780fca386f2a9c9a7b30', '5ac13b8b4eb788145c19b5199746a61f72fa3b9f00eb2bbf106f2a8c2a037ee8', 131, 104522, 0, 29947224183861, 0, 101008, 1, 0, 1, 1, '', 8, '2018-06-20 04:41:31'),
(106090, 'f2c81053c2faa766f405a6f1546aecb0689ad9581aff9fa68d2f259d0aa55481', 'c446ae599a3e2767f9b9afb154fb599d2c0ec4ff2d2e99f4decbbe6df7e1b07b', '1e3086a053134ec4d6d6c7f94c560aa428ed7beb93235657f6be4108d26daf0a', 131, 104639, 0, 98984440430000, 0, 101081, 1, 0, 1, 1, '', 7, '2018-06-20 04:41:31'),
(106091, '61069b69dda271562a0494d37139301d29e33a9c98f389d2ea63a3e549d31acf', '00edfa82f07d503928d6a13752603ee9676df6b724d67fa2cc9d35e2354299e2', '53d7229633f411963d9f33760dff3f532c554c41cc4c996cdb0f6ed56d342053', 131, 104658, 0, 29947224183861, 0, 101082, 1, 0, 1, 1, '', 7, '2018-06-20 04:41:31');
--
-- Constraints for dumped tables

@ -521,7 +521,7 @@ MysqlTransactions::get_total_recieved(const uint64_t& account_id)
{
StoreQueryResult sqr = query.store(account_id);
if (!sqr)
if (sqr.empty())
return 0;
Row row = sqr.at(0);

@ -29,12 +29,16 @@ using namespace epee::string_tools;
string tx_hash_str = pod_to_hex(tx_hash); \
string tx_prefix_hash_str = pod_to_hex(tx_prefix_hash);
#define TX_AND_ACC_FROM_HEX(HEX_TX, HEX_ACC_ADDR) \
TX_FROM_HEX(HEX_TX) \
#define ACC_FROM_HEX(hex_address) \
xmreg::XmrAccount acc; \
ASSERT_TRUE(xmr_accounts->select(HEX_ACC_ADDR, acc));
ASSERT_TRUE(xmr_accounts->select(hex_address, acc));
/**
#define TX_AND_ACC_FROM_HEX(hex_tx, hex_address) \
TX_FROM_HEX(hex_tx); \
ACC_FROM_HEX(hex_address);
/**
* Fixture that connects to openmonero_test database
* and repopulates it with known data for each test.
*/
@ -143,11 +147,7 @@ TEST_F(MYSQL_TEST, GetAccount)
// existing address
string xmr_addr{"57Hx8QpLUSMjhgoCNkvJ2Ch91mVyxcffESCprnRPrtbphMCv8iGUEfCUJxrpUWUeWrS9vPWnFrnMmTwnFpSKJrSKNuaXc5q"};
xmreg::XmrAccount acc;
bool is_success = xmr_accounts->select(xmr_addr, acc);
EXPECT_TRUE(is_success);
ACC_FROM_HEX(xmr_addr);
EXPECT_EQ(acc.id, 129);
EXPECT_EQ(acc.scanned_block_height, 101610);
@ -275,7 +275,6 @@ string addres_of_different_acc {"57hGLsqr6eLjUDoqWwP3Ko9nCJ4GFN5AyezdxNXwpa1PMt6
TEST_F(MYSQL_TEST, TryInsertingExistingTxToSameAccount)
{
// we should not be able to insert same tx twice for the same account
TX_AND_ACC_FROM_HEX(tx_fc4_hex, owner_addr_5Ajfk);
@ -387,7 +386,40 @@ TEST_F(MYSQL_TEST, MarkTxSpendableAndNonSpendable)
EXPECT_TRUE(static_cast<bool>(tx_data.spendable));
}
// seed fall lava tudor nucleus hemlock afar tuition poaching waffle palace roped nifty wipeout fierce mystery thumbs hubcaps toffee maps etiquette jolted symptoms winter abyss fall
string addr_55Zb {"55ZbQdMnZHPFS8pmrhHN5jMpgJwnnTXpTDmmM5wkrBBx4xD6aEnpZq7dPkeDeWs67TV9HunDQtT3qF2UGYWzGGxq3zYWCBE"};
TEST_F(MYSQL_TEST, GetTotalRecievedByAnAddress)
{
// this will include all change as well. So its not the same
// as balance in the monero wallet, but more like a balance
// in a viewonly wallet.
ACC_FROM_HEX(owner_addr_5Ajfk);
uint64_t total_recieved = xmr_accounts->get_total_recieved(acc.id);
// the exected value obtained using viewonly wallet
EXPECT_EQ(total_recieved, 697348926585540ull);
ASSERT_TRUE(xmr_accounts->select(addr_55Zb, acc));
total_recieved = xmr_accounts->get_total_recieved(acc.id);
//cout << "\n\ntotal_recieved " << total_recieved << '\n';
// the expected value obtained using viewonly wallet
// the balanace is for regular address and does not include sub-addresses
EXPECT_EQ(total_recieved, 1046498996045077ull);
// total for an non-existing address should be 0.
uint64_t non_existing_acc_id {5444444444};
total_recieved = xmr_accounts->get_total_recieved(non_existing_acc_id);
EXPECT_EQ(total_recieved, 0);
}
//TEST(TEST_CHAIN, GenerateTestChain)
//{

Loading…
Cancel
Save