From 079fbd3d42f74d9bdc268c83677878b9ac5c1047 Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Tue, 5 Apr 2016 15:24:44 +0300 Subject: Wallet::createTransaction API introduced --- tests/libwallet_api_tests/main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests/libwallet_api_tests') diff --git a/tests/libwallet_api_tests/main.cpp b/tests/libwallet_api_tests/main.cpp index 970d9a74e..f073b47b9 100644 --- a/tests/libwallet_api_tests/main.cpp +++ b/tests/libwallet_api_tests/main.cpp @@ -264,14 +264,20 @@ TEST_F(WalletManagerTest, WalletRefresh) ASSERT_TRUE(wmgr->closeWallet(wallet1)); } -TEST_F(WalletManagerTest, WalletTransfer) +TEST_F(WalletManagerTest, WalletTransaction) { Bitmonero::Wallet * wallet1 = wmgr->openWallet(TESTNET_WALLET_NAME, TESTNET_WALLET_PASS, true); // make sure testnet daemon is running ASSERT_TRUE(wallet1->init(TESTNET_DAEMON_ADDRESS, 0)); ASSERT_TRUE(wallet1->refresh()); uint64_t balance = wallet1->balance(); - ASSERT_TRUE(wallet1->transfer(RECIPIENT_WALLET_ADDRESS, AMOUNT_10XMR)); + + Bitmonero::Transaction * transaction = wallet1->createTransaction( + RECIPIENT_WALLET_ADDRESS, AMOUNT_10XMR); + ASSERT_TRUE(transaction->status() == Bitmonero::Transaction::Status_Ok); + + ASSERT_TRUE(wallet1->balance() == balance); + ASSERT_TRUE(transaction->commit()); ASSERT_FALSE(wallet1->balance() == balance); ASSERT_TRUE(wmgr->closeWallet(wallet1)); } -- cgit v1.2.3