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
|
|
|
|
|
|
2022-05-17 00:44:51 +02:00
|
|
|
#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>
|
|
|
|
|
|
2023-11-24 18:20:41 +01:00
|
|
|
#include <utils/primitives/PrivateKey.h>
|
2020-11-02 21:49:06 +01:00
|
|
|
|
|
|
|
|
struct ECC_State {
|
|
|
|
|
ECC_State() { ECC_Start(); }
|
|
|
|
|
~ECC_State() { ECC_Stop(); }
|
|
|
|
|
};
|
|
|
|
|
|
2021-11-08 19:35:48 +01:00
|
|
|
class MockWallet;
|
2020-11-02 21:49:06 +01:00
|
|
|
|
2020-10-17 16:38:37 +02:00
|
|
|
class TestWallet : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2023-04-04 13:36:07 +02:00
|
|
|
public:
|
|
|
|
|
TestWallet();
|
|
|
|
|
|
2020-10-17 16:38:37 +02:00
|
|
|
private slots:
|
2020-11-02 21:49:06 +01:00
|
|
|
void cleanup(); // called after each testcase.
|
2021-10-31 16:56:03 +01:00
|
|
|
void testRef();
|
2020-10-17 16:38:37 +02:00
|
|
|
void transactionOrdering();
|
2020-11-02 21:49:06 +01:00
|
|
|
void addingTransactions();
|
2023-04-04 13:36:07 +02:00
|
|
|
void addingTransactions2();
|
2021-11-08 15:24:48 +01:00
|
|
|
void lockingOutputs();
|
2021-11-01 14:15:16 +01:00
|
|
|
void testSpam();
|
2020-11-02 21:49:06 +01:00
|
|
|
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();
|
2021-11-08 15:24:48 +01:00
|
|
|
void hierarchicallyDeterministic();
|
2021-11-08 19:35:48 +01:00
|
|
|
void rejectTx();
|
2024-03-13 11:47:38 +01:00
|
|
|
void txVersion();
|
2021-11-08 19:35:48 +01:00
|
|
|
|
2022-05-13 19:29:25 +02:00
|
|
|
void testEncryption1();
|
2022-05-17 00:44:51 +02:00
|
|
|
void testEncryption2();
|
|
|
|
|
void testEncryption3();
|
2022-05-13 19:29:25 +02:00
|
|
|
|
2020-11-02 21:49:06 +01:00
|
|
|
private:
|
2021-11-08 19:35:48 +01:00
|
|
|
std::unique_ptr<MockWallet> createWallet();
|
2022-05-17 22:26:48 +02:00
|
|
|
std::unique_ptr<MockWallet> openWallet(uint32_t encryptionSeed = 0);
|
2020-11-02 21:49:06 +01:00
|
|
|
QString m_dir;
|
|
|
|
|
const ECC_State m_state;
|
2023-04-04 13:36:07 +02:00
|
|
|
const uint256 dummyBlockId;
|
2020-10-17 16:38:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|