danicoin/tests/PerformanceTests/SingleTransactionTestBase.h

37 lines
894 B
C
Raw Normal View History

// Copyright (c) 2011-2016 The Cryptonote developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
2014-03-03 22:07:58 +00:00
#pragma once
2015-07-30 15:22:07 +00:00
#include "CryptoNoteCore/Account.h"
#include "CryptoNoteCore/CryptoNoteBasic.h"
#include "CryptoNoteCore/CryptoNoteFormatUtils.h"
2014-03-03 22:07:58 +00:00
2015-05-27 12:08:46 +00:00
#include <Logging/LoggerGroup.h>
2014-03-03 22:07:58 +00:00
class single_tx_test_base
{
public:
bool init()
{
2015-05-27 12:08:46 +00:00
using namespace CryptoNote;
2014-03-03 22:07:58 +00:00
2015-05-27 12:08:46 +00:00
Currency currency = CurrencyBuilder(m_nullLog).currency();
2014-03-03 22:07:58 +00:00
m_bob.generate();
2015-07-30 15:22:07 +00:00
if (!currency.constructMinerTx(0, 0, 0, 2, 0, m_bob.getAccountKeys().address, m_tx))
2014-03-03 22:07:58 +00:00
return false;
2015-07-30 15:22:07 +00:00
m_tx_pub_key = getTransactionPublicKeyFromExtra(m_tx.extra);
2014-03-03 22:07:58 +00:00
return true;
}
protected:
2015-05-27 12:08:46 +00:00
Logging::LoggerGroup m_nullLog;
2015-07-30 15:22:07 +00:00
CryptoNote::AccountBase m_bob;
2015-05-27 12:08:46 +00:00
CryptoNote::Transaction m_tx;
2015-07-30 15:22:07 +00:00
Crypto::PublicKey m_tx_pub_key;
2014-03-03 22:07:58 +00:00
};