Files
pay/testing/wallet/TestWallet.h
T

68 lines
1.7 KiB
C++
Raw Permalink Normal View History

2020-10-17 16:40:48 +02:00
/*
* This file is part of the Flowee project
2021-01-31 22:51:55 +01:00
* Copyright (C) 2020-2021 Tom Zander <tom@flowee.org>
2020-10-17 16:40:48 +02:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2020-10-17 16:38:37 +02:00
#ifndef TEST_WALLET_H
#define TEST_WALLET_H
#include <QString> // for Logging
2021-04-19 19:22:37 +02:00
#include <BlockHeader.h>
2020-10-17 16:38:37 +02:00
#include <QObject>
#include <utils/primitives/key.h>
struct ECC_State {
ECC_State() { ECC_Start(); }
~ECC_State() { ECC_Stop(); }
};
2021-04-19 19:22:37 +02:00
struct MockBlockHeader : public BlockHeader
{
MockBlockHeader();
};
2021-11-08 19:35:48 +01:00
class MockWallet;
2020-10-17 16:38:37 +02:00
class TestWallet : public QObject
{
Q_OBJECT
private slots:
void cleanup(); // called after each testcase.
void testRef();
2020-10-17 16:38:37 +02:00
void transactionOrdering();
void addingTransactions();
void lockingOutputs();
2021-11-01 14:15:16 +01:00
void testSpam();
void saveTransaction();
2020-11-06 22:15:03 +01:00
void saveTransaction2();
2021-01-31 22:51:55 +01:00
void findInputs();
2021-04-19 19:22:37 +02:00
void unconfirmed();
void hierarchicallyDeterministic();
2021-11-08 19:35:48 +01:00
void rejectTx();
2022-05-13 19:29:25 +02:00
void testEncryption1();
void testEncryption2();
void testEncryption3();
2022-05-13 19:29:25 +02:00
private:
2021-11-08 19:35:48 +01:00
std::unique_ptr<MockWallet> createWallet();
std::unique_ptr<MockWallet> openWallet(uint32_t encryptionSeed = 0);
QString m_dir;
const ECC_State m_state;
2020-10-17 16:38:37 +02:00
};
#endif