mirror of
https://github.com/monero-project/monero.git
synced 2025-05-03 04:44:51 -04:00
Wallet::createTransaction API introduced
Transaction API continued TODOs for Transaction/Transfer interface
This commit is contained in:
parent
7c51227f88
commit
951f3b5d83
3 changed files with 238 additions and 148 deletions
|
@ -264,14 +264,22 @@ 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));
|
||||
ASSERT_TRUE(wallet1->status() == Bitmonero::PendingTransaction::Status_Ok);
|
||||
|
||||
Bitmonero::PendingTransaction * transaction = wallet1->createTransaction(
|
||||
RECIPIENT_WALLET_ADDRESS, AMOUNT_10XMR);
|
||||
ASSERT_TRUE(transaction->status() == Bitmonero::PendingTransaction::Status_Ok);
|
||||
|
||||
ASSERT_TRUE(wallet1->balance() == balance);
|
||||
ASSERT_TRUE(transaction->amount() == AMOUNT_10XMR);
|
||||
ASSERT_TRUE(transaction->commit());
|
||||
ASSERT_FALSE(wallet1->balance() == balance);
|
||||
ASSERT_TRUE(wmgr->closeWallet(wallet1));
|
||||
}
|
||||
|
@ -280,7 +288,7 @@ TEST_F(WalletManagerTest, WalletTransfer)
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
//epee::debug::get_set_enable_assert(true, false);
|
||||
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue