本文整理汇总了C++中TestTransactionBuilder::addInput方法的典型用法代码示例。如果您正苦于以下问题:C++ TestTransactionBuilder::addInput方法的具体用法?C++ TestTransactionBuilder::addInput怎么用?C++ TestTransactionBuilder::addInput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestTransactionBuilder
的用法示例。
在下文中一共展示了TestTransactionBuilder::addInput方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addTransaction
TEST_F(TransfersContainer_deleteUnconfirmedTransaction, deleteUnconfirmedSpendingTx) {
addTransaction(TEST_BLOCK_HEIGHT);
container.advanceHeight(TEST_BLOCK_HEIGHT + TEST_TRANSACTION_SPENDABLE_AGE);
ASSERT_EQ(1, container.transactionsCount());
ASSERT_EQ(TEST_OUTPUT_AMOUNT, container.balance(ITransfersContainer::IncludeAllUnlocked));
std::vector<TransactionOutputInformation> transfers;
container.getOutputs(transfers, ITransfersContainer::IncludeAllUnlocked);
ASSERT_EQ(1, transfers.size());
TestTransactionBuilder spendingTx;
spendingTx.addInput(account, transfers[0]);
spendingTx.addTestKeyOutput(TEST_OUTPUT_AMOUNT - 1, UNCONFIRMED_TRANSACTION_GLOBAL_OUTPUT_INDEX);
auto tx = spendingTx.build();
{
CryptoNote::TransactionBlockInfo blockInfo{ WALLET_LEGACY_UNCONFIRMED_TRANSACTION_HEIGHT, 1000000 };
ASSERT_TRUE(container.addTransaction(blockInfo, *tx, {}));
}
ASSERT_EQ(2, container.transactionsCount());
ASSERT_EQ(0, container.balance(ITransfersContainer::IncludeAllUnlocked));
ASSERT_TRUE(container.deleteUnconfirmedTransaction(tx->getTransactionHash()));
ASSERT_EQ(1, container.transactionsCount());
ASSERT_EQ(TEST_OUTPUT_AMOUNT, container.balance(ITransfersContainer::IncludeAllUnlocked));
}