Initial Vexta Core v0.1.0 release
This commit is contained in:
commit
25c454329d
2481 changed files with 689289 additions and 0 deletions
76
src/test/README.md
Normal file
76
src/test/README.md
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
# Unit tests
|
||||
|
||||
The sources in this directory are unit test cases. Boost includes a
|
||||
unit testing framework, and since DigiByte Core already uses Boost, it makes
|
||||
sense to simply use this framework rather than require developers to
|
||||
configure some other framework (we want as few impediments to creating
|
||||
unit tests as possible).
|
||||
|
||||
The build system is set up to compile an executable called `test_digibyte`
|
||||
that runs all of the unit tests. The main source file for the test library is found in
|
||||
`util/setup_common.cpp`.
|
||||
|
||||
### Compiling/running unit tests
|
||||
|
||||
Unit tests will be automatically compiled if dependencies were met in `./configure`
|
||||
and tests weren't explicitly disabled.
|
||||
|
||||
After configuring, they can be run with `make check`.
|
||||
|
||||
To run the unit tests manually, launch `src/test/test_digibyte`. To recompile
|
||||
after a test file was modified, run `make` and then run the test again. If you
|
||||
modify a non-test file, use `make -C src/test` to recompile only what's needed
|
||||
to run the unit tests.
|
||||
|
||||
To add more unit tests, add `BOOST_AUTO_TEST_CASE` functions to the existing
|
||||
.cpp files in the `test/` directory or add new .cpp files that
|
||||
implement new `BOOST_AUTO_TEST_SUITE` sections.
|
||||
|
||||
To run the GUI unit tests manually, launch `src/qt/test/test_vexta-qt`
|
||||
|
||||
To add more GUI unit tests, add them to the `src/qt/test/` directory and
|
||||
the `src/qt/test/test_main.cpp` file.
|
||||
|
||||
### Running individual tests
|
||||
|
||||
`test_digibyte` has some built-in command-line arguments; for
|
||||
example, to run just the `getarg_tests` verbosely:
|
||||
|
||||
test_digibyte --log_level=all --run_test=getarg_tests -- DEBUG_LOG_OUT
|
||||
|
||||
`log_level` controls the verbosity of the test framework, which logs when a
|
||||
test case is entered, for example. The `DEBUG_LOG_OUT` after the two dashes
|
||||
redirects the debug log, which would normally go to a file in the test datadir
|
||||
(`BasicTestingSetup::m_path_root`), to the standard terminal output.
|
||||
|
||||
... or to run just the doubledash test:
|
||||
|
||||
test_digibyte --run_test=getarg_tests/doubledash
|
||||
|
||||
Run `test_digibyte --help` for the full list.
|
||||
|
||||
### Adding test cases
|
||||
|
||||
To add a new unit test file to our test suite you need
|
||||
to add the file to `src/Makefile.test.include`. The pattern is to create
|
||||
one test file for each class or source file for which you want to create
|
||||
unit tests. The file naming convention is `<source_filename>_tests.cpp`
|
||||
and such files should wrap their tests in a test suite
|
||||
called `<source_filename>_tests`. For an example of this pattern,
|
||||
see `uint256_tests.cpp`.
|
||||
|
||||
### Logging and debugging in unit tests
|
||||
|
||||
`make check` will write to a log file `foo_tests.cpp.log` and display this file
|
||||
on failure. For running individual tests verbosely, refer to the section
|
||||
[above](#running-individual-tests).
|
||||
|
||||
To write to logs from unit tests you need to use specific message methods
|
||||
provided by Boost. The simplest is `BOOST_TEST_MESSAGE`.
|
||||
|
||||
For debugging you can launch the `test_digibyte` executable with `gdb`or `lldb` and
|
||||
start debugging, just like you would with any other program:
|
||||
|
||||
```bash
|
||||
gdb src/test/test_digibyte
|
||||
```
|
||||
978
src/test/addrman_tests.cpp
Normal file
978
src/test/addrman_tests.cpp
Normal file
|
|
@ -0,0 +1,978 @@
|
|||
// Copyright (c) 2009-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#include <addrman.h>
|
||||
#include <string>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
// Copyright (c) 2012-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#include <addrman.h>
|
||||
#include <test/data/asmap.raw.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <util/asmap.h>
|
||||
#include <util/string.h>
|
||||
#include <hash.h>
|
||||
#include <netbase.h>
|
||||
#include <random.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
class CAddrManTest : public CAddrMan
|
||||
{
|
||||
private:
|
||||
bool deterministic;
|
||||
public:
|
||||
explicit CAddrManTest(bool makeDeterministic = true,
|
||||
std::vector<bool> asmap = std::vector<bool>())
|
||||
{
|
||||
if (makeDeterministic) {
|
||||
// Set addrman addr placement to be deterministic.
|
||||
MakeDeterministic();
|
||||
}
|
||||
deterministic = makeDeterministic;
|
||||
m_asmap = asmap;
|
||||
}
|
||||
|
||||
//! Ensure that bucket placement is always the same for testing purposes.
|
||||
void MakeDeterministic()
|
||||
{
|
||||
nKey.SetNull();
|
||||
insecure_rand = FastRandomContext(true);
|
||||
}
|
||||
|
||||
CAddrInfo* Find(const CNetAddr& addr, int* pnId = nullptr)
|
||||
{
|
||||
LOCK(cs);
|
||||
return CAddrMan::Find(addr, pnId);
|
||||
}
|
||||
|
||||
CAddrInfo* Create(const CAddress& addr, const CNetAddr& addrSource, int* pnId = nullptr)
|
||||
{
|
||||
LOCK(cs);
|
||||
return CAddrMan::Create(addr, addrSource, pnId);
|
||||
}
|
||||
|
||||
void Delete(int nId)
|
||||
{
|
||||
LOCK(cs);
|
||||
CAddrMan::Delete(nId);
|
||||
}
|
||||
|
||||
// Used to test deserialization
|
||||
std::pair<int, int> GetBucketAndEntry(const CAddress& addr)
|
||||
{
|
||||
LOCK(cs);
|
||||
int nId = mapAddr[addr];
|
||||
for (int bucket = 0; bucket < ADDRMAN_NEW_BUCKET_COUNT; ++bucket) {
|
||||
for (int entry = 0; entry < ADDRMAN_BUCKET_SIZE; ++entry) {
|
||||
if (nId == vvNew[bucket][entry]) {
|
||||
return std::pair<int, int>(bucket, entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
return std::pair<int, int>(-1, -1);
|
||||
}
|
||||
|
||||
// Simulates connection failure so that we can test eviction of offline nodes
|
||||
void SimConnFail(const CService& addr)
|
||||
{
|
||||
int64_t nLastSuccess = 1;
|
||||
// Set last good connection in the deep past.
|
||||
Good(addr, true, nLastSuccess);
|
||||
|
||||
bool count_failure = false;
|
||||
int64_t nLastTry = GetAdjustedTime()-61;
|
||||
Attempt(addr, count_failure, nLastTry);
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
CAddrMan::Clear();
|
||||
if (deterministic) {
|
||||
nKey.SetNull();
|
||||
insecure_rand = FastRandomContext(true);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static CNetAddr ResolveIP(const std::string& ip)
|
||||
{
|
||||
CNetAddr addr;
|
||||
BOOST_CHECK_MESSAGE(LookupHost(ip, addr, false), strprintf("failed to resolve: %s", ip));
|
||||
return addr;
|
||||
}
|
||||
|
||||
static CService ResolveService(const std::string& ip, uint16_t port = 0)
|
||||
{
|
||||
CService serv;
|
||||
BOOST_CHECK_MESSAGE(Lookup(ip, serv, port, false), strprintf("failed to resolve: %s:%i", ip, port));
|
||||
return serv;
|
||||
}
|
||||
|
||||
|
||||
static std::vector<bool> FromBytes(const unsigned char* source, int vector_size) {
|
||||
std::vector<bool> result(vector_size);
|
||||
for (int byte_i = 0; byte_i < vector_size / 8; ++byte_i) {
|
||||
unsigned char cur_byte = source[byte_i];
|
||||
for (int bit_i = 0; bit_i < 8; ++bit_i) {
|
||||
result[byte_i * 8 + bit_i] = (cur_byte >> bit_i) & 1;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(addrman_tests, BasicTestingSetup)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addrman_simple)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
CNetAddr source = ResolveIP("252.2.2.2");
|
||||
|
||||
// Test: Does Addrman respond correctly when empty.
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 0U);
|
||||
CAddrInfo addr_null = addrman.Select();
|
||||
BOOST_CHECK_EQUAL(addr_null.ToString(), "[::]:0");
|
||||
|
||||
// Test: Does Addrman::Add work as expected.
|
||||
CService addr1 = ResolveService("250.1.1.1", 8333);
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr1, NODE_NONE), source));
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 1U);
|
||||
CAddrInfo addr_ret1 = addrman.Select();
|
||||
BOOST_CHECK_EQUAL(addr_ret1.ToString(), "250.1.1.1:8333");
|
||||
|
||||
// Test: Does IP address deduplication work correctly.
|
||||
// Expected dup IP should not be added.
|
||||
CService addr1_dup = ResolveService("250.1.1.1", 8333);
|
||||
BOOST_CHECK(!addrman.Add(CAddress(addr1_dup, NODE_NONE), source));
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 1U);
|
||||
|
||||
|
||||
// Test: New table has one addr and we add a diff addr we should
|
||||
// have at least one addr.
|
||||
// Note that addrman's size cannot be tested reliably after insertion, as
|
||||
// hash collisions may occur. But we can always be sure of at least one
|
||||
// success.
|
||||
|
||||
CService addr2 = ResolveService("250.1.1.2", 8333);
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr2, NODE_NONE), source));
|
||||
BOOST_CHECK(addrman.size() >= 1);
|
||||
|
||||
// Test: AddrMan::Clear() should empty the new table.
|
||||
addrman.Clear();
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 0U);
|
||||
CAddrInfo addr_null2 = addrman.Select();
|
||||
BOOST_CHECK_EQUAL(addr_null2.ToString(), "[::]:0");
|
||||
|
||||
// Test: AddrMan::Add multiple addresses works as expected
|
||||
std::vector<CAddress> vAddr;
|
||||
vAddr.push_back(CAddress(ResolveService("250.1.1.3", 8333), NODE_NONE));
|
||||
vAddr.push_back(CAddress(ResolveService("250.1.1.4", 8333), NODE_NONE));
|
||||
BOOST_CHECK(addrman.Add(vAddr, source));
|
||||
BOOST_CHECK(addrman.size() >= 1);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addrman_ports)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
CNetAddr source = ResolveIP("252.2.2.2");
|
||||
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 0U);
|
||||
|
||||
// Test 7; Addr with same IP but diff port does not replace existing addr.
|
||||
CService addr1 = ResolveService("250.1.1.1", 8333);
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr1, NODE_NONE), source));
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 1U);
|
||||
|
||||
CService addr1_port = ResolveService("250.1.1.1", 8334);
|
||||
BOOST_CHECK(!addrman.Add(CAddress(addr1_port, NODE_NONE), source));
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 1U);
|
||||
CAddrInfo addr_ret2 = addrman.Select();
|
||||
BOOST_CHECK_EQUAL(addr_ret2.ToString(), "250.1.1.1:8333");
|
||||
|
||||
// Test: Add same IP but diff port to tried table, it doesn't get added.
|
||||
// Perhaps this is not ideal behavior but it is the current behavior.
|
||||
addrman.Good(CAddress(addr1_port, NODE_NONE));
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 1U);
|
||||
bool newOnly = true;
|
||||
CAddrInfo addr_ret3 = addrman.Select(newOnly);
|
||||
BOOST_CHECK_EQUAL(addr_ret3.ToString(), "250.1.1.1:8333");
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addrman_select)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
CNetAddr source = ResolveIP("252.2.2.2");
|
||||
|
||||
// Test: Select from new with 1 addr in new.
|
||||
CService addr1 = ResolveService("250.1.1.1", 8333);
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr1, NODE_NONE), source));
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 1U);
|
||||
|
||||
bool newOnly = true;
|
||||
CAddrInfo addr_ret1 = addrman.Select(newOnly);
|
||||
BOOST_CHECK_EQUAL(addr_ret1.ToString(), "250.1.1.1:8333");
|
||||
|
||||
// Test: move addr to tried, select from new expected nothing returned.
|
||||
addrman.Good(CAddress(addr1, NODE_NONE));
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 1U);
|
||||
CAddrInfo addr_ret2 = addrman.Select(newOnly);
|
||||
BOOST_CHECK_EQUAL(addr_ret2.ToString(), "[::]:0");
|
||||
|
||||
CAddrInfo addr_ret3 = addrman.Select();
|
||||
BOOST_CHECK_EQUAL(addr_ret3.ToString(), "250.1.1.1:8333");
|
||||
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 1U);
|
||||
|
||||
|
||||
// Add three addresses to new table.
|
||||
CService addr2 = ResolveService("250.3.1.1", 8333);
|
||||
CService addr3 = ResolveService("250.3.2.2", 9999);
|
||||
CService addr4 = ResolveService("250.3.3.3", 9999);
|
||||
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr2, NODE_NONE), ResolveService("250.3.1.1", 8333)));
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr3, NODE_NONE), ResolveService("250.3.1.1", 8333)));
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr4, NODE_NONE), ResolveService("250.4.1.1", 8333)));
|
||||
|
||||
// Add three addresses to tried table.
|
||||
CService addr5 = ResolveService("250.4.4.4", 8333);
|
||||
CService addr6 = ResolveService("250.4.5.5", 7777);
|
||||
CService addr7 = ResolveService("250.4.6.6", 8333);
|
||||
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr5, NODE_NONE), ResolveService("250.3.1.1", 8333)));
|
||||
addrman.Good(CAddress(addr5, NODE_NONE));
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr6, NODE_NONE), ResolveService("250.3.1.1", 8333)));
|
||||
addrman.Good(CAddress(addr6, NODE_NONE));
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr7, NODE_NONE), ResolveService("250.1.1.3", 8333)));
|
||||
addrman.Good(CAddress(addr7, NODE_NONE));
|
||||
|
||||
// Test: 6 addrs + 1 addr from last test = 7.
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 7U);
|
||||
|
||||
// Test: Select pulls from new and tried regardless of port number.
|
||||
std::set<uint16_t> ports;
|
||||
for (int i = 0; i < 20; ++i) {
|
||||
ports.insert(addrman.Select().GetPort());
|
||||
}
|
||||
BOOST_CHECK_EQUAL(ports.size(), 3U);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addrman_new_collisions)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
CNetAddr source = ResolveIP("252.2.2.2");
|
||||
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 0U);
|
||||
|
||||
for (unsigned int i = 1; i < 18; i++) {
|
||||
CService addr = ResolveService("250.1.1." + ToString(i));
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr, NODE_NONE), source));
|
||||
|
||||
//Test: No collision in new table yet.
|
||||
BOOST_CHECK_EQUAL(addrman.size(), i);
|
||||
}
|
||||
|
||||
//Test: new table collision!
|
||||
CService addr1 = ResolveService("250.1.1.18");
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr1, NODE_NONE), source));
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 17U);
|
||||
|
||||
CService addr2 = ResolveService("250.1.1.19");
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr2, NODE_NONE), source));
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 18U);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addrman_tried_collisions)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
CNetAddr source = ResolveIP("252.2.2.2");
|
||||
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 0U);
|
||||
|
||||
for (unsigned int i = 1; i < 80; i++) {
|
||||
CService addr = ResolveService("250.1.1." + ToString(i));
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr, NODE_NONE), source));
|
||||
addrman.Good(CAddress(addr, NODE_NONE));
|
||||
|
||||
//Test: No collision in tried table yet.
|
||||
BOOST_CHECK_EQUAL(addrman.size(), i);
|
||||
}
|
||||
|
||||
//Test: tried table collision!
|
||||
CService addr1 = ResolveService("250.1.1.80");
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr1, NODE_NONE), source));
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 79U);
|
||||
|
||||
CService addr2 = ResolveService("250.1.1.81");
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr2, NODE_NONE), source));
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 80U);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addrman_find)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 0U);
|
||||
|
||||
CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8333), NODE_NONE);
|
||||
CAddress addr2 = CAddress(ResolveService("250.1.2.1", 9999), NODE_NONE);
|
||||
CAddress addr3 = CAddress(ResolveService("251.255.2.1", 8333), NODE_NONE);
|
||||
|
||||
CNetAddr source1 = ResolveIP("250.1.2.1");
|
||||
CNetAddr source2 = ResolveIP("250.1.2.2");
|
||||
|
||||
BOOST_CHECK(addrman.Add(addr1, source1));
|
||||
BOOST_CHECK(!addrman.Add(addr2, source2));
|
||||
BOOST_CHECK(addrman.Add(addr3, source1));
|
||||
|
||||
// Test: ensure Find returns an IP matching what we searched on.
|
||||
CAddrInfo* info1 = addrman.Find(addr1);
|
||||
BOOST_REQUIRE(info1);
|
||||
BOOST_CHECK_EQUAL(info1->ToString(), "250.1.2.1:8333");
|
||||
|
||||
// Test 18; Find does not discriminate by port number.
|
||||
CAddrInfo* info2 = addrman.Find(addr2);
|
||||
BOOST_REQUIRE(info2);
|
||||
BOOST_CHECK_EQUAL(info2->ToString(), info1->ToString());
|
||||
|
||||
// Test: Find returns another IP matching what we searched on.
|
||||
CAddrInfo* info3 = addrman.Find(addr3);
|
||||
BOOST_REQUIRE(info3);
|
||||
BOOST_CHECK_EQUAL(info3->ToString(), "251.255.2.1:8333");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addrman_create)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 0U);
|
||||
|
||||
CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8333), NODE_NONE);
|
||||
CNetAddr source1 = ResolveIP("250.1.2.1");
|
||||
|
||||
int nId;
|
||||
CAddrInfo* pinfo = addrman.Create(addr1, source1, &nId);
|
||||
|
||||
// Test: The result should be the same as the input addr.
|
||||
BOOST_CHECK_EQUAL(pinfo->ToString(), "250.1.2.1:8333");
|
||||
|
||||
CAddrInfo* info2 = addrman.Find(addr1);
|
||||
BOOST_CHECK_EQUAL(info2->ToString(), "250.1.2.1:8333");
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addrman_delete)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 0U);
|
||||
|
||||
CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8333), NODE_NONE);
|
||||
CNetAddr source1 = ResolveIP("250.1.2.1");
|
||||
|
||||
int nId;
|
||||
addrman.Create(addr1, source1, &nId);
|
||||
|
||||
// Test: Delete should actually delete the addr.
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 1U);
|
||||
addrman.Delete(nId);
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 0U);
|
||||
CAddrInfo* info2 = addrman.Find(addr1);
|
||||
BOOST_CHECK(info2 == nullptr);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addrman_getaddr)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
// Test: Sanity check, GetAddr should never return anything if addrman
|
||||
// is empty.
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 0U);
|
||||
std::vector<CAddress> vAddr1 = addrman.GetAddr(/* max_addresses */ 0, /* max_pct */ 0, /* network */ std::nullopt);
|
||||
BOOST_CHECK_EQUAL(vAddr1.size(), 0U);
|
||||
|
||||
CAddress addr1 = CAddress(ResolveService("250.250.2.1", 8333), NODE_NONE);
|
||||
addr1.nTime = GetAdjustedTime(); // Set time so isTerrible = false
|
||||
CAddress addr2 = CAddress(ResolveService("250.251.2.2", 9999), NODE_NONE);
|
||||
addr2.nTime = GetAdjustedTime();
|
||||
CAddress addr3 = CAddress(ResolveService("251.252.2.3", 8333), NODE_NONE);
|
||||
addr3.nTime = GetAdjustedTime();
|
||||
CAddress addr4 = CAddress(ResolveService("252.253.3.4", 8333), NODE_NONE);
|
||||
addr4.nTime = GetAdjustedTime();
|
||||
CAddress addr5 = CAddress(ResolveService("252.254.4.5", 8333), NODE_NONE);
|
||||
addr5.nTime = GetAdjustedTime();
|
||||
CNetAddr source1 = ResolveIP("250.1.2.1");
|
||||
CNetAddr source2 = ResolveIP("250.2.3.3");
|
||||
|
||||
// Test: Ensure GetAddr works with new addresses.
|
||||
BOOST_CHECK(addrman.Add(addr1, source1));
|
||||
BOOST_CHECK(addrman.Add(addr2, source2));
|
||||
BOOST_CHECK(addrman.Add(addr3, source1));
|
||||
BOOST_CHECK(addrman.Add(addr4, source2));
|
||||
BOOST_CHECK(addrman.Add(addr5, source1));
|
||||
|
||||
BOOST_CHECK_EQUAL(addrman.GetAddr(/* max_addresses */ 0, /* max_pct */ 0, /* network */ std::nullopt).size(), 5U);
|
||||
// Net processing asks for 23% of addresses. 23% of 5 is 1 rounded down.
|
||||
BOOST_CHECK_EQUAL(addrman.GetAddr(/* max_addresses */ 2500, /* max_pct */ 23, /* network */ std::nullopt).size(), 1U);
|
||||
|
||||
// Test: Ensure GetAddr works with new and tried addresses.
|
||||
addrman.Good(CAddress(addr1, NODE_NONE));
|
||||
addrman.Good(CAddress(addr2, NODE_NONE));
|
||||
BOOST_CHECK_EQUAL(addrman.GetAddr(/* max_addresses */ 0, /* max_pct */ 0, /* network */ std::nullopt).size(), 5U);
|
||||
BOOST_CHECK_EQUAL(addrman.GetAddr(/* max_addresses */ 2500, /* max_pct */ 23, /* network */ std::nullopt).size(), 1U);
|
||||
|
||||
// Test: Ensure GetAddr still returns 23% when addrman has many addrs.
|
||||
for (unsigned int i = 1; i < (8 * 256); i++) {
|
||||
int octet1 = i % 256;
|
||||
int octet2 = i >> 8 % 256;
|
||||
std::string strAddr = ToString(octet1) + "." + ToString(octet2) + ".1.23";
|
||||
CAddress addr = CAddress(ResolveService(strAddr), NODE_NONE);
|
||||
|
||||
// Ensure that for all addrs in addrman, isTerrible == false.
|
||||
addr.nTime = GetAdjustedTime();
|
||||
addrman.Add(addr, ResolveIP(strAddr));
|
||||
if (i % 8 == 0)
|
||||
addrman.Good(addr);
|
||||
}
|
||||
std::vector<CAddress> vAddr = addrman.GetAddr(/* max_addresses */ 2500, /* max_pct */ 23, /* network */ std::nullopt);
|
||||
|
||||
size_t percent23 = (addrman.size() * 23) / 100;
|
||||
BOOST_CHECK_EQUAL(vAddr.size(), percent23);
|
||||
BOOST_CHECK_EQUAL(vAddr.size(), 461U);
|
||||
// (Addrman.size() < number of addresses added) due to address collisions.
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 2006U);
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(caddrinfo_get_tried_bucket_legacy)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
CAddress addr1 = CAddress(ResolveService("250.1.1.1", 8333), NODE_NONE);
|
||||
CAddress addr2 = CAddress(ResolveService("250.1.1.1", 9999), NODE_NONE);
|
||||
|
||||
CNetAddr source1 = ResolveIP("250.1.1.1");
|
||||
|
||||
|
||||
CAddrInfo info1 = CAddrInfo(addr1, source1);
|
||||
|
||||
uint256 nKey1 = (uint256)(CHashWriter(SER_GETHASH, 0) << 1).GetHash();
|
||||
uint256 nKey2 = (uint256)(CHashWriter(SER_GETHASH, 0) << 2).GetHash();
|
||||
|
||||
std::vector<bool> asmap; // use /16
|
||||
|
||||
BOOST_CHECK_EQUAL(info1.GetTriedBucket(nKey1, asmap), 40);
|
||||
|
||||
// Test: Make sure key actually randomizes bucket placement. A fail on
|
||||
// this test could be a security issue.
|
||||
BOOST_CHECK(info1.GetTriedBucket(nKey1, asmap) != info1.GetTriedBucket(nKey2, asmap));
|
||||
|
||||
// Test: Two addresses with same IP but different ports can map to
|
||||
// different buckets because they have different keys.
|
||||
CAddrInfo info2 = CAddrInfo(addr2, source1);
|
||||
|
||||
BOOST_CHECK(info1.GetKey() != info2.GetKey());
|
||||
BOOST_CHECK(info1.GetTriedBucket(nKey1, asmap) != info2.GetTriedBucket(nKey1, asmap));
|
||||
|
||||
std::set<int> buckets;
|
||||
for (int i = 0; i < 255; i++) {
|
||||
CAddrInfo infoi = CAddrInfo(
|
||||
CAddress(ResolveService("250.1.1." + ToString(i)), NODE_NONE),
|
||||
ResolveIP("250.1.1." + ToString(i)));
|
||||
int bucket = infoi.GetTriedBucket(nKey1, asmap);
|
||||
buckets.insert(bucket);
|
||||
}
|
||||
// Test: IP addresses in the same /16 prefix should
|
||||
// never get more than 8 buckets with legacy grouping
|
||||
BOOST_CHECK_EQUAL(buckets.size(), 8U);
|
||||
|
||||
buckets.clear();
|
||||
for (int j = 0; j < 255; j++) {
|
||||
CAddrInfo infoj = CAddrInfo(
|
||||
CAddress(ResolveService("250." + ToString(j) + ".1.1"), NODE_NONE),
|
||||
ResolveIP("250." + ToString(j) + ".1.1"));
|
||||
int bucket = infoj.GetTriedBucket(nKey1, asmap);
|
||||
buckets.insert(bucket);
|
||||
}
|
||||
// Test: IP addresses in the different /16 prefix should map to more than
|
||||
// 8 buckets with legacy grouping
|
||||
BOOST_CHECK_EQUAL(buckets.size(), 160U);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(caddrinfo_get_new_bucket_legacy)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8333), NODE_NONE);
|
||||
CAddress addr2 = CAddress(ResolveService("250.1.2.1", 9999), NODE_NONE);
|
||||
|
||||
CNetAddr source1 = ResolveIP("250.1.2.1");
|
||||
|
||||
CAddrInfo info1 = CAddrInfo(addr1, source1);
|
||||
|
||||
uint256 nKey1 = (uint256)(CHashWriter(SER_GETHASH, 0) << 1).GetHash();
|
||||
uint256 nKey2 = (uint256)(CHashWriter(SER_GETHASH, 0) << 2).GetHash();
|
||||
|
||||
std::vector<bool> asmap; // use /16
|
||||
|
||||
// Test: Make sure the buckets are what we expect
|
||||
BOOST_CHECK_EQUAL(info1.GetNewBucket(nKey1, asmap), 786);
|
||||
BOOST_CHECK_EQUAL(info1.GetNewBucket(nKey1, source1, asmap), 786);
|
||||
|
||||
// Test: Make sure key actually randomizes bucket placement. A fail on
|
||||
// this test could be a security issue.
|
||||
BOOST_CHECK(info1.GetNewBucket(nKey1, asmap) != info1.GetNewBucket(nKey2, asmap));
|
||||
|
||||
// Test: Ports should not affect bucket placement in the addr
|
||||
CAddrInfo info2 = CAddrInfo(addr2, source1);
|
||||
BOOST_CHECK(info1.GetKey() != info2.GetKey());
|
||||
BOOST_CHECK_EQUAL(info1.GetNewBucket(nKey1, asmap), info2.GetNewBucket(nKey1, asmap));
|
||||
|
||||
std::set<int> buckets;
|
||||
for (int i = 0; i < 255; i++) {
|
||||
CAddrInfo infoi = CAddrInfo(
|
||||
CAddress(ResolveService("250.1.1." + ToString(i)), NODE_NONE),
|
||||
ResolveIP("250.1.1." + ToString(i)));
|
||||
int bucket = infoi.GetNewBucket(nKey1, asmap);
|
||||
buckets.insert(bucket);
|
||||
}
|
||||
// Test: IP addresses in the same group (\16 prefix for IPv4) should
|
||||
// always map to the same bucket.
|
||||
BOOST_CHECK_EQUAL(buckets.size(), 1U);
|
||||
|
||||
buckets.clear();
|
||||
for (int j = 0; j < 4 * 255; j++) {
|
||||
CAddrInfo infoj = CAddrInfo(CAddress(
|
||||
ResolveService(
|
||||
ToString(250 + (j / 255)) + "." + ToString(j % 256) + ".1.1"), NODE_NONE),
|
||||
ResolveIP("251.4.1.1"));
|
||||
int bucket = infoj.GetNewBucket(nKey1, asmap);
|
||||
buckets.insert(bucket);
|
||||
}
|
||||
// Test: IP addresses in the same source groups should map to NO MORE
|
||||
// than 64 buckets.
|
||||
BOOST_CHECK(buckets.size() <= 64);
|
||||
|
||||
buckets.clear();
|
||||
for (int p = 0; p < 255; p++) {
|
||||
CAddrInfo infoj = CAddrInfo(
|
||||
CAddress(ResolveService("250.1.1.1"), NODE_NONE),
|
||||
ResolveIP("250." + ToString(p) + ".1.1"));
|
||||
int bucket = infoj.GetNewBucket(nKey1, asmap);
|
||||
buckets.insert(bucket);
|
||||
}
|
||||
// Test: IP addresses in the different source groups should map to MORE
|
||||
// than 64 buckets.
|
||||
BOOST_CHECK(buckets.size() > 64);
|
||||
}
|
||||
|
||||
// The following three test cases use asmap.raw
|
||||
// We use an artificial minimal mock mapping
|
||||
// 250.0.0.0/8 AS1000
|
||||
// 101.1.0.0/16 AS1
|
||||
// 101.2.0.0/16 AS2
|
||||
// 101.3.0.0/16 AS3
|
||||
// 101.4.0.0/16 AS4
|
||||
// 101.5.0.0/16 AS5
|
||||
// 101.6.0.0/16 AS6
|
||||
// 101.7.0.0/16 AS7
|
||||
// 101.8.0.0/16 AS8
|
||||
BOOST_AUTO_TEST_CASE(caddrinfo_get_tried_bucket)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
CAddress addr1 = CAddress(ResolveService("250.1.1.1", 8333), NODE_NONE);
|
||||
CAddress addr2 = CAddress(ResolveService("250.1.1.1", 9999), NODE_NONE);
|
||||
|
||||
CNetAddr source1 = ResolveIP("250.1.1.1");
|
||||
|
||||
|
||||
CAddrInfo info1 = CAddrInfo(addr1, source1);
|
||||
|
||||
uint256 nKey1 = (uint256)(CHashWriter(SER_GETHASH, 0) << 1).GetHash();
|
||||
uint256 nKey2 = (uint256)(CHashWriter(SER_GETHASH, 0) << 2).GetHash();
|
||||
|
||||
std::vector<bool> asmap = FromBytes(asmap_raw, sizeof(asmap_raw) * 8);
|
||||
|
||||
BOOST_CHECK_EQUAL(info1.GetTriedBucket(nKey1, asmap), 236);
|
||||
|
||||
// Test: Make sure key actually randomizes bucket placement. A fail on
|
||||
// this test could be a security issue.
|
||||
BOOST_CHECK(info1.GetTriedBucket(nKey1, asmap) != info1.GetTriedBucket(nKey2, asmap));
|
||||
|
||||
// Test: Two addresses with same IP but different ports can map to
|
||||
// different buckets because they have different keys.
|
||||
CAddrInfo info2 = CAddrInfo(addr2, source1);
|
||||
|
||||
BOOST_CHECK(info1.GetKey() != info2.GetKey());
|
||||
BOOST_CHECK(info1.GetTriedBucket(nKey1, asmap) != info2.GetTriedBucket(nKey1, asmap));
|
||||
|
||||
std::set<int> buckets;
|
||||
for (int j = 0; j < 255; j++) {
|
||||
CAddrInfo infoj = CAddrInfo(
|
||||
CAddress(ResolveService("101." + ToString(j) + ".1.1"), NODE_NONE),
|
||||
ResolveIP("101." + ToString(j) + ".1.1"));
|
||||
int bucket = infoj.GetTriedBucket(nKey1, asmap);
|
||||
buckets.insert(bucket);
|
||||
}
|
||||
// Test: IP addresses in the different /16 prefix MAY map to more than
|
||||
// 8 buckets.
|
||||
BOOST_CHECK(buckets.size() > 8);
|
||||
|
||||
buckets.clear();
|
||||
for (int j = 0; j < 255; j++) {
|
||||
CAddrInfo infoj = CAddrInfo(
|
||||
CAddress(ResolveService("250." + ToString(j) + ".1.1"), NODE_NONE),
|
||||
ResolveIP("250." + ToString(j) + ".1.1"));
|
||||
int bucket = infoj.GetTriedBucket(nKey1, asmap);
|
||||
buckets.insert(bucket);
|
||||
}
|
||||
// Test: IP addresses in the different /16 prefix MAY NOT map to more than
|
||||
// 8 buckets.
|
||||
BOOST_CHECK(buckets.size() == 8);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(caddrinfo_get_new_bucket)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8333), NODE_NONE);
|
||||
CAddress addr2 = CAddress(ResolveService("250.1.2.1", 9999), NODE_NONE);
|
||||
|
||||
CNetAddr source1 = ResolveIP("250.1.2.1");
|
||||
|
||||
CAddrInfo info1 = CAddrInfo(addr1, source1);
|
||||
|
||||
uint256 nKey1 = (uint256)(CHashWriter(SER_GETHASH, 0) << 1).GetHash();
|
||||
uint256 nKey2 = (uint256)(CHashWriter(SER_GETHASH, 0) << 2).GetHash();
|
||||
|
||||
std::vector<bool> asmap = FromBytes(asmap_raw, sizeof(asmap_raw) * 8);
|
||||
|
||||
// Test: Make sure the buckets are what we expect
|
||||
BOOST_CHECK_EQUAL(info1.GetNewBucket(nKey1, asmap), 795);
|
||||
BOOST_CHECK_EQUAL(info1.GetNewBucket(nKey1, source1, asmap), 795);
|
||||
|
||||
// Test: Make sure key actually randomizes bucket placement. A fail on
|
||||
// this test could be a security issue.
|
||||
BOOST_CHECK(info1.GetNewBucket(nKey1, asmap) != info1.GetNewBucket(nKey2, asmap));
|
||||
|
||||
// Test: Ports should not affect bucket placement in the addr
|
||||
CAddrInfo info2 = CAddrInfo(addr2, source1);
|
||||
BOOST_CHECK(info1.GetKey() != info2.GetKey());
|
||||
BOOST_CHECK_EQUAL(info1.GetNewBucket(nKey1, asmap), info2.GetNewBucket(nKey1, asmap));
|
||||
|
||||
std::set<int> buckets;
|
||||
for (int i = 0; i < 255; i++) {
|
||||
CAddrInfo infoi = CAddrInfo(
|
||||
CAddress(ResolveService("250.1.1." + ToString(i)), NODE_NONE),
|
||||
ResolveIP("250.1.1." + ToString(i)));
|
||||
int bucket = infoi.GetNewBucket(nKey1, asmap);
|
||||
buckets.insert(bucket);
|
||||
}
|
||||
// Test: IP addresses in the same /16 prefix
|
||||
// usually map to the same bucket.
|
||||
BOOST_CHECK_EQUAL(buckets.size(), 1U);
|
||||
|
||||
buckets.clear();
|
||||
for (int j = 0; j < 4 * 255; j++) {
|
||||
CAddrInfo infoj = CAddrInfo(CAddress(
|
||||
ResolveService(
|
||||
ToString(250 + (j / 255)) + "." + ToString(j % 256) + ".1.1"), NODE_NONE),
|
||||
ResolveIP("251.4.1.1"));
|
||||
int bucket = infoj.GetNewBucket(nKey1, asmap);
|
||||
buckets.insert(bucket);
|
||||
}
|
||||
// Test: IP addresses in the same source /16 prefix should not map to more
|
||||
// than 64 buckets.
|
||||
BOOST_CHECK(buckets.size() <= 64);
|
||||
|
||||
buckets.clear();
|
||||
for (int p = 0; p < 255; p++) {
|
||||
CAddrInfo infoj = CAddrInfo(
|
||||
CAddress(ResolveService("250.1.1.1"), NODE_NONE),
|
||||
ResolveIP("101." + ToString(p) + ".1.1"));
|
||||
int bucket = infoj.GetNewBucket(nKey1, asmap);
|
||||
buckets.insert(bucket);
|
||||
}
|
||||
// Test: IP addresses in the different source /16 prefixes usually map to MORE
|
||||
// than 1 bucket.
|
||||
BOOST_CHECK(buckets.size() > 1);
|
||||
|
||||
buckets.clear();
|
||||
for (int p = 0; p < 255; p++) {
|
||||
CAddrInfo infoj = CAddrInfo(
|
||||
CAddress(ResolveService("250.1.1.1"), NODE_NONE),
|
||||
ResolveIP("250." + ToString(p) + ".1.1"));
|
||||
int bucket = infoj.GetNewBucket(nKey1, asmap);
|
||||
buckets.insert(bucket);
|
||||
}
|
||||
// Test: IP addresses in the different source /16 prefixes sometimes map to NO MORE
|
||||
// than 1 bucket.
|
||||
BOOST_CHECK(buckets.size() == 1);
|
||||
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addrman_serialization)
|
||||
{
|
||||
std::vector<bool> asmap1 = FromBytes(asmap_raw, sizeof(asmap_raw) * 8);
|
||||
|
||||
CAddrManTest addrman_asmap1(true, asmap1);
|
||||
CAddrManTest addrman_asmap1_dup(true, asmap1);
|
||||
CAddrManTest addrman_noasmap;
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
|
||||
CAddress addr = CAddress(ResolveService("250.1.1.1"), NODE_NONE);
|
||||
CNetAddr default_source;
|
||||
|
||||
|
||||
addrman_asmap1.Add(addr, default_source);
|
||||
|
||||
stream << addrman_asmap1;
|
||||
// serizalizing/deserializing addrman with the same asmap
|
||||
stream >> addrman_asmap1_dup;
|
||||
|
||||
std::pair<int, int> bucketAndEntry_asmap1 = addrman_asmap1.GetBucketAndEntry(addr);
|
||||
std::pair<int, int> bucketAndEntry_asmap1_dup = addrman_asmap1_dup.GetBucketAndEntry(addr);
|
||||
BOOST_CHECK(bucketAndEntry_asmap1.second != -1);
|
||||
BOOST_CHECK(bucketAndEntry_asmap1_dup.second != -1);
|
||||
|
||||
BOOST_CHECK(bucketAndEntry_asmap1.first == bucketAndEntry_asmap1_dup.first);
|
||||
BOOST_CHECK(bucketAndEntry_asmap1.second == bucketAndEntry_asmap1_dup.second);
|
||||
|
||||
// deserializing asmaped peers.dat to non-asmaped addrman
|
||||
stream << addrman_asmap1;
|
||||
stream >> addrman_noasmap;
|
||||
std::pair<int, int> bucketAndEntry_noasmap = addrman_noasmap.GetBucketAndEntry(addr);
|
||||
BOOST_CHECK(bucketAndEntry_noasmap.second != -1);
|
||||
BOOST_CHECK(bucketAndEntry_asmap1.first != bucketAndEntry_noasmap.first);
|
||||
BOOST_CHECK(bucketAndEntry_asmap1.second != bucketAndEntry_noasmap.second);
|
||||
|
||||
// deserializing non-asmaped peers.dat to asmaped addrman
|
||||
addrman_asmap1.Clear();
|
||||
addrman_noasmap.Clear();
|
||||
addrman_noasmap.Add(addr, default_source);
|
||||
stream << addrman_noasmap;
|
||||
stream >> addrman_asmap1;
|
||||
std::pair<int, int> bucketAndEntry_asmap1_deser = addrman_asmap1.GetBucketAndEntry(addr);
|
||||
BOOST_CHECK(bucketAndEntry_asmap1_deser.second != -1);
|
||||
BOOST_CHECK(bucketAndEntry_asmap1_deser.first != bucketAndEntry_noasmap.first);
|
||||
BOOST_CHECK(bucketAndEntry_asmap1_deser.first == bucketAndEntry_asmap1_dup.first);
|
||||
BOOST_CHECK(bucketAndEntry_asmap1_deser.second == bucketAndEntry_asmap1_dup.second);
|
||||
|
||||
// used to map to different buckets, now maps to the same bucket.
|
||||
addrman_asmap1.Clear();
|
||||
addrman_noasmap.Clear();
|
||||
CAddress addr1 = CAddress(ResolveService("250.1.1.1"), NODE_NONE);
|
||||
CAddress addr2 = CAddress(ResolveService("250.2.1.1"), NODE_NONE);
|
||||
addrman_noasmap.Add(addr, default_source);
|
||||
addrman_noasmap.Add(addr2, default_source);
|
||||
std::pair<int, int> bucketAndEntry_noasmap_addr1 = addrman_noasmap.GetBucketAndEntry(addr1);
|
||||
std::pair<int, int> bucketAndEntry_noasmap_addr2 = addrman_noasmap.GetBucketAndEntry(addr2);
|
||||
BOOST_CHECK(bucketAndEntry_noasmap_addr1.first != bucketAndEntry_noasmap_addr2.first);
|
||||
BOOST_CHECK(bucketAndEntry_noasmap_addr1.second != bucketAndEntry_noasmap_addr2.second);
|
||||
stream << addrman_noasmap;
|
||||
stream >> addrman_asmap1;
|
||||
std::pair<int, int> bucketAndEntry_asmap1_deser_addr1 = addrman_asmap1.GetBucketAndEntry(addr1);
|
||||
std::pair<int, int> bucketAndEntry_asmap1_deser_addr2 = addrman_asmap1.GetBucketAndEntry(addr2);
|
||||
BOOST_CHECK(bucketAndEntry_asmap1_deser_addr1.first == bucketAndEntry_asmap1_deser_addr2.first);
|
||||
BOOST_CHECK(bucketAndEntry_asmap1_deser_addr1.second != bucketAndEntry_asmap1_deser_addr2.second);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(remove_invalid)
|
||||
{
|
||||
// Confirm that invalid addresses are ignored in unserialization.
|
||||
|
||||
CAddrManTest addrman;
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
|
||||
const CAddress new1{ResolveService("5.5.5.5"), NODE_NONE};
|
||||
const CAddress new2{ResolveService("6.6.6.6"), NODE_NONE};
|
||||
const CAddress tried1{ResolveService("7.7.7.7"), NODE_NONE};
|
||||
const CAddress tried2{ResolveService("8.8.8.8"), NODE_NONE};
|
||||
|
||||
addrman.Add({new1, tried1, new2, tried2}, CNetAddr{});
|
||||
addrman.Good(tried1);
|
||||
addrman.Good(tried2);
|
||||
BOOST_REQUIRE_EQUAL(addrman.size(), 4);
|
||||
|
||||
stream << addrman;
|
||||
|
||||
const std::string str{stream.str()};
|
||||
size_t pos;
|
||||
|
||||
const char new2_raw[]{6, 6, 6, 6};
|
||||
const uint8_t new2_raw_replacement[]{0, 0, 0, 0}; // 0.0.0.0 is !IsValid()
|
||||
pos = str.find(new2_raw, 0, sizeof(new2_raw));
|
||||
BOOST_REQUIRE(pos != std::string::npos);
|
||||
BOOST_REQUIRE(pos + sizeof(new2_raw_replacement) <= stream.size());
|
||||
memcpy(stream.data() + pos, new2_raw_replacement, sizeof(new2_raw_replacement));
|
||||
|
||||
const char tried2_raw[]{8, 8, 8, 8};
|
||||
const uint8_t tried2_raw_replacement[]{255, 255, 255, 255}; // 255.255.255.255 is !IsValid()
|
||||
pos = str.find(tried2_raw, 0, sizeof(tried2_raw));
|
||||
BOOST_REQUIRE(pos != std::string::npos);
|
||||
BOOST_REQUIRE(pos + sizeof(tried2_raw_replacement) <= stream.size());
|
||||
memcpy(stream.data() + pos, tried2_raw_replacement, sizeof(tried2_raw_replacement));
|
||||
|
||||
addrman.Clear();
|
||||
stream >> addrman;
|
||||
BOOST_CHECK_EQUAL(addrman.size(), 2);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addrman_selecttriedcollision)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
BOOST_CHECK(addrman.size() == 0);
|
||||
|
||||
// Empty addrman should return blank addrman info.
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
|
||||
|
||||
// Add twenty two addresses.
|
||||
CNetAddr source = ResolveIP("252.2.2.2");
|
||||
for (unsigned int i = 1; i < 23; i++) {
|
||||
CService addr = ResolveService("250.1.1."+ToString(i));
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr, NODE_NONE), source));
|
||||
addrman.Good(addr);
|
||||
|
||||
// No collisions yet.
|
||||
BOOST_CHECK(addrman.size() == i);
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
|
||||
}
|
||||
|
||||
// Ensure Good handles duplicates well.
|
||||
for (unsigned int i = 1; i < 23; i++) {
|
||||
CService addr = ResolveService("250.1.1."+ToString(i));
|
||||
addrman.Good(addr);
|
||||
|
||||
BOOST_CHECK(addrman.size() == 22);
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addrman_noevict)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
// Add twenty two addresses.
|
||||
CNetAddr source = ResolveIP("252.2.2.2");
|
||||
for (unsigned int i = 1; i < 23; i++) {
|
||||
CService addr = ResolveService("250.1.1."+ToString(i));
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr, NODE_NONE), source));
|
||||
addrman.Good(addr);
|
||||
|
||||
// No collision yet.
|
||||
BOOST_CHECK(addrman.size() == i);
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
|
||||
}
|
||||
|
||||
// Collision between 23 and 19.
|
||||
CService addr23 = ResolveService("250.1.1.23");
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr23, NODE_NONE), source));
|
||||
addrman.Good(addr23);
|
||||
|
||||
BOOST_CHECK(addrman.size() == 23);
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "250.1.1.19:0");
|
||||
|
||||
// 23 should be discarded and 19 not evicted.
|
||||
addrman.ResolveCollisions();
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
|
||||
|
||||
// Lets create two collisions.
|
||||
for (unsigned int i = 24; i < 33; i++) {
|
||||
CService addr = ResolveService("250.1.1."+ToString(i));
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr, NODE_NONE), source));
|
||||
addrman.Good(addr);
|
||||
|
||||
BOOST_CHECK(addrman.size() == i);
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
|
||||
}
|
||||
|
||||
// Cause a collision.
|
||||
CService addr33 = ResolveService("250.1.1.33");
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr33, NODE_NONE), source));
|
||||
addrman.Good(addr33);
|
||||
BOOST_CHECK(addrman.size() == 33);
|
||||
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "250.1.1.27:0");
|
||||
|
||||
// Cause a second collision.
|
||||
BOOST_CHECK(!addrman.Add(CAddress(addr23, NODE_NONE), source));
|
||||
addrman.Good(addr23);
|
||||
BOOST_CHECK(addrman.size() == 33);
|
||||
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() != "[::]:0");
|
||||
addrman.ResolveCollisions();
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addrman_evictionworks)
|
||||
{
|
||||
CAddrManTest addrman;
|
||||
|
||||
BOOST_CHECK(addrman.size() == 0);
|
||||
|
||||
// Empty addrman should return blank addrman info.
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
|
||||
|
||||
// Add twenty two addresses.
|
||||
CNetAddr source = ResolveIP("252.2.2.2");
|
||||
for (unsigned int i = 1; i < 23; i++) {
|
||||
CService addr = ResolveService("250.1.1."+ToString(i));
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr, NODE_NONE), source));
|
||||
addrman.Good(addr);
|
||||
|
||||
// No collision yet.
|
||||
BOOST_CHECK(addrman.size() == i);
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
|
||||
}
|
||||
|
||||
// Collision between 23 and 19.
|
||||
CService addr = ResolveService("250.1.1.23");
|
||||
BOOST_CHECK(addrman.Add(CAddress(addr, NODE_NONE), source));
|
||||
addrman.Good(addr);
|
||||
|
||||
BOOST_CHECK(addrman.size() == 23);
|
||||
CAddrInfo info = addrman.SelectTriedCollision();
|
||||
BOOST_CHECK(info.ToString() == "250.1.1.19:0");
|
||||
|
||||
// Ensure test of address fails, so that it is evicted.
|
||||
addrman.SimConnFail(info);
|
||||
|
||||
// Should swap 23 for 19.
|
||||
addrman.ResolveCollisions();
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
|
||||
|
||||
// If 23 was swapped for 19, then this should cause no collisions.
|
||||
BOOST_CHECK(!addrman.Add(CAddress(addr, NODE_NONE), source));
|
||||
addrman.Good(addr);
|
||||
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
|
||||
|
||||
// If we insert 19 is should collide with 23.
|
||||
CService addr19 = ResolveService("250.1.1.19");
|
||||
BOOST_CHECK(!addrman.Add(CAddress(addr19, NODE_NONE), source));
|
||||
addrman.Good(addr19);
|
||||
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "250.1.1.23:0");
|
||||
|
||||
addrman.ResolveCollisions();
|
||||
BOOST_CHECK(addrman.SelectTriedCollision().ToString() == "[::]:0");
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
239
src/test/allocator_tests.cpp
Normal file
239
src/test/allocator_tests.cpp
Normal file
|
|
@ -0,0 +1,239 @@
|
|||
// Copyright (c) 2009-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <support/lockedpool.h>
|
||||
#include <util/system.h>
|
||||
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(allocator_tests)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(arena_tests)
|
||||
{
|
||||
// Fake memory base address for testing
|
||||
// without actually using memory.
|
||||
void *synth_base = reinterpret_cast<void*>(0x08000000);
|
||||
const size_t synth_size = 1024*1024;
|
||||
Arena b(synth_base, synth_size, 16);
|
||||
void *chunk = b.alloc(1000);
|
||||
#ifdef ARENA_DEBUG
|
||||
b.walk();
|
||||
#endif
|
||||
BOOST_CHECK(chunk != nullptr);
|
||||
BOOST_CHECK(b.stats().used == 1008); // Aligned to 16
|
||||
BOOST_CHECK(b.stats().total == synth_size); // Nothing has disappeared?
|
||||
b.free(chunk);
|
||||
#ifdef ARENA_DEBUG
|
||||
b.walk();
|
||||
#endif
|
||||
BOOST_CHECK(b.stats().used == 0);
|
||||
BOOST_CHECK(b.stats().free == synth_size);
|
||||
try { // Test exception on double-free
|
||||
b.free(chunk);
|
||||
BOOST_CHECK(0);
|
||||
} catch(std::runtime_error &)
|
||||
{
|
||||
}
|
||||
|
||||
void *a0 = b.alloc(128);
|
||||
void *a1 = b.alloc(256);
|
||||
void *a2 = b.alloc(512);
|
||||
BOOST_CHECK(b.stats().used == 896);
|
||||
BOOST_CHECK(b.stats().total == synth_size);
|
||||
#ifdef ARENA_DEBUG
|
||||
b.walk();
|
||||
#endif
|
||||
b.free(a0);
|
||||
#ifdef ARENA_DEBUG
|
||||
b.walk();
|
||||
#endif
|
||||
BOOST_CHECK(b.stats().used == 768);
|
||||
b.free(a1);
|
||||
BOOST_CHECK(b.stats().used == 512);
|
||||
void *a3 = b.alloc(128);
|
||||
#ifdef ARENA_DEBUG
|
||||
b.walk();
|
||||
#endif
|
||||
BOOST_CHECK(b.stats().used == 640);
|
||||
b.free(a2);
|
||||
BOOST_CHECK(b.stats().used == 128);
|
||||
b.free(a3);
|
||||
BOOST_CHECK(b.stats().used == 0);
|
||||
BOOST_CHECK_EQUAL(b.stats().chunks_used, 0U);
|
||||
BOOST_CHECK(b.stats().total == synth_size);
|
||||
BOOST_CHECK(b.stats().free == synth_size);
|
||||
BOOST_CHECK_EQUAL(b.stats().chunks_free, 1U);
|
||||
|
||||
std::vector<void*> addr;
|
||||
BOOST_CHECK(b.alloc(0) == nullptr); // allocating 0 always returns nullptr
|
||||
#ifdef ARENA_DEBUG
|
||||
b.walk();
|
||||
#endif
|
||||
// Sweeping allocate all memory
|
||||
for (int x=0; x<1024; ++x)
|
||||
addr.push_back(b.alloc(1024));
|
||||
BOOST_CHECK(b.stats().free == 0);
|
||||
BOOST_CHECK(b.alloc(1024) == nullptr); // memory is full, this must return nullptr
|
||||
BOOST_CHECK(b.alloc(0) == nullptr);
|
||||
for (int x=0; x<1024; ++x)
|
||||
b.free(addr[x]);
|
||||
addr.clear();
|
||||
BOOST_CHECK(b.stats().total == synth_size);
|
||||
BOOST_CHECK(b.stats().free == synth_size);
|
||||
|
||||
// Now in the other direction...
|
||||
for (int x=0; x<1024; ++x)
|
||||
addr.push_back(b.alloc(1024));
|
||||
for (int x=0; x<1024; ++x)
|
||||
b.free(addr[1023-x]);
|
||||
addr.clear();
|
||||
|
||||
// Now allocate in smaller unequal chunks, then deallocate haphazardly
|
||||
// Not all the chunks will succeed allocating, but freeing nullptr is
|
||||
// allowed so that is no problem.
|
||||
for (int x=0; x<2048; ++x)
|
||||
addr.push_back(b.alloc(x+1));
|
||||
for (int x=0; x<2048; ++x)
|
||||
b.free(addr[((x*23)%2048)^242]);
|
||||
addr.clear();
|
||||
|
||||
// Go entirely wild: free and alloc interleaved,
|
||||
// generate targets and sizes using pseudo-randomness.
|
||||
for (int x=0; x<2048; ++x)
|
||||
addr.push_back(nullptr);
|
||||
uint32_t s = 0x12345678;
|
||||
for (int x=0; x<5000; ++x) {
|
||||
int idx = s & (addr.size()-1);
|
||||
if (s & 0x80000000) {
|
||||
b.free(addr[idx]);
|
||||
addr[idx] = nullptr;
|
||||
} else if(!addr[idx]) {
|
||||
addr[idx] = b.alloc((s >> 16) & 2047);
|
||||
}
|
||||
bool lsb = s & 1;
|
||||
s >>= 1;
|
||||
if (lsb)
|
||||
s ^= 0xf00f00f0; // LFSR period 0xf7ffffe0
|
||||
}
|
||||
for (void *ptr: addr)
|
||||
b.free(ptr);
|
||||
addr.clear();
|
||||
|
||||
BOOST_CHECK(b.stats().total == synth_size);
|
||||
BOOST_CHECK(b.stats().free == synth_size);
|
||||
}
|
||||
|
||||
/** Mock LockedPageAllocator for testing */
|
||||
class TestLockedPageAllocator: public LockedPageAllocator
|
||||
{
|
||||
public:
|
||||
TestLockedPageAllocator(int count_in, int lockedcount_in): count(count_in), lockedcount(lockedcount_in) {}
|
||||
void* AllocateLocked(size_t len, bool *lockingSuccess) override
|
||||
{
|
||||
*lockingSuccess = false;
|
||||
if (count > 0) {
|
||||
--count;
|
||||
|
||||
if (lockedcount > 0) {
|
||||
--lockedcount;
|
||||
*lockingSuccess = true;
|
||||
}
|
||||
|
||||
return reinterpret_cast<void*>(uint64_t{static_cast<uint64_t>(0x08000000) + (count << 24)}); // Fake address, do not actually use this memory
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
void FreeLocked(void* addr, size_t len) override
|
||||
{
|
||||
}
|
||||
size_t GetLimit() override
|
||||
{
|
||||
return std::numeric_limits<size_t>::max();
|
||||
}
|
||||
private:
|
||||
int count;
|
||||
int lockedcount;
|
||||
};
|
||||
|
||||
BOOST_AUTO_TEST_CASE(lockedpool_tests_mock)
|
||||
{
|
||||
// Test over three virtual arenas, of which one will succeed being locked
|
||||
std::unique_ptr<LockedPageAllocator> x = std::make_unique<TestLockedPageAllocator>(3, 1);
|
||||
LockedPool pool(std::move(x));
|
||||
BOOST_CHECK(pool.stats().total == 0);
|
||||
BOOST_CHECK(pool.stats().locked == 0);
|
||||
|
||||
// Ensure unreasonable requests are refused without allocating anything
|
||||
void *invalid_toosmall = pool.alloc(0);
|
||||
BOOST_CHECK(invalid_toosmall == nullptr);
|
||||
BOOST_CHECK(pool.stats().used == 0);
|
||||
BOOST_CHECK(pool.stats().free == 0);
|
||||
void *invalid_toobig = pool.alloc(LockedPool::ARENA_SIZE+1);
|
||||
BOOST_CHECK(invalid_toobig == nullptr);
|
||||
BOOST_CHECK(pool.stats().used == 0);
|
||||
BOOST_CHECK(pool.stats().free == 0);
|
||||
|
||||
void *a0 = pool.alloc(LockedPool::ARENA_SIZE / 2);
|
||||
BOOST_CHECK(a0);
|
||||
BOOST_CHECK(pool.stats().locked == LockedPool::ARENA_SIZE);
|
||||
void *a1 = pool.alloc(LockedPool::ARENA_SIZE / 2);
|
||||
BOOST_CHECK(a1);
|
||||
void *a2 = pool.alloc(LockedPool::ARENA_SIZE / 2);
|
||||
BOOST_CHECK(a2);
|
||||
void *a3 = pool.alloc(LockedPool::ARENA_SIZE / 2);
|
||||
BOOST_CHECK(a3);
|
||||
void *a4 = pool.alloc(LockedPool::ARENA_SIZE / 2);
|
||||
BOOST_CHECK(a4);
|
||||
void *a5 = pool.alloc(LockedPool::ARENA_SIZE / 2);
|
||||
BOOST_CHECK(a5);
|
||||
// We've passed a count of three arenas, so this allocation should fail
|
||||
void *a6 = pool.alloc(16);
|
||||
BOOST_CHECK(!a6);
|
||||
|
||||
pool.free(a0);
|
||||
pool.free(a2);
|
||||
pool.free(a4);
|
||||
pool.free(a1);
|
||||
pool.free(a3);
|
||||
pool.free(a5);
|
||||
BOOST_CHECK(pool.stats().total == 3*LockedPool::ARENA_SIZE);
|
||||
BOOST_CHECK(pool.stats().locked == LockedPool::ARENA_SIZE);
|
||||
BOOST_CHECK(pool.stats().used == 0);
|
||||
}
|
||||
|
||||
// These tests used the live LockedPoolManager object, this is also used
|
||||
// by other tests so the conditions are somewhat less controllable and thus the
|
||||
// tests are somewhat more error-prone.
|
||||
BOOST_AUTO_TEST_CASE(lockedpool_tests_live)
|
||||
{
|
||||
LockedPoolManager &pool = LockedPoolManager::Instance();
|
||||
LockedPool::Stats initial = pool.stats();
|
||||
|
||||
void *a0 = pool.alloc(16);
|
||||
BOOST_CHECK(a0);
|
||||
// Test reading and writing the allocated memory
|
||||
*((uint32_t*)a0) = 0x1234;
|
||||
BOOST_CHECK(*((uint32_t*)a0) == 0x1234);
|
||||
|
||||
pool.free(a0);
|
||||
try { // Test exception on double-free
|
||||
pool.free(a0);
|
||||
BOOST_CHECK(0);
|
||||
} catch(std::runtime_error &)
|
||||
{
|
||||
}
|
||||
// If more than one new arena was allocated for the above tests, something is wrong
|
||||
BOOST_CHECK(pool.stats().total <= (initial.total + LockedPool::ARENA_SIZE));
|
||||
// Usage must be back to where it started
|
||||
BOOST_CHECK(pool.stats().used == initial.used);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
119
src/test/amount_tests.cpp
Normal file
119
src/test/amount_tests.cpp
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
// Copyright (c) 2016-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2016-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <amount.h>
|
||||
#include <policy/feerate.h>
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(amount_tests)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(MoneyRangeTest)
|
||||
{
|
||||
BOOST_CHECK_EQUAL(MoneyRange(CAmount(-1)), false);
|
||||
BOOST_CHECK_EQUAL(MoneyRange(CAmount(0)), true);
|
||||
BOOST_CHECK_EQUAL(MoneyRange(CAmount(1)), true);
|
||||
BOOST_CHECK_EQUAL(MoneyRange(MAX_MONEY), true);
|
||||
BOOST_CHECK_EQUAL(MoneyRange(MAX_MONEY + CAmount(1)), false);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(GetFeeTest)
|
||||
{
|
||||
CFeeRate feeRate, altFeeRate;
|
||||
|
||||
feeRate = CFeeRate(0);
|
||||
// Must always return 0
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(0), CAmount(0));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(1e5), CAmount(0));
|
||||
|
||||
feeRate = CFeeRate(1000);
|
||||
// Must always just return the arg
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(0), CAmount(0));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(1), CAmount(1));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(121), CAmount(121));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(999), CAmount(999));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(1e3), CAmount(1e3));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(9e3), CAmount(9e3));
|
||||
|
||||
feeRate = CFeeRate(-1000);
|
||||
// Must always just return -1 * arg
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(0), CAmount(0));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(1), CAmount(-1));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(121), CAmount(-121));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(999), CAmount(-999));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(1e3), CAmount(-1e3));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(9e3), CAmount(-9e3));
|
||||
|
||||
feeRate = CFeeRate(123);
|
||||
// Truncates the result, if not integer
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(0), CAmount(0));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(8), CAmount(1)); // Special case: returns 1 instead of 0
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(9), CAmount(2));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(121), CAmount(15));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(122), CAmount(16));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(999), CAmount(123));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(1e3), CAmount(123));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(9e3), CAmount(1107));
|
||||
|
||||
feeRate = CFeeRate(-123);
|
||||
// Truncates the result, if not integer
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(0), CAmount(0));
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(8), CAmount(-1)); // Special case: returns -1 instead of 0
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(9), CAmount(-1));
|
||||
|
||||
// check alternate constructor
|
||||
feeRate = CFeeRate(1000);
|
||||
altFeeRate = CFeeRate(feeRate);
|
||||
BOOST_CHECK_EQUAL(feeRate.GetFee(100), altFeeRate.GetFee(100));
|
||||
|
||||
// Check full constructor
|
||||
BOOST_CHECK(CFeeRate(CAmount(-1), 0) == CFeeRate(0));
|
||||
BOOST_CHECK(CFeeRate(CAmount(0), 0) == CFeeRate(0));
|
||||
BOOST_CHECK(CFeeRate(CAmount(1), 0) == CFeeRate(0));
|
||||
// default value
|
||||
BOOST_CHECK(CFeeRate(CAmount(-1), 1000) == CFeeRate(-1));
|
||||
BOOST_CHECK(CFeeRate(CAmount(0), 1000) == CFeeRate(0));
|
||||
BOOST_CHECK(CFeeRate(CAmount(1), 1000) == CFeeRate(1));
|
||||
// lost precision (can only resolve satoshis per kB)
|
||||
BOOST_CHECK(CFeeRate(CAmount(1), 1001) == CFeeRate(0));
|
||||
BOOST_CHECK(CFeeRate(CAmount(2), 1001) == CFeeRate(1));
|
||||
// some more integer checks
|
||||
BOOST_CHECK(CFeeRate(CAmount(26), 789) == CFeeRate(32));
|
||||
BOOST_CHECK(CFeeRate(CAmount(27), 789) == CFeeRate(34));
|
||||
// Maximum size in bytes, should not crash
|
||||
size_t MAX_MONEY2;
|
||||
MAX_MONEY2 = MAX_MONEY / 1000;
|
||||
CFeeRate(MAX_MONEY2, std::numeric_limits<uint32_t>::max()).GetFeePerK();
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(BinaryOperatorTest)
|
||||
{
|
||||
CFeeRate a, b;
|
||||
a = CFeeRate(1);
|
||||
b = CFeeRate(2);
|
||||
BOOST_CHECK(a < b);
|
||||
BOOST_CHECK(b > a);
|
||||
BOOST_CHECK(a == a);
|
||||
BOOST_CHECK(a <= b);
|
||||
BOOST_CHECK(a <= a);
|
||||
BOOST_CHECK(b >= a);
|
||||
BOOST_CHECK(b >= b);
|
||||
// a should be 0.00000002 VTX/kvB now
|
||||
a += a;
|
||||
BOOST_CHECK(a == b);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ToStringTest)
|
||||
{
|
||||
CFeeRate feeRate;
|
||||
feeRate = CFeeRate(1);
|
||||
BOOST_CHECK_EQUAL(feeRate.ToString(), "0.00000001 VTX/kvB");
|
||||
BOOST_CHECK_EQUAL(feeRate.ToString(FeeEstimateMode::DGB_KVB), "0.00000001 VTX/kvB");
|
||||
BOOST_CHECK_EQUAL(feeRate.ToString(FeeEstimateMode::SAT_VB), "0.001 sat/vB");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
613
src/test/arith_uint256_tests.cpp
Normal file
613
src/test/arith_uint256_tests.cpp
Normal file
|
|
@ -0,0 +1,613 @@
|
|||
// Copyright (c) 2009-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <arith_uint256.h>
|
||||
#include <uint256.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <version.h>
|
||||
#include <vector>
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(arith_uint256_tests)
|
||||
|
||||
/// Convert vector to arith_uint256, via uint256 blob
|
||||
static inline arith_uint256 arith_uint256V(const std::vector<unsigned char>& vch)
|
||||
{
|
||||
return UintToArith256(uint256(vch));
|
||||
}
|
||||
|
||||
const unsigned char R1Array[] =
|
||||
"\x9c\x52\x4a\xdb\xcf\x56\x11\x12\x2b\x29\x12\x5e\x5d\x35\xd2\xd2"
|
||||
"\x22\x81\xaa\xb5\x33\xf0\x08\x32\xd5\x56\xb1\xf9\xea\xe5\x1d\x7d";
|
||||
const char R1ArrayHex[] = "7D1DE5EAF9B156D53208F033B5AA8122D2d2355d5e12292b121156cfdb4a529c";
|
||||
const double R1Ldouble = 0.4887374590559308955; // R1L equals roughly R1Ldouble * 2^256
|
||||
const arith_uint256 R1L = arith_uint256V(std::vector<unsigned char>(R1Array,R1Array+32));
|
||||
const uint64_t R1LLow64 = 0x121156cfdb4a529cULL;
|
||||
|
||||
const unsigned char R2Array[] =
|
||||
"\x70\x32\x1d\x7c\x47\xa5\x6b\x40\x26\x7e\x0a\xc3\xa6\x9c\xb6\xbf"
|
||||
"\x13\x30\x47\xa3\x19\x2d\xda\x71\x49\x13\x72\xf0\xb4\xca\x81\xd7";
|
||||
const arith_uint256 R2L = arith_uint256V(std::vector<unsigned char>(R2Array,R2Array+32));
|
||||
|
||||
const char R1LplusR2L[] = "549FB09FEA236A1EA3E31D4D58F1B1369288D204211CA751527CFC175767850C";
|
||||
|
||||
const unsigned char ZeroArray[] =
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
const arith_uint256 ZeroL = arith_uint256V(std::vector<unsigned char>(ZeroArray,ZeroArray+32));
|
||||
|
||||
const unsigned char OneArray[] =
|
||||
"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
const arith_uint256 OneL = arith_uint256V(std::vector<unsigned char>(OneArray,OneArray+32));
|
||||
|
||||
const unsigned char MaxArray[] =
|
||||
"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
|
||||
"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff";
|
||||
const arith_uint256 MaxL = arith_uint256V(std::vector<unsigned char>(MaxArray,MaxArray+32));
|
||||
|
||||
const arith_uint256 HalfL = (OneL << 255);
|
||||
static std::string ArrayToString(const unsigned char A[], unsigned int width)
|
||||
{
|
||||
std::stringstream Stream;
|
||||
Stream << std::hex;
|
||||
for (unsigned int i = 0; i < width; ++i)
|
||||
{
|
||||
Stream<<std::setw(2)<<std::setfill('0')<<(unsigned int)A[width-i-1];
|
||||
}
|
||||
return Stream.str();
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( basics ) // constructors, equality, inequality
|
||||
{
|
||||
BOOST_CHECK(1 == 0+1);
|
||||
// constructor arith_uint256(vector<char>):
|
||||
BOOST_CHECK(R1L.ToString() == ArrayToString(R1Array,32));
|
||||
BOOST_CHECK(R2L.ToString() == ArrayToString(R2Array,32));
|
||||
BOOST_CHECK(ZeroL.ToString() == ArrayToString(ZeroArray,32));
|
||||
BOOST_CHECK(OneL.ToString() == ArrayToString(OneArray,32));
|
||||
BOOST_CHECK(MaxL.ToString() == ArrayToString(MaxArray,32));
|
||||
BOOST_CHECK(OneL.ToString() != ArrayToString(ZeroArray,32));
|
||||
|
||||
// == and !=
|
||||
BOOST_CHECK(R1L != R2L);
|
||||
BOOST_CHECK(ZeroL != OneL);
|
||||
BOOST_CHECK(OneL != ZeroL);
|
||||
BOOST_CHECK(MaxL != ZeroL);
|
||||
BOOST_CHECK(~MaxL == ZeroL);
|
||||
BOOST_CHECK( ((R1L ^ R2L) ^ R1L) == R2L);
|
||||
|
||||
uint64_t Tmp64 = 0xc4dab720d9c7acaaULL;
|
||||
for (unsigned int i = 0; i < 256; ++i)
|
||||
{
|
||||
BOOST_CHECK(ZeroL != (OneL << i));
|
||||
BOOST_CHECK((OneL << i) != ZeroL);
|
||||
BOOST_CHECK(R1L != (R1L ^ (OneL << i)));
|
||||
BOOST_CHECK(((arith_uint256(Tmp64) ^ (OneL << i) ) != Tmp64 ));
|
||||
}
|
||||
BOOST_CHECK(ZeroL == (OneL << 256));
|
||||
|
||||
// String Constructor and Copy Constructor
|
||||
BOOST_CHECK(arith_uint256("0x"+R1L.ToString()) == R1L);
|
||||
BOOST_CHECK(arith_uint256("0x"+R2L.ToString()) == R2L);
|
||||
BOOST_CHECK(arith_uint256("0x"+ZeroL.ToString()) == ZeroL);
|
||||
BOOST_CHECK(arith_uint256("0x"+OneL.ToString()) == OneL);
|
||||
BOOST_CHECK(arith_uint256("0x"+MaxL.ToString()) == MaxL);
|
||||
BOOST_CHECK(arith_uint256(R1L.ToString()) == R1L);
|
||||
BOOST_CHECK(arith_uint256(" 0x"+R1L.ToString()+" ") == R1L);
|
||||
BOOST_CHECK(arith_uint256("") == ZeroL);
|
||||
BOOST_CHECK(R1L == arith_uint256(R1ArrayHex));
|
||||
BOOST_CHECK(arith_uint256(R1L) == R1L);
|
||||
BOOST_CHECK((arith_uint256(R1L^R2L)^R2L) == R1L);
|
||||
BOOST_CHECK(arith_uint256(ZeroL) == ZeroL);
|
||||
BOOST_CHECK(arith_uint256(OneL) == OneL);
|
||||
|
||||
// uint64_t constructor
|
||||
BOOST_CHECK( (R1L & arith_uint256("0xffffffffffffffff")) == arith_uint256(R1LLow64));
|
||||
BOOST_CHECK(ZeroL == arith_uint256(0));
|
||||
BOOST_CHECK(OneL == arith_uint256(1));
|
||||
BOOST_CHECK(arith_uint256("0xffffffffffffffff") == arith_uint256(0xffffffffffffffffULL));
|
||||
|
||||
// Assignment (from base_uint)
|
||||
arith_uint256 tmpL = ~ZeroL; BOOST_CHECK(tmpL == ~ZeroL);
|
||||
tmpL = ~OneL; BOOST_CHECK(tmpL == ~OneL);
|
||||
tmpL = ~R1L; BOOST_CHECK(tmpL == ~R1L);
|
||||
tmpL = ~R2L; BOOST_CHECK(tmpL == ~R2L);
|
||||
tmpL = ~MaxL; BOOST_CHECK(tmpL == ~MaxL);
|
||||
}
|
||||
|
||||
static void shiftArrayRight(unsigned char* to, const unsigned char* from, unsigned int arrayLength, unsigned int bitsToShift)
|
||||
{
|
||||
for (unsigned int T=0; T < arrayLength; ++T)
|
||||
{
|
||||
unsigned int F = (T+bitsToShift/8);
|
||||
if (F < arrayLength)
|
||||
to[T] = from[F] >> (bitsToShift%8);
|
||||
else
|
||||
to[T] = 0;
|
||||
if (F + 1 < arrayLength)
|
||||
to[T] |= from[(F+1)] << (8-bitsToShift%8);
|
||||
}
|
||||
}
|
||||
|
||||
static void shiftArrayLeft(unsigned char* to, const unsigned char* from, unsigned int arrayLength, unsigned int bitsToShift)
|
||||
{
|
||||
for (unsigned int T=0; T < arrayLength; ++T)
|
||||
{
|
||||
if (T >= bitsToShift/8)
|
||||
{
|
||||
unsigned int F = T-bitsToShift/8;
|
||||
to[T] = from[F] << (bitsToShift%8);
|
||||
if (T >= bitsToShift/8+1)
|
||||
to[T] |= from[F-1] >> (8-bitsToShift%8);
|
||||
}
|
||||
else {
|
||||
to[T] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( shifts ) { // "<<" ">>" "<<=" ">>="
|
||||
unsigned char TmpArray[32];
|
||||
arith_uint256 TmpL;
|
||||
for (unsigned int i = 0; i < 256; ++i)
|
||||
{
|
||||
shiftArrayLeft(TmpArray, OneArray, 32, i);
|
||||
BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (OneL << i));
|
||||
TmpL = OneL; TmpL <<= i;
|
||||
BOOST_CHECK(TmpL == (OneL << i));
|
||||
BOOST_CHECK((HalfL >> (255-i)) == (OneL << i));
|
||||
TmpL = HalfL; TmpL >>= (255-i);
|
||||
BOOST_CHECK(TmpL == (OneL << i));
|
||||
|
||||
shiftArrayLeft(TmpArray, R1Array, 32, i);
|
||||
BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (R1L << i));
|
||||
TmpL = R1L; TmpL <<= i;
|
||||
BOOST_CHECK(TmpL == (R1L << i));
|
||||
|
||||
shiftArrayRight(TmpArray, R1Array, 32, i);
|
||||
BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (R1L >> i));
|
||||
TmpL = R1L; TmpL >>= i;
|
||||
BOOST_CHECK(TmpL == (R1L >> i));
|
||||
|
||||
shiftArrayLeft(TmpArray, MaxArray, 32, i);
|
||||
BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (MaxL << i));
|
||||
TmpL = MaxL; TmpL <<= i;
|
||||
BOOST_CHECK(TmpL == (MaxL << i));
|
||||
|
||||
shiftArrayRight(TmpArray, MaxArray, 32, i);
|
||||
BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (MaxL >> i));
|
||||
TmpL = MaxL; TmpL >>= i;
|
||||
BOOST_CHECK(TmpL == (MaxL >> i));
|
||||
}
|
||||
arith_uint256 c1L = arith_uint256(0x0123456789abcdefULL);
|
||||
arith_uint256 c2L = c1L << 128;
|
||||
for (unsigned int i = 0; i < 128; ++i) {
|
||||
BOOST_CHECK((c1L << i) == (c2L >> (128-i)));
|
||||
}
|
||||
for (unsigned int i = 128; i < 256; ++i) {
|
||||
BOOST_CHECK((c1L << i) == (c2L << (i-128)));
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( unaryOperators ) // ! ~ -
|
||||
{
|
||||
BOOST_CHECK(~ZeroL == MaxL);
|
||||
|
||||
unsigned char TmpArray[32];
|
||||
for (unsigned int i = 0; i < 32; ++i) { TmpArray[i] = ~R1Array[i]; }
|
||||
BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (~R1L));
|
||||
|
||||
BOOST_CHECK(-ZeroL == ZeroL);
|
||||
BOOST_CHECK(-R1L == (~R1L)+1);
|
||||
for (unsigned int i = 0; i < 256; ++i)
|
||||
BOOST_CHECK(-(OneL<<i) == (MaxL << i));
|
||||
}
|
||||
|
||||
|
||||
// Check if doing _A_ _OP_ _B_ results in the same as applying _OP_ onto each
|
||||
// element of Aarray and Barray, and then converting the result into an arith_uint256.
|
||||
#define CHECKBITWISEOPERATOR(_A_,_B_,_OP_) \
|
||||
for (unsigned int i = 0; i < 32; ++i) { TmpArray[i] = _A_##Array[i] _OP_ _B_##Array[i]; } \
|
||||
BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (_A_##L _OP_ _B_##L));
|
||||
|
||||
#define CHECKASSIGNMENTOPERATOR(_A_,_B_,_OP_) \
|
||||
TmpL = _A_##L; TmpL _OP_##= _B_##L; BOOST_CHECK(TmpL == (_A_##L _OP_ _B_##L));
|
||||
|
||||
BOOST_AUTO_TEST_CASE( bitwiseOperators )
|
||||
{
|
||||
unsigned char TmpArray[32];
|
||||
|
||||
CHECKBITWISEOPERATOR(R1,R2,|)
|
||||
CHECKBITWISEOPERATOR(R1,R2,^)
|
||||
CHECKBITWISEOPERATOR(R1,R2,&)
|
||||
CHECKBITWISEOPERATOR(R1,Zero,|)
|
||||
CHECKBITWISEOPERATOR(R1,Zero,^)
|
||||
CHECKBITWISEOPERATOR(R1,Zero,&)
|
||||
CHECKBITWISEOPERATOR(R1,Max,|)
|
||||
CHECKBITWISEOPERATOR(R1,Max,^)
|
||||
CHECKBITWISEOPERATOR(R1,Max,&)
|
||||
CHECKBITWISEOPERATOR(Zero,R1,|)
|
||||
CHECKBITWISEOPERATOR(Zero,R1,^)
|
||||
CHECKBITWISEOPERATOR(Zero,R1,&)
|
||||
CHECKBITWISEOPERATOR(Max,R1,|)
|
||||
CHECKBITWISEOPERATOR(Max,R1,^)
|
||||
CHECKBITWISEOPERATOR(Max,R1,&)
|
||||
|
||||
arith_uint256 TmpL;
|
||||
CHECKASSIGNMENTOPERATOR(R1,R2,|)
|
||||
CHECKASSIGNMENTOPERATOR(R1,R2,^)
|
||||
CHECKASSIGNMENTOPERATOR(R1,R2,&)
|
||||
CHECKASSIGNMENTOPERATOR(R1,Zero,|)
|
||||
CHECKASSIGNMENTOPERATOR(R1,Zero,^)
|
||||
CHECKASSIGNMENTOPERATOR(R1,Zero,&)
|
||||
CHECKASSIGNMENTOPERATOR(R1,Max,|)
|
||||
CHECKASSIGNMENTOPERATOR(R1,Max,^)
|
||||
CHECKASSIGNMENTOPERATOR(R1,Max,&)
|
||||
CHECKASSIGNMENTOPERATOR(Zero,R1,|)
|
||||
CHECKASSIGNMENTOPERATOR(Zero,R1,^)
|
||||
CHECKASSIGNMENTOPERATOR(Zero,R1,&)
|
||||
CHECKASSIGNMENTOPERATOR(Max,R1,|)
|
||||
CHECKASSIGNMENTOPERATOR(Max,R1,^)
|
||||
CHECKASSIGNMENTOPERATOR(Max,R1,&)
|
||||
|
||||
uint64_t Tmp64 = 0xe1db685c9a0b47a2ULL;
|
||||
TmpL = R1L; TmpL |= Tmp64; BOOST_CHECK(TmpL == (R1L | arith_uint256(Tmp64)));
|
||||
TmpL = R1L; TmpL |= 0; BOOST_CHECK(TmpL == R1L);
|
||||
TmpL ^= 0; BOOST_CHECK(TmpL == R1L);
|
||||
TmpL ^= Tmp64; BOOST_CHECK(TmpL == (R1L ^ arith_uint256(Tmp64)));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( comparison ) // <= >= < >
|
||||
{
|
||||
arith_uint256 TmpL;
|
||||
for (unsigned int i = 0; i < 256; ++i) {
|
||||
TmpL= OneL<< i;
|
||||
BOOST_CHECK( TmpL >= ZeroL && TmpL > ZeroL && ZeroL < TmpL && ZeroL <= TmpL);
|
||||
BOOST_CHECK( TmpL >= 0 && TmpL > 0 && 0 < TmpL && 0 <= TmpL);
|
||||
TmpL |= R1L;
|
||||
BOOST_CHECK( TmpL >= R1L ); BOOST_CHECK( (TmpL == R1L) != (TmpL > R1L)); BOOST_CHECK( (TmpL == R1L) || !( TmpL <= R1L));
|
||||
BOOST_CHECK( R1L <= TmpL ); BOOST_CHECK( (R1L == TmpL) != (R1L < TmpL)); BOOST_CHECK( (TmpL == R1L) || !( R1L >= TmpL));
|
||||
BOOST_CHECK(! (TmpL < R1L)); BOOST_CHECK(! (R1L > TmpL));
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( plusMinus )
|
||||
{
|
||||
arith_uint256 TmpL = 0;
|
||||
BOOST_CHECK(R1L+R2L == arith_uint256(R1LplusR2L));
|
||||
TmpL += R1L;
|
||||
BOOST_CHECK(TmpL == R1L);
|
||||
TmpL += R2L;
|
||||
BOOST_CHECK(TmpL == R1L + R2L);
|
||||
BOOST_CHECK(OneL+MaxL == ZeroL);
|
||||
BOOST_CHECK(MaxL+OneL == ZeroL);
|
||||
for (unsigned int i = 1; i < 256; ++i) {
|
||||
BOOST_CHECK( (MaxL >> i) + OneL == (HalfL >> (i-1)) );
|
||||
BOOST_CHECK( OneL + (MaxL >> i) == (HalfL >> (i-1)) );
|
||||
TmpL = (MaxL>>i); TmpL += OneL;
|
||||
BOOST_CHECK( TmpL == (HalfL >> (i-1)) );
|
||||
TmpL = (MaxL>>i); TmpL += 1;
|
||||
BOOST_CHECK( TmpL == (HalfL >> (i-1)) );
|
||||
TmpL = (MaxL>>i);
|
||||
BOOST_CHECK( TmpL++ == (MaxL>>i) );
|
||||
BOOST_CHECK( TmpL == (HalfL >> (i-1)));
|
||||
}
|
||||
BOOST_CHECK(arith_uint256(0xbedc77e27940a7ULL) + 0xee8d836fce66fbULL == arith_uint256(0xbedc77e27940a7ULL + 0xee8d836fce66fbULL));
|
||||
TmpL = arith_uint256(0xbedc77e27940a7ULL); TmpL += 0xee8d836fce66fbULL;
|
||||
BOOST_CHECK(TmpL == arith_uint256(0xbedc77e27940a7ULL+0xee8d836fce66fbULL));
|
||||
TmpL -= 0xee8d836fce66fbULL; BOOST_CHECK(TmpL == 0xbedc77e27940a7ULL);
|
||||
TmpL = R1L;
|
||||
BOOST_CHECK(++TmpL == R1L+1);
|
||||
|
||||
BOOST_CHECK(R1L -(-R2L) == R1L+R2L);
|
||||
BOOST_CHECK(R1L -(-OneL) == R1L+OneL);
|
||||
BOOST_CHECK(R1L - OneL == R1L+(-OneL));
|
||||
for (unsigned int i = 1; i < 256; ++i) {
|
||||
BOOST_CHECK((MaxL>>i) - (-OneL) == (HalfL >> (i-1)));
|
||||
BOOST_CHECK((HalfL >> (i-1)) - OneL == (MaxL>>i));
|
||||
TmpL = (HalfL >> (i-1));
|
||||
BOOST_CHECK(TmpL-- == (HalfL >> (i-1)));
|
||||
BOOST_CHECK(TmpL == (MaxL >> i));
|
||||
TmpL = (HalfL >> (i-1));
|
||||
BOOST_CHECK(--TmpL == (MaxL >> i));
|
||||
}
|
||||
TmpL = R1L;
|
||||
BOOST_CHECK(--TmpL == R1L-1);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( multiply )
|
||||
{
|
||||
BOOST_CHECK((R1L * R1L).ToString() == "62a38c0486f01e45879d7910a7761bf30d5237e9873f9bff3642a732c4d84f10");
|
||||
BOOST_CHECK((R1L * R2L).ToString() == "de37805e9986996cfba76ff6ba51c008df851987d9dd323f0e5de07760529c40");
|
||||
BOOST_CHECK((R1L * ZeroL) == ZeroL);
|
||||
BOOST_CHECK((R1L * OneL) == R1L);
|
||||
BOOST_CHECK((R1L * MaxL) == -R1L);
|
||||
BOOST_CHECK((R2L * R1L) == (R1L * R2L));
|
||||
BOOST_CHECK((R2L * R2L).ToString() == "ac8c010096767d3cae5005dec28bb2b45a1d85ab7996ccd3e102a650f74ff100");
|
||||
BOOST_CHECK((R2L * ZeroL) == ZeroL);
|
||||
BOOST_CHECK((R2L * OneL) == R2L);
|
||||
BOOST_CHECK((R2L * MaxL) == -R2L);
|
||||
|
||||
BOOST_CHECK(MaxL * MaxL == OneL);
|
||||
|
||||
BOOST_CHECK((R1L * 0) == 0);
|
||||
BOOST_CHECK((R1L * 1) == R1L);
|
||||
BOOST_CHECK((R1L * 3).ToString() == "7759b1c0ed14047f961ad09b20ff83687876a0181a367b813634046f91def7d4");
|
||||
BOOST_CHECK((R2L * 0x87654321UL).ToString() == "23f7816e30c4ae2017257b7a0fa64d60402f5234d46e746b61c960d09a26d070");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( divide )
|
||||
{
|
||||
arith_uint256 D1L("AD7133AC1977FA2B7");
|
||||
arith_uint256 D2L("ECD751716");
|
||||
BOOST_CHECK((R1L / D1L).ToString() == "00000000000000000b8ac01106981635d9ed112290f8895545a7654dde28fb3a");
|
||||
BOOST_CHECK((R1L / D2L).ToString() == "000000000873ce8efec5b67150bad3aa8c5fcb70e947586153bf2cec7c37c57a");
|
||||
BOOST_CHECK(R1L / OneL == R1L);
|
||||
BOOST_CHECK(R1L / MaxL == ZeroL);
|
||||
BOOST_CHECK(MaxL / R1L == 2);
|
||||
BOOST_CHECK_THROW(R1L / ZeroL, uint_error);
|
||||
BOOST_CHECK((R2L / D1L).ToString() == "000000000000000013e1665895a1cc981de6d93670105a6b3ec3b73141b3a3c5");
|
||||
BOOST_CHECK((R2L / D2L).ToString() == "000000000e8f0abe753bb0afe2e9437ee85d280be60882cf0bd1aaf7fa3cc2c4");
|
||||
BOOST_CHECK(R2L / OneL == R2L);
|
||||
BOOST_CHECK(R2L / MaxL == ZeroL);
|
||||
BOOST_CHECK(MaxL / R2L == 1);
|
||||
BOOST_CHECK_THROW(R2L / ZeroL, uint_error);
|
||||
|
||||
uint32_t nInts[4] = {1u, 0x88eu, 0x36cb6079u, 0xf6b4a385u};
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
BOOST_CHECK((R1L / nInts[i]) == (R1L / arith_uint256(nInts[i])));
|
||||
BOOST_CHECK((R2L / nInts[i]) == (R2L / arith_uint256(nInts[i])));
|
||||
BOOST_CHECK((MaxL / nInts[i]) == (MaxL / arith_uint256(nInts[i])));
|
||||
}
|
||||
BOOST_CHECK_THROW(R2L / 0, uint_error);
|
||||
}
|
||||
|
||||
void CheckNthRoot(arith_uint256 x, int n)
|
||||
{
|
||||
arith_uint256 root = x.ApproxNthRoot(n);
|
||||
arith_uint256 power = 1;
|
||||
arith_uint256 penultimate = 1;
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
penultimate = power;
|
||||
power *= root;
|
||||
}
|
||||
// second condition is overflow check
|
||||
BOOST_CHECK(power <= x && power / root == penultimate);
|
||||
int roundingPos = std::max<int>(0, root.bits() - 64/n);
|
||||
root += OneL << roundingPos;
|
||||
// root should be too big now
|
||||
power = 1;
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
penultimate = power;
|
||||
power *= root;
|
||||
}
|
||||
BOOST_CHECK(!(power <= x && power / root == penultimate));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( root )
|
||||
{
|
||||
for (int n = 2; n <= 5; n++)
|
||||
{
|
||||
BOOST_CHECK(ZeroL.ApproxNthRoot(n) == ZeroL);
|
||||
for (int shift = 0; shift < 2*n; shift++)
|
||||
{
|
||||
CheckNthRoot(MaxL >> shift, n);
|
||||
CheckNthRoot(R1L >> shift, n);
|
||||
CheckNthRoot(R2L >> shift, n);
|
||||
}
|
||||
for (int shift = 0; shift < 70; shift++)
|
||||
{
|
||||
CheckNthRoot(OneL << shift, n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool almostEqual(double d1, double d2)
|
||||
{
|
||||
return fabs(d1-d2) <= 4*fabs(d1)*std::numeric_limits<double>::epsilon();
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( methods ) // GetHex SetHex size() GetLow64 GetSerializeSize, Serialize, Unserialize
|
||||
{
|
||||
BOOST_CHECK(R1L.GetHex() == R1L.ToString());
|
||||
BOOST_CHECK(R2L.GetHex() == R2L.ToString());
|
||||
BOOST_CHECK(OneL.GetHex() == OneL.ToString());
|
||||
BOOST_CHECK(MaxL.GetHex() == MaxL.ToString());
|
||||
arith_uint256 TmpL(R1L);
|
||||
BOOST_CHECK(TmpL == R1L);
|
||||
TmpL.SetHex(R2L.ToString()); BOOST_CHECK(TmpL == R2L);
|
||||
TmpL.SetHex(ZeroL.ToString()); BOOST_CHECK(TmpL == 0);
|
||||
TmpL.SetHex(HalfL.ToString()); BOOST_CHECK(TmpL == HalfL);
|
||||
|
||||
TmpL.SetHex(R1L.ToString());
|
||||
BOOST_CHECK(R1L.size() == 32);
|
||||
BOOST_CHECK(R2L.size() == 32);
|
||||
BOOST_CHECK(ZeroL.size() == 32);
|
||||
BOOST_CHECK(MaxL.size() == 32);
|
||||
BOOST_CHECK(R1L.GetLow64() == R1LLow64);
|
||||
BOOST_CHECK(HalfL.GetLow64() ==0x0000000000000000ULL);
|
||||
BOOST_CHECK(OneL.GetLow64() ==0x0000000000000001ULL);
|
||||
|
||||
for (unsigned int i = 0; i < 255; ++i)
|
||||
{
|
||||
BOOST_CHECK((OneL << i).getdouble() == ldexp(1.0,i));
|
||||
}
|
||||
BOOST_CHECK(ZeroL.getdouble() == 0.0);
|
||||
for (int i = 256; i > 53; --i)
|
||||
BOOST_CHECK(almostEqual((R1L>>(256-i)).getdouble(), ldexp(R1Ldouble,i)));
|
||||
uint64_t R1L64part = (R1L>>192).GetLow64();
|
||||
for (int i = 53; i > 0; --i) // doubles can store all integers in {0,...,2^54-1} exactly
|
||||
{
|
||||
BOOST_CHECK((R1L>>(256-i)).getdouble() == (double)(R1L64part >> (64-i)));
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(bignum_SetCompact)
|
||||
{
|
||||
arith_uint256 num;
|
||||
bool fNegative;
|
||||
bool fOverflow;
|
||||
num.SetCompact(0, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x00123456, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x01003456, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x02000056, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x03000000, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x04000000, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x00923456, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x01803456, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x02800056, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x03800000, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x04800000, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000000");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x01123456, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000000012");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0x01120000U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
// Make sure that we don't generate compacts with the 0x00800000 bit set
|
||||
num = 0x80;
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0x02008000U);
|
||||
|
||||
num.SetCompact(0x01fedcba, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "000000000000000000000000000000000000000000000000000000000000007e");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(true), 0x01fe0000U);
|
||||
BOOST_CHECK_EQUAL(fNegative, true);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x02123456, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000001234");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0x02123400U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x03123456, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000000123456");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0x03123456U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x04123456, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000012345600");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0x04123456U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x04923456, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000012345600");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(true), 0x04923456U);
|
||||
BOOST_CHECK_EQUAL(fNegative, true);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x05009234, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "0000000000000000000000000000000000000000000000000000000092340000");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0x05009234U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0x20123456, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "1234560000000000000000000000000000000000000000000000000000000000");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0x20123456U);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, false);
|
||||
|
||||
num.SetCompact(0xff123456, &fNegative, &fOverflow);
|
||||
BOOST_CHECK_EQUAL(fNegative, false);
|
||||
BOOST_CHECK_EQUAL(fOverflow, true);
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE( getmaxcoverage ) // some more tests just to get 100% coverage
|
||||
{
|
||||
// ~R1L give a base_uint<256>
|
||||
BOOST_CHECK((~~R1L >> 10) == (R1L >> 10));
|
||||
BOOST_CHECK((~~R1L << 10) == (R1L << 10));
|
||||
BOOST_CHECK(!(~~R1L < R1L));
|
||||
BOOST_CHECK(~~R1L <= R1L);
|
||||
BOOST_CHECK(!(~~R1L > R1L));
|
||||
BOOST_CHECK(~~R1L >= R1L);
|
||||
BOOST_CHECK(!(R1L < ~~R1L));
|
||||
BOOST_CHECK(R1L <= ~~R1L);
|
||||
BOOST_CHECK(!(R1L > ~~R1L));
|
||||
BOOST_CHECK(R1L >= ~~R1L);
|
||||
|
||||
BOOST_CHECK(~~R1L + R2L == R1L + ~~R2L);
|
||||
BOOST_CHECK(~~R1L - R2L == R1L - ~~R2L);
|
||||
BOOST_CHECK(~R1L != R1L); BOOST_CHECK(R1L != ~R1L);
|
||||
unsigned char TmpArray[32];
|
||||
CHECKBITWISEOPERATOR(~R1,R2,|)
|
||||
CHECKBITWISEOPERATOR(~R1,R2,^)
|
||||
CHECKBITWISEOPERATOR(~R1,R2,&)
|
||||
CHECKBITWISEOPERATOR(R1,~R2,|)
|
||||
CHECKBITWISEOPERATOR(R1,~R2,^)
|
||||
CHECKBITWISEOPERATOR(R1,~R2,&)
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
42
src/test/base32_tests.cpp
Normal file
42
src/test/base32_tests.cpp
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
// Copyright (c) 2009-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <string>
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(base32_tests)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(base32_testvectors)
|
||||
{
|
||||
static const std::string vstrIn[] = {"","f","fo","foo","foob","fooba","foobar"};
|
||||
static const std::string vstrOut[] = {"","my======","mzxq====","mzxw6===","mzxw6yq=","mzxw6ytb","mzxw6ytboi======"};
|
||||
static const std::string vstrOutNoPadding[] = {"","my","mzxq","mzxw6","mzxw6yq","mzxw6ytb","mzxw6ytboi"};
|
||||
for (unsigned int i=0; i<std::size(vstrIn); i++)
|
||||
{
|
||||
std::string strEnc = EncodeBase32(vstrIn[i]);
|
||||
BOOST_CHECK_EQUAL(strEnc, vstrOut[i]);
|
||||
strEnc = EncodeBase32(vstrIn[i], false);
|
||||
BOOST_CHECK_EQUAL(strEnc, vstrOutNoPadding[i]);
|
||||
std::string strDec = DecodeBase32(vstrOut[i]);
|
||||
BOOST_CHECK_EQUAL(strDec, vstrIn[i]);
|
||||
}
|
||||
|
||||
// Decoding strings with embedded NUL characters should fail
|
||||
bool failure;
|
||||
(void)DecodeBase32("invalid\0"s, &failure); // correct size, invalid due to \0
|
||||
BOOST_CHECK(failure);
|
||||
(void)DecodeBase32("AWSX3VPP"s, &failure); // valid
|
||||
BOOST_CHECK(!failure);
|
||||
(void)DecodeBase32("AWSX3VPP\0invalid"s, &failure); // correct size, invalid due to \0
|
||||
BOOST_CHECK(failure);
|
||||
(void)DecodeBase32("AWSX3VPPinvalid"s, &failure); // invalid size
|
||||
BOOST_CHECK(failure);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
101
src/test/base58_tests.cpp
Normal file
101
src/test/base58_tests.cpp
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
// Copyright (c) 2009-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <test/data/base58_encode_decode.json.h>
|
||||
|
||||
#include <base58.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/vector.h>
|
||||
|
||||
#include <univalue.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <string>
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
UniValue read_json(const std::string& jsondata);
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(base58_tests, BasicTestingSetup)
|
||||
|
||||
// Goal: test low-level base58 encoding functionality
|
||||
BOOST_AUTO_TEST_CASE(base58_EncodeBase58)
|
||||
{
|
||||
UniValue tests = read_json(std::string(json_tests::base58_encode_decode, json_tests::base58_encode_decode + sizeof(json_tests::base58_encode_decode)));
|
||||
for (unsigned int idx = 0; idx < tests.size(); idx++) {
|
||||
UniValue test = tests[idx];
|
||||
std::string strTest = test.write();
|
||||
if (test.size() < 2) // Allow for extra stuff (useful for comments)
|
||||
{
|
||||
BOOST_ERROR("Bad test: " << strTest);
|
||||
continue;
|
||||
}
|
||||
std::vector<unsigned char> sourcedata = ParseHex(test[0].get_str());
|
||||
std::string base58string = test[1].get_str();
|
||||
BOOST_CHECK_MESSAGE(
|
||||
EncodeBase58(sourcedata) == base58string,
|
||||
strTest);
|
||||
}
|
||||
}
|
||||
|
||||
// Goal: test low-level base58 decoding functionality
|
||||
BOOST_AUTO_TEST_CASE(base58_DecodeBase58)
|
||||
{
|
||||
UniValue tests = read_json(std::string(json_tests::base58_encode_decode, json_tests::base58_encode_decode + sizeof(json_tests::base58_encode_decode)));
|
||||
std::vector<unsigned char> result;
|
||||
|
||||
for (unsigned int idx = 0; idx < tests.size(); idx++) {
|
||||
UniValue test = tests[idx];
|
||||
std::string strTest = test.write();
|
||||
if (test.size() < 2) // Allow for extra stuff (useful for comments)
|
||||
{
|
||||
BOOST_ERROR("Bad test: " << strTest);
|
||||
continue;
|
||||
}
|
||||
std::vector<unsigned char> expected = ParseHex(test[0].get_str());
|
||||
std::string base58string = test[1].get_str();
|
||||
BOOST_CHECK_MESSAGE(DecodeBase58(base58string, result, 256), strTest);
|
||||
BOOST_CHECK_MESSAGE(result.size() == expected.size() && std::equal(result.begin(), result.end(), expected.begin()), strTest);
|
||||
}
|
||||
|
||||
BOOST_CHECK(!DecodeBase58("invalid"s, result, 100));
|
||||
BOOST_CHECK(!DecodeBase58("invalid\0"s, result, 100));
|
||||
BOOST_CHECK(!DecodeBase58("\0invalid"s, result, 100));
|
||||
|
||||
BOOST_CHECK(DecodeBase58("good"s, result, 100));
|
||||
BOOST_CHECK(!DecodeBase58("bad0IOl"s, result, 100));
|
||||
BOOST_CHECK(!DecodeBase58("goodbad0IOl"s, result, 100));
|
||||
BOOST_CHECK(!DecodeBase58("good\0bad0IOl"s, result, 100));
|
||||
|
||||
// check that DecodeBase58 skips whitespace, but still fails with unexpected non-whitespace at the end.
|
||||
BOOST_CHECK(!DecodeBase58(" \t\n\v\f\r skip \r\f\v\n\t a", result, 3));
|
||||
BOOST_CHECK( DecodeBase58(" \t\n\v\f\r skip \r\f\v\n\t ", result, 3));
|
||||
std::vector<unsigned char> expected = ParseHex("971a55");
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(result.begin(), result.end(), expected.begin(), expected.end());
|
||||
|
||||
BOOST_CHECK(DecodeBase58Check("3vQB7B6MrGQZaxCuFg4oh"s, result, 100));
|
||||
BOOST_CHECK(!DecodeBase58Check("3vQB7B6MrGQZaxCuFg4oi"s, result, 100));
|
||||
BOOST_CHECK(!DecodeBase58Check("3vQB7B6MrGQZaxCuFg4oh0IOl"s, result, 100));
|
||||
BOOST_CHECK(!DecodeBase58Check("3vQB7B6MrGQZaxCuFg4oh\0" "0IOl"s, result, 100));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(base58_random_encode_decode)
|
||||
{
|
||||
for (int n = 0; n < 1000; ++n) {
|
||||
unsigned int len = 1 + InsecureRandBits(8);
|
||||
unsigned int zeroes = InsecureRandBool() ? InsecureRandRange(len + 1) : 0;
|
||||
auto data = Cat(std::vector<unsigned char>(zeroes, '\000'), g_insecure_rand_ctx.randbytes(len - zeroes));
|
||||
auto encoded = EncodeBase58Check(data);
|
||||
std::vector<unsigned char> decoded;
|
||||
auto ok_too_small = DecodeBase58Check(encoded, decoded, InsecureRandRange(len));
|
||||
BOOST_CHECK(!ok_too_small);
|
||||
auto ok = DecodeBase58Check(encoded, decoded, len + InsecureRandRange(257 - len));
|
||||
BOOST_CHECK(ok);
|
||||
BOOST_CHECK(data == decoded);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
39
src/test/base64_tests.cpp
Normal file
39
src/test/base64_tests.cpp
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
// Copyright (c) 2009-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <string>
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(base64_tests)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(base64_testvectors)
|
||||
{
|
||||
static const std::string vstrIn[] = {"","f","fo","foo","foob","fooba","foobar"};
|
||||
static const std::string vstrOut[] = {"","Zg==","Zm8=","Zm9v","Zm9vYg==","Zm9vYmE=","Zm9vYmFy"};
|
||||
for (unsigned int i=0; i<std::size(vstrIn); i++)
|
||||
{
|
||||
std::string strEnc = EncodeBase64(vstrIn[i]);
|
||||
BOOST_CHECK_EQUAL(strEnc, vstrOut[i]);
|
||||
std::string strDec = DecodeBase64(strEnc);
|
||||
BOOST_CHECK_EQUAL(strDec, vstrIn[i]);
|
||||
}
|
||||
|
||||
// Decoding strings with embedded NUL characters should fail
|
||||
bool failure;
|
||||
(void)DecodeBase64("invalid\0"s, &failure);
|
||||
BOOST_CHECK(failure);
|
||||
(void)DecodeBase64("nQB/pZw="s, &failure);
|
||||
BOOST_CHECK(!failure);
|
||||
(void)DecodeBase64("nQB/pZw=\0invalid"s, &failure);
|
||||
BOOST_CHECK(failure);
|
||||
(void)DecodeBase64("nQB/pZw=invalid\0"s, &failure);
|
||||
BOOST_CHECK(failure);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
102
src/test/bech32_tests.cpp
Normal file
102
src/test/bech32_tests.cpp
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
// Copyright (c) 2017 Pieter Wuille
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <bech32.h>
|
||||
#include <test/util/str.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(bech32_tests)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(bech32_testvectors_valid)
|
||||
{
|
||||
static const std::string CASES[] = {
|
||||
"A12UEL5L",
|
||||
"a12uel5l",
|
||||
"an83characterlonghumanreadablepartthatcontainsthenumber1andtheexcludedcharactersbio1tt5tgs",
|
||||
"abcdef1qpzry9x8gf2tvdw0s3jn54khce6mua7lmqqqxw",
|
||||
"11qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqc8247j",
|
||||
"split1checkupstagehandshakeupstreamerranterredcaperred2y9e3w",
|
||||
"?1ezyfcl",
|
||||
};
|
||||
for (const std::string& str : CASES) {
|
||||
const auto dec = bech32::Decode(str);
|
||||
BOOST_CHECK(dec.encoding == bech32::Encoding::BECH32);
|
||||
std::string recode = bech32::Encode(bech32::Encoding::BECH32, dec.hrp, dec.data);
|
||||
BOOST_CHECK(!recode.empty());
|
||||
BOOST_CHECK(CaseInsensitiveEqual(str, recode));
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(bech32m_testvectors_valid)
|
||||
{
|
||||
static const std::string CASES[] = {
|
||||
"A1LQFN3A",
|
||||
"a1lqfn3a",
|
||||
"an83characterlonghumanreadablepartthatcontainsthetheexcludedcharactersbioandnumber11sg7hg6",
|
||||
"abcdef1l7aum6echk45nj3s0wdvt2fg8x9yrzpqzd3ryx",
|
||||
"11llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllludsr8",
|
||||
"split1checkupstagehandshakeupstreamerranterredcaperredlc445v",
|
||||
"?1v759aa"
|
||||
};
|
||||
for (const std::string& str : CASES) {
|
||||
const auto dec = bech32::Decode(str);
|
||||
BOOST_CHECK(dec.encoding == bech32::Encoding::BECH32M);
|
||||
std::string recode = bech32::Encode(bech32::Encoding::BECH32M, dec.hrp, dec.data);
|
||||
BOOST_CHECK(!recode.empty());
|
||||
BOOST_CHECK(CaseInsensitiveEqual(str, recode));
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(bech32_testvectors_invalid)
|
||||
{
|
||||
static const std::string CASES[] = {
|
||||
" 1nwldj5",
|
||||
"\x7f""1axkwrx",
|
||||
"\x80""1eym55h",
|
||||
"an84characterslonghumanreadablepartthatcontainsthenumber1andtheexcludedcharactersbio1569pvx",
|
||||
"pzry9x0s0muk",
|
||||
"1pzry9x0s0muk",
|
||||
"x1b4n0q5v",
|
||||
"li1dgmt3",
|
||||
"de1lg7wt\xff",
|
||||
"A1G7SGD8",
|
||||
"10a06t8",
|
||||
"1qzzfhee",
|
||||
"a12UEL5L",
|
||||
"A12uEL5L",
|
||||
};
|
||||
for (const std::string& str : CASES) {
|
||||
const auto dec = bech32::Decode(str);
|
||||
BOOST_CHECK(dec.encoding == bech32::Encoding::INVALID);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(bech32m_testvectors_invalid)
|
||||
{
|
||||
static const std::string CASES[] = {
|
||||
" 1xj0phk",
|
||||
"\x7f""1g6xzxy",
|
||||
"\x80""1vctc34",
|
||||
"an84characterslonghumanreadablepartthatcontainsthetheexcludedcharactersbioandnumber11d6pts4",
|
||||
"qyrz8wqd2c9m",
|
||||
"1qyrz8wqd2c9m",
|
||||
"y1b0jsk6g",
|
||||
"lt1igcx5c0",
|
||||
"in1muywd",
|
||||
"mm1crxm3i",
|
||||
"au1s5cgom",
|
||||
"M1VUXWEZ",
|
||||
"16plkw9",
|
||||
"1p2gdwpf"
|
||||
};
|
||||
for (const std::string& str : CASES) {
|
||||
const auto dec = bech32::Decode(str);
|
||||
BOOST_CHECK(dec.encoding == bech32::Encoding::INVALID);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
155
src/test/bip32_tests.cpp
Normal file
155
src/test/bip32_tests.cpp
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
// Copyright (c) 2013-2021 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <clientversion.h>
|
||||
#include <key.h>
|
||||
#include <key_io.h>
|
||||
#include <streams.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct TestDerivation {
|
||||
std::string pub;
|
||||
std::string prv;
|
||||
unsigned int nChild;
|
||||
};
|
||||
|
||||
struct TestVector {
|
||||
std::string strHexMaster;
|
||||
std::vector<TestDerivation> vDerive;
|
||||
|
||||
explicit TestVector(std::string strHexMasterIn) : strHexMaster(strHexMasterIn) {}
|
||||
|
||||
TestVector& operator()(std::string pub, std::string prv, unsigned int nChild) {
|
||||
vDerive.push_back(TestDerivation());
|
||||
TestDerivation &der = vDerive.back();
|
||||
der.pub = pub;
|
||||
der.prv = prv;
|
||||
der.nChild = nChild;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
TestVector test1 =
|
||||
TestVector("000102030405060708090a0b0c0d0e0f")
|
||||
("xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8",
|
||||
"xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi",
|
||||
0x80000000)
|
||||
("xpub68Gmy5EdvgibQVfPdqkBBCHxA5htiqg55crXYuXoQRKfDBFA1WEjWgP6LHhwBZeNK1VTsfTFUHCdrfp1bgwQ9xv5ski8PX9rL2dZXvgGDnw",
|
||||
"xprv9uHRZZhk6KAJC1avXpDAp4MDc3sQKNxDiPvvkX8Br5ngLNv1TxvUxt4cV1rGL5hj6KCesnDYUhd7oWgT11eZG7XnxHrnYeSvkzY7d2bhkJ7",
|
||||
1)
|
||||
("xpub6ASuArnXKPbfEwhqN6e3mwBcDTgzisQN1wXN9BJcM47sSikHjJf3UFHKkNAWbWMiGj7Wf5uMash7SyYq527Hqck2AxYysAA7xmALppuCkwQ",
|
||||
"xprv9wTYmMFdV23N2TdNG573QoEsfRrWKQgWeibmLntzniatZvR9BmLnvSxqu53Kw1UmYPxLgboyZQaXwTCg8MSY3H2EU4pWcQDnRnrVA1xe8fs",
|
||||
0x80000002)
|
||||
("xpub6D4BDPcP2GT577Vvch3R8wDkScZWzQzMMUm3PWbmWvVJrZwQY4VUNgqFJPMM3No2dFDFGTsxxpG5uJh7n7epu4trkrX7x7DogT5Uv6fcLW5",
|
||||
"xprv9z4pot5VBttmtdRTWfWQmoH1taj2axGVzFqSb8C9xaxKymcFzXBDptWmT7FwuEzG3ryjH4ktypQSAewRiNMjANTtpgP4mLTj34bhnZX7UiM",
|
||||
2)
|
||||
("xpub6FHa3pjLCk84BayeJxFW2SP4XRrFd1JYnxeLeU8EqN3vDfZmbqBqaGJAyiLjTAwm6ZLRQUMv1ZACTj37sR62cfN7fe5JnJ7dh8zL4fiyLHV",
|
||||
"xprvA2JDeKCSNNZky6uBCviVfJSKyQ1mDYahRjijr5idH2WwLsEd4Hsb2Tyh8RfQMuPh7f7RtyzTtdrbdqqsunu5Mm3wDvUAKRHSC34sJ7in334",
|
||||
1000000000)
|
||||
("xpub6H1LXWLaKsWFhvm6RVpEL9P4KfRZSW7abD2ttkWP3SSQvnyA8FSVqNTEcYFgJS2UaFcxupHiYkro49S8yGasTvXEYBVPamhGW6cFJodrTHy",
|
||||
"xprvA41z7zogVVwxVSgdKUHDy1SKmdb533PjDz7J6N6mV6uS3ze1ai8FHa8kmHScGpWmj4WggLyQjgPie1rFSruoUihUZREPSL39UNdE3BBDu76",
|
||||
0);
|
||||
|
||||
TestVector test2 =
|
||||
TestVector("fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542")
|
||||
("xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB",
|
||||
"xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U",
|
||||
0)
|
||||
("xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH",
|
||||
"xprv9vHkqa6EV4sPZHYqZznhT2NPtPCjKuDKGY38FBWLvgaDx45zo9WQRUT3dKYnjwih2yJD9mkrocEZXo1ex8G81dwSM1fwqWpWkeS3v86pgKt",
|
||||
0xFFFFFFFF)
|
||||
("xpub6ASAVgeehLbnwdqV6UKMHVzgqAG8Gr6riv3Fxxpj8ksbH9ebxaEyBLZ85ySDhKiLDBrQSARLq1uNRts8RuJiHjaDMBU4Zn9h8LZNnBC5y4a",
|
||||
"xprv9wSp6B7kry3Vj9m1zSnLvN3xH8RdsPP1Mh7fAaR7aRLcQMKTR2vidYEeEg2mUCTAwCd6vnxVrcjfy2kRgVsFawNzmjuHc2YmYRmagcEPdU9",
|
||||
1)
|
||||
("xpub6DF8uhdarytz3FWdA8TvFSvvAh8dP3283MY7p2V4SeE2wyWmG5mg5EwVvmdMVCQcoNJxGoWaU9DCWh89LojfZ537wTfunKau47EL2dhHKon",
|
||||
"xprv9zFnWC6h2cLgpmSA46vutJzBcfJ8yaJGg8cX1e5StJh45BBciYTRXSd25UEPVuesF9yog62tGAQtHjXajPPdbRCHuWS6T8XA2ECKADdw4Ef",
|
||||
0xFFFFFFFE)
|
||||
("xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL",
|
||||
"xprvA1RpRA33e1JQ7ifknakTFpgNXPmW2YvmhqLQYMmrj4xJXXWYpDPS3xz7iAxn8L39njGVyuoseXzU6rcxFLJ8HFsTjSyQbLYnMpCqE2VbFWc",
|
||||
2)
|
||||
("xpub6FnCn6nSzZAw5Tw7cgR9bi15UV96gLZhjDstkXXxvCLsUXBGXPdSnLFbdpq8p9HmGsApME5hQTZ3emM2rnY5agb9rXpVGyy3bdW6EEgAtqt",
|
||||
"xprvA2nrNbFZABcdryreWet9Ea4LvTJcGsqrMzxHx98MMrotbir7yrKCEXw7nadnHM8Dq38EGfSh6dqA9QWTyefMLEcBYJUuekgW4BYPJcr9E7j",
|
||||
0);
|
||||
|
||||
TestVector test3 =
|
||||
TestVector("4b381541583be4423346c643850da4b320e46a87ae3d2a4e6da11eba819cd4acba45d239319ac14f863b8d5ab5a0d0c64d2e8a1e7d1457df2e5a3c51c73235be")
|
||||
("xpub661MyMwAqRbcEZVB4dScxMAdx6d4nFc9nvyvH3v4gJL378CSRZiYmhRoP7mBy6gSPSCYk6SzXPTf3ND1cZAceL7SfJ1Z3GC8vBgp2epUt13",
|
||||
"xprv9s21ZrQH143K25QhxbucbDDuQ4naNntJRi4KUfWT7xo4EKsHt2QJDu7KXp1A3u7Bi1j8ph3EGsZ9Xvz9dGuVrtHHs7pXeTzjuxBrCmmhgC6",
|
||||
0x80000000)
|
||||
("xpub68NZiKmJWnxxS6aaHmn81bvJeTESw724CRDs6HbuccFQN9Ku14VQrADWgqbhhTHBaohPX4CjNLf9fq9MYo6oDaPPLPxSb7gwQN3ih19Zm4Y",
|
||||
"xprv9uPDJpEQgRQfDcW7BkF7eTya6RPxXeJCqCJGHuCJ4GiRVLzkTXBAJMu2qaMWPrS7AANYqdq6vcBcBUdJCVVFceUvJFjaPdGZ2y9WACViL4L",
|
||||
0);
|
||||
|
||||
TestVector test4 =
|
||||
TestVector("3ddd5602285899a946114506157c7997e5444528f3003f6134712147db19b678")
|
||||
("xpub661MyMwAqRbcGczjuMoRm6dXaLDEhW1u34gKenbeYqAix21mdUKJyuyu5F1rzYGVxyL6tmgBUAEPrEz92mBXjByMRiJdba9wpnN37RLLAXa",
|
||||
"xprv9s21ZrQH143K48vGoLGRPxgo2JNkJ3J3fqkirQC2zVdk5Dgd5w14S7fRDyHH4dWNHUgkvsvNDCkvAwcSHNAQwhwgNMgZhLtQC63zxwhQmRv",
|
||||
0x80000000)
|
||||
("xpub69AUMk3qDBi3uW1sXgjCmVjJ2G6WQoYSnNHyzkmdCHEhSZ4tBok37xfFEqHd2AddP56Tqp4o56AePAgCjYdvpW2PU2jbUPFKsav5ut6Ch1m",
|
||||
"xprv9vB7xEWwNp9kh1wQRfCCQMnZUEG21LpbR9NPCNN1dwhiZkjjeGRnaALmPXCX7SgjFTiCTT6bXes17boXtjq3xLpcDjzEuGLQBM5ohqkao9G",
|
||||
0x80000001)
|
||||
("xpub6BJA1jSqiukeaesWfxe6sNK9CCGaujFFSJLomWHprUL9DePQ4JDkM5d88n49sMGJxrhpjazuXYWdMf17C9T5XnxkopaeS7jGk1GyyVziaMt",
|
||||
"xprv9xJocDuwtYCMNAo3Zw76WENQeAS6WGXQ55RCy7tDJ8oALr4FWkuVoHJeHVAcAqiZLE7Je3vZJHxspZdFHfnBEjHqU5hG1Jaj32dVoS6XLT1",
|
||||
0);
|
||||
|
||||
static void RunTest(const TestVector &test) {
|
||||
std::vector<unsigned char> seed = ParseHex(test.strHexMaster);
|
||||
CExtKey key;
|
||||
CExtPubKey pubkey;
|
||||
key.SetSeed(seed.data(), seed.size());
|
||||
pubkey = key.Neuter();
|
||||
for (const TestDerivation &derive : test.vDerive) {
|
||||
unsigned char data[74];
|
||||
key.Encode(data);
|
||||
pubkey.Encode(data);
|
||||
|
||||
// Test private key
|
||||
BOOST_CHECK(EncodeExtKey(key) == derive.prv);
|
||||
BOOST_CHECK(DecodeExtKey(derive.prv) == key); //ensure a base58 decoded key also matches
|
||||
|
||||
// Test public key
|
||||
BOOST_CHECK(EncodeExtPubKey(pubkey) == derive.pub);
|
||||
BOOST_CHECK(DecodeExtPubKey(derive.pub) == pubkey); //ensure a base58 decoded pubkey also matches
|
||||
|
||||
// Derive new keys
|
||||
CExtKey keyNew;
|
||||
BOOST_CHECK(key.Derive(keyNew, derive.nChild));
|
||||
CExtPubKey pubkeyNew = keyNew.Neuter();
|
||||
if (!(derive.nChild & 0x80000000)) {
|
||||
// Compare with public derivation
|
||||
CExtPubKey pubkeyNew2;
|
||||
BOOST_CHECK(pubkey.Derive(pubkeyNew2, derive.nChild));
|
||||
BOOST_CHECK(pubkeyNew == pubkeyNew2);
|
||||
}
|
||||
key = keyNew;
|
||||
pubkey = pubkeyNew;
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(bip32_tests, BasicTestingSetup)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(bip32_test1) {
|
||||
RunTest(test1);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(bip32_test2) {
|
||||
RunTest(test2);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(bip32_test3) {
|
||||
RunTest(test3);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(bip32_test4) {
|
||||
RunTest(test4);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
77
src/test/blockchain_tests.cpp
Normal file
77
src/test/blockchain_tests.cpp
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
// Copyright (c) 2017-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <chain.h>
|
||||
#include <rpc/blockchain.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <util/string.h>
|
||||
|
||||
/* Equality between doubles is imprecise. Comparison should be done
|
||||
* with a small threshold of tolerance, rather than exact equality.
|
||||
*/
|
||||
static bool DoubleEquals(double a, double b, double epsilon)
|
||||
{
|
||||
return std::abs(a - b) < epsilon;
|
||||
}
|
||||
|
||||
static CBlockIndex* CreateBlockIndexWithNbits(uint32_t nbits)
|
||||
{
|
||||
CBlockIndex* block_index = new CBlockIndex();
|
||||
block_index->nHeight = 46367;
|
||||
block_index->nTime = 1269211443;
|
||||
block_index->nBits = nbits;
|
||||
return block_index;
|
||||
}
|
||||
|
||||
static void RejectDifficultyMismatch(double difficulty, double expected_difficulty) {
|
||||
BOOST_CHECK_MESSAGE(
|
||||
DoubleEquals(difficulty, expected_difficulty, 0.00001),
|
||||
"Difficulty was " + ToString(difficulty)
|
||||
+ " but was expected to be " + ToString(expected_difficulty));
|
||||
}
|
||||
|
||||
/* Given a BlockIndex with the provided nbits,
|
||||
* verify that the expected difficulty results.
|
||||
*/
|
||||
static void TestDifficulty(uint32_t nbits, double expected_difficulty)
|
||||
{
|
||||
CBlockIndex* block_index = CreateBlockIndexWithNbits(nbits);
|
||||
double difficulty = GetDifficulty(NULL, block_index);
|
||||
delete block_index;
|
||||
|
||||
RejectDifficultyMismatch(difficulty, expected_difficulty);
|
||||
}
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(blockchain_tests, BasicTestingSetup)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(get_difficulty_for_very_low_target)
|
||||
{
|
||||
TestDifficulty(0x1f111111, 0.000001);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(get_difficulty_for_low_target)
|
||||
{
|
||||
TestDifficulty(0x1ef88f6f, 0.000016);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(get_difficulty_for_mid_target)
|
||||
{
|
||||
TestDifficulty(0x1df88f6f, 0.004023);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(get_difficulty_for_high_target)
|
||||
{
|
||||
TestDifficulty(0x1cf88f6f, 1.02991);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(get_difficulty_for_very_high_target)
|
||||
{
|
||||
TestDifficulty(0x12345678, 5913134931067755359633408.0);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
373
src/test/blockencodings_tests.cpp
Normal file
373
src/test/blockencodings_tests.cpp
Normal file
|
|
@ -0,0 +1,373 @@
|
|||
// Copyright (c) 2009-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <blockencodings.h>
|
||||
#include <chainparams.h>
|
||||
#include <consensus/merkle.h>
|
||||
#include <pow.h>
|
||||
#include <streams.h>
|
||||
|
||||
#include <test/util/setup_common.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
std::vector<std::pair<uint256, CTransactionRef>> extra_txn;
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(blockencodings_tests, RegTestingSetup)
|
||||
|
||||
static CBlock BuildBlockTestCase() {
|
||||
CBlock block;
|
||||
CMutableTransaction tx;
|
||||
tx.vin.resize(1);
|
||||
tx.vin[0].scriptSig.resize(10);
|
||||
tx.vout.resize(1);
|
||||
tx.vout[0].nValue = 42;
|
||||
|
||||
block.vtx.resize(3);
|
||||
block.vtx[0] = MakeTransactionRef(tx);
|
||||
block.nVersion = 42;
|
||||
block.hashPrevBlock = InsecureRand256();
|
||||
block.nBits = 0x207fffff;
|
||||
|
||||
tx.vin[0].prevout.hash = InsecureRand256();
|
||||
tx.vin[0].prevout.n = 0;
|
||||
block.vtx[1] = MakeTransactionRef(tx);
|
||||
|
||||
tx.vin.resize(10);
|
||||
for (size_t i = 0; i < tx.vin.size(); i++) {
|
||||
tx.vin[i].prevout.hash = InsecureRand256();
|
||||
tx.vin[i].prevout.n = 0;
|
||||
}
|
||||
block.vtx[2] = MakeTransactionRef(tx);
|
||||
|
||||
bool mutated;
|
||||
block.hashMerkleRoot = BlockMerkleRoot(block, &mutated);
|
||||
assert(!mutated);
|
||||
while (!CheckProofOfWork(block.GetHash(), block.nBits, Params().GetConsensus())) ++block.nNonce;
|
||||
return block;
|
||||
}
|
||||
|
||||
// Number of shared use_counts we expect for a tx we haven't touched
|
||||
// (block + mempool + our copy from the GetSharedTx call)
|
||||
constexpr long SHARED_TX_OFFSET{3};
|
||||
|
||||
BOOST_AUTO_TEST_CASE(SimpleRoundTripTest)
|
||||
{
|
||||
CTxMemPool pool;
|
||||
TestMemPoolEntryHelper entry;
|
||||
CBlock block(BuildBlockTestCase());
|
||||
|
||||
LOCK2(cs_main, pool.cs);
|
||||
pool.addUnchecked(entry.FromTx(block.vtx[2]));
|
||||
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 0);
|
||||
|
||||
// Do a simple ShortTxIDs RT
|
||||
{
|
||||
CBlockHeaderAndShortTxIDs shortIDs(block, true);
|
||||
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
stream << shortIDs;
|
||||
|
||||
CBlockHeaderAndShortTxIDs shortIDs2;
|
||||
stream >> shortIDs2;
|
||||
|
||||
PartiallyDownloadedBlock partialBlock(&pool);
|
||||
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
|
||||
BOOST_CHECK( partialBlock.IsTxAvailable(0));
|
||||
BOOST_CHECK(!partialBlock.IsTxAvailable(1));
|
||||
BOOST_CHECK( partialBlock.IsTxAvailable(2));
|
||||
|
||||
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1);
|
||||
|
||||
size_t poolSize = pool.size();
|
||||
pool.removeRecursive(*block.vtx[2], MemPoolRemovalReason::REPLACED);
|
||||
BOOST_CHECK_EQUAL(pool.size(), poolSize - 1);
|
||||
|
||||
CBlock block2;
|
||||
{
|
||||
PartiallyDownloadedBlock tmp = partialBlock;
|
||||
BOOST_CHECK(partialBlock.FillBlock(block2, {}) == READ_STATUS_INVALID); // No transactions
|
||||
partialBlock = tmp;
|
||||
}
|
||||
|
||||
// Wrong transaction
|
||||
{
|
||||
PartiallyDownloadedBlock tmp = partialBlock;
|
||||
partialBlock.FillBlock(block2, {block.vtx[2]}); // Current implementation doesn't check txn here, but don't require that
|
||||
partialBlock = tmp;
|
||||
}
|
||||
bool mutated;
|
||||
BOOST_CHECK(block.hashMerkleRoot != BlockMerkleRoot(block2, &mutated));
|
||||
|
||||
CBlock block3;
|
||||
BOOST_CHECK(partialBlock.FillBlock(block3, {block.vtx[1]}) == READ_STATUS_OK);
|
||||
BOOST_CHECK_EQUAL(block.GetHash().ToString(), block3.GetHash().ToString());
|
||||
BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block3, &mutated).ToString());
|
||||
BOOST_CHECK(!mutated);
|
||||
}
|
||||
}
|
||||
|
||||
class TestHeaderAndShortIDs {
|
||||
// Utility to encode custom CBlockHeaderAndShortTxIDs
|
||||
public:
|
||||
CBlockHeader header;
|
||||
uint64_t nonce;
|
||||
std::vector<uint64_t> shorttxids;
|
||||
std::vector<PrefilledTransaction> prefilledtxn;
|
||||
|
||||
explicit TestHeaderAndShortIDs(const CBlockHeaderAndShortTxIDs& orig) {
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
stream << orig;
|
||||
stream >> *this;
|
||||
}
|
||||
explicit TestHeaderAndShortIDs(const CBlock& block) :
|
||||
TestHeaderAndShortIDs(CBlockHeaderAndShortTxIDs(block, true)) {}
|
||||
|
||||
uint64_t GetShortID(const uint256& txhash) const {
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
stream << *this;
|
||||
CBlockHeaderAndShortTxIDs base;
|
||||
stream >> base;
|
||||
return base.GetShortID(txhash);
|
||||
}
|
||||
|
||||
SERIALIZE_METHODS(TestHeaderAndShortIDs, obj) { READWRITE(obj.header, obj.nonce, Using<VectorFormatter<CustomUintFormatter<CBlockHeaderAndShortTxIDs::SHORTTXIDS_LENGTH>>>(obj.shorttxids), obj.prefilledtxn); }
|
||||
};
|
||||
|
||||
BOOST_AUTO_TEST_CASE(NonCoinbasePreforwardRTTest)
|
||||
{
|
||||
CTxMemPool pool;
|
||||
TestMemPoolEntryHelper entry;
|
||||
CBlock block(BuildBlockTestCase());
|
||||
|
||||
LOCK2(cs_main, pool.cs);
|
||||
pool.addUnchecked(entry.FromTx(block.vtx[2]));
|
||||
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 0);
|
||||
|
||||
uint256 txhash;
|
||||
|
||||
// Test with pre-forwarding tx 1, but not coinbase
|
||||
{
|
||||
TestHeaderAndShortIDs shortIDs(block);
|
||||
shortIDs.prefilledtxn.resize(1);
|
||||
shortIDs.prefilledtxn[0] = {1, block.vtx[1]};
|
||||
shortIDs.shorttxids.resize(2);
|
||||
shortIDs.shorttxids[0] = shortIDs.GetShortID(block.vtx[0]->GetHash());
|
||||
shortIDs.shorttxids[1] = shortIDs.GetShortID(block.vtx[2]->GetHash());
|
||||
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
stream << shortIDs;
|
||||
|
||||
CBlockHeaderAndShortTxIDs shortIDs2;
|
||||
stream >> shortIDs2;
|
||||
|
||||
PartiallyDownloadedBlock partialBlock(&pool);
|
||||
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
|
||||
BOOST_CHECK(!partialBlock.IsTxAvailable(0));
|
||||
BOOST_CHECK( partialBlock.IsTxAvailable(1));
|
||||
BOOST_CHECK( partialBlock.IsTxAvailable(2));
|
||||
|
||||
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1); // +1 because of partialBlock
|
||||
|
||||
CBlock block2;
|
||||
{
|
||||
PartiallyDownloadedBlock tmp = partialBlock;
|
||||
BOOST_CHECK(partialBlock.FillBlock(block2, {}) == READ_STATUS_INVALID); // No transactions
|
||||
partialBlock = tmp;
|
||||
}
|
||||
|
||||
// Wrong transaction
|
||||
{
|
||||
PartiallyDownloadedBlock tmp = partialBlock;
|
||||
partialBlock.FillBlock(block2, {block.vtx[1]}); // Current implementation doesn't check txn here, but don't require that
|
||||
partialBlock = tmp;
|
||||
}
|
||||
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 2); // +2 because of partialBlock and block2
|
||||
bool mutated;
|
||||
BOOST_CHECK(block.hashMerkleRoot != BlockMerkleRoot(block2, &mutated));
|
||||
|
||||
CBlock block3;
|
||||
PartiallyDownloadedBlock partialBlockCopy = partialBlock;
|
||||
BOOST_CHECK(partialBlock.FillBlock(block3, {block.vtx[0]}) == READ_STATUS_OK);
|
||||
BOOST_CHECK_EQUAL(block.GetHash().ToString(), block3.GetHash().ToString());
|
||||
BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block3, &mutated).ToString());
|
||||
BOOST_CHECK(!mutated);
|
||||
|
||||
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 3); // +2 because of partialBlock and block2 and block3
|
||||
|
||||
txhash = block.vtx[2]->GetHash();
|
||||
block.vtx.clear();
|
||||
block2.vtx.clear();
|
||||
block3.vtx.clear();
|
||||
BOOST_CHECK_EQUAL(pool.mapTx.find(txhash)->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1 - 1); // + 1 because of partialBlock; -1 because of block.
|
||||
}
|
||||
BOOST_CHECK_EQUAL(pool.mapTx.find(txhash)->GetSharedTx().use_count(), SHARED_TX_OFFSET - 1); // -1 because of block
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(SufficientPreforwardRTTest)
|
||||
{
|
||||
CTxMemPool pool;
|
||||
TestMemPoolEntryHelper entry;
|
||||
CBlock block(BuildBlockTestCase());
|
||||
|
||||
LOCK2(cs_main, pool.cs);
|
||||
pool.addUnchecked(entry.FromTx(block.vtx[1]));
|
||||
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[1]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 0);
|
||||
|
||||
uint256 txhash;
|
||||
|
||||
// Test with pre-forwarding coinbase + tx 2 with tx 1 in mempool
|
||||
{
|
||||
TestHeaderAndShortIDs shortIDs(block);
|
||||
shortIDs.prefilledtxn.resize(2);
|
||||
shortIDs.prefilledtxn[0] = {0, block.vtx[0]};
|
||||
shortIDs.prefilledtxn[1] = {1, block.vtx[2]}; // id == 1 as it is 1 after index 1
|
||||
shortIDs.shorttxids.resize(1);
|
||||
shortIDs.shorttxids[0] = shortIDs.GetShortID(block.vtx[1]->GetHash());
|
||||
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
stream << shortIDs;
|
||||
|
||||
CBlockHeaderAndShortTxIDs shortIDs2;
|
||||
stream >> shortIDs2;
|
||||
|
||||
PartiallyDownloadedBlock partialBlock(&pool);
|
||||
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
|
||||
BOOST_CHECK( partialBlock.IsTxAvailable(0));
|
||||
BOOST_CHECK( partialBlock.IsTxAvailable(1));
|
||||
BOOST_CHECK( partialBlock.IsTxAvailable(2));
|
||||
|
||||
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[1]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1);
|
||||
|
||||
CBlock block2;
|
||||
PartiallyDownloadedBlock partialBlockCopy = partialBlock;
|
||||
BOOST_CHECK(partialBlock.FillBlock(block2, {}) == READ_STATUS_OK);
|
||||
BOOST_CHECK_EQUAL(block.GetHash().ToString(), block2.GetHash().ToString());
|
||||
bool mutated;
|
||||
BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block2, &mutated).ToString());
|
||||
BOOST_CHECK(!mutated);
|
||||
|
||||
txhash = block.vtx[1]->GetHash();
|
||||
block.vtx.clear();
|
||||
block2.vtx.clear();
|
||||
BOOST_CHECK_EQUAL(pool.mapTx.find(txhash)->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1 - 1); // + 1 because of partialBlock; -1 because of block.
|
||||
}
|
||||
BOOST_CHECK_EQUAL(pool.mapTx.find(txhash)->GetSharedTx().use_count(), SHARED_TX_OFFSET - 1); // -1 because of block
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(EmptyBlockRoundTripTest)
|
||||
{
|
||||
CTxMemPool pool;
|
||||
CMutableTransaction coinbase;
|
||||
coinbase.vin.resize(1);
|
||||
coinbase.vin[0].scriptSig.resize(10);
|
||||
coinbase.vout.resize(1);
|
||||
coinbase.vout[0].nValue = 42;
|
||||
|
||||
CBlock block;
|
||||
block.vtx.resize(1);
|
||||
block.vtx[0] = MakeTransactionRef(std::move(coinbase));
|
||||
block.nVersion = 42;
|
||||
block.hashPrevBlock = InsecureRand256();
|
||||
block.nBits = 0x207fffff;
|
||||
|
||||
bool mutated;
|
||||
block.hashMerkleRoot = BlockMerkleRoot(block, &mutated);
|
||||
assert(!mutated);
|
||||
while (!CheckProofOfWork(block.GetHash(), block.nBits, Params().GetConsensus())) ++block.nNonce;
|
||||
|
||||
// Test simple header round-trip with only coinbase
|
||||
{
|
||||
CBlockHeaderAndShortTxIDs shortIDs(block, false);
|
||||
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
stream << shortIDs;
|
||||
|
||||
CBlockHeaderAndShortTxIDs shortIDs2;
|
||||
stream >> shortIDs2;
|
||||
|
||||
PartiallyDownloadedBlock partialBlock(&pool);
|
||||
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
|
||||
BOOST_CHECK(partialBlock.IsTxAvailable(0));
|
||||
|
||||
CBlock block2;
|
||||
std::vector<CTransactionRef> vtx_missing;
|
||||
BOOST_CHECK(partialBlock.FillBlock(block2, vtx_missing) == READ_STATUS_OK);
|
||||
BOOST_CHECK_EQUAL(block.GetHash().ToString(), block2.GetHash().ToString());
|
||||
BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block2, &mutated).ToString());
|
||||
BOOST_CHECK(!mutated);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TransactionsRequestSerializationTest) {
|
||||
BlockTransactionsRequest req1;
|
||||
req1.blockhash = InsecureRand256();
|
||||
req1.indexes.resize(4);
|
||||
req1.indexes[0] = 0;
|
||||
req1.indexes[1] = 1;
|
||||
req1.indexes[2] = 3;
|
||||
req1.indexes[3] = 4;
|
||||
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
stream << req1;
|
||||
|
||||
BlockTransactionsRequest req2;
|
||||
stream >> req2;
|
||||
|
||||
BOOST_CHECK_EQUAL(req1.blockhash.ToString(), req2.blockhash.ToString());
|
||||
BOOST_CHECK_EQUAL(req1.indexes.size(), req2.indexes.size());
|
||||
BOOST_CHECK_EQUAL(req1.indexes[0], req2.indexes[0]);
|
||||
BOOST_CHECK_EQUAL(req1.indexes[1], req2.indexes[1]);
|
||||
BOOST_CHECK_EQUAL(req1.indexes[2], req2.indexes[2]);
|
||||
BOOST_CHECK_EQUAL(req1.indexes[3], req2.indexes[3]);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TransactionsRequestDeserializationMaxTest) {
|
||||
// Check that the highest legal index is decoded correctly
|
||||
BlockTransactionsRequest req0;
|
||||
req0.blockhash = InsecureRand256();
|
||||
req0.indexes.resize(1);
|
||||
req0.indexes[0] = 0xffff;
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
stream << req0;
|
||||
|
||||
BlockTransactionsRequest req1;
|
||||
stream >> req1;
|
||||
BOOST_CHECK_EQUAL(req0.indexes.size(), req1.indexes.size());
|
||||
BOOST_CHECK_EQUAL(req0.indexes[0], req1.indexes[0]);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TransactionsRequestDeserializationOverflowTest) {
|
||||
// Any set of index deltas that starts with N values that sum to (0x10000 - N)
|
||||
// causes the edge-case overflow that was originally not checked for. Such
|
||||
// a request cannot be created by serializing a real BlockTransactionsRequest
|
||||
// due to the overflow, so here we'll serialize from raw deltas.
|
||||
BlockTransactionsRequest req0;
|
||||
req0.blockhash = InsecureRand256();
|
||||
req0.indexes.resize(3);
|
||||
req0.indexes[0] = 0x7000;
|
||||
req0.indexes[1] = 0x10000 - 0x7000 - 2;
|
||||
req0.indexes[2] = 0;
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
stream << req0.blockhash;
|
||||
WriteCompactSize(stream, req0.indexes.size());
|
||||
WriteCompactSize(stream, req0.indexes[0]);
|
||||
WriteCompactSize(stream, req0.indexes[1]);
|
||||
WriteCompactSize(stream, req0.indexes[2]);
|
||||
|
||||
BlockTransactionsRequest req1;
|
||||
try {
|
||||
stream >> req1;
|
||||
// before patch: deserialize above succeeds and this check fails, demonstrating the overflow
|
||||
BOOST_CHECK(req1.indexes[1] < req1.indexes[2]);
|
||||
// this shouldn't be reachable before or after patch
|
||||
BOOST_CHECK(0);
|
||||
} catch(std::ios_base::failure &) {
|
||||
// deserialize should fail
|
||||
BOOST_CHECK(true); // Needed to suppress "Test case [...] did not check any assertions"
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
306
src/test/blockfilter_index_tests.cpp
Normal file
306
src/test/blockfilter_index_tests.cpp
Normal file
|
|
@ -0,0 +1,306 @@
|
|||
// Copyright (c) 2017-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <blockfilter.h>
|
||||
#include <chainparams.h>
|
||||
#include <consensus/validation.h>
|
||||
#include <index/blockfilterindex.h>
|
||||
#include <miner.h>
|
||||
#include <pow.h>
|
||||
#include <script/standard.h>
|
||||
#include <test/util/blockfilter.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <util/time.h>
|
||||
#include <validation.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(blockfilter_index_tests)
|
||||
|
||||
struct BuildChainTestingSetup : public TestChain100Setup {
|
||||
CBlock CreateBlock(const CBlockIndex* prev, const std::vector<CMutableTransaction>& txns, const CScript& scriptPubKey);
|
||||
bool BuildChain(const CBlockIndex* pindex, const CScript& coinbase_script_pub_key, size_t length, std::vector<std::shared_ptr<CBlock>>& chain);
|
||||
};
|
||||
|
||||
static bool CheckFilterLookups(BlockFilterIndex& filter_index, const CBlockIndex* block_index,
|
||||
uint256& last_header)
|
||||
{
|
||||
BlockFilter expected_filter;
|
||||
if (!ComputeFilter(filter_index.GetFilterType(), block_index, expected_filter)) {
|
||||
BOOST_ERROR("ComputeFilter failed on block " << block_index->nHeight);
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockFilter filter;
|
||||
uint256 filter_header;
|
||||
std::vector<BlockFilter> filters;
|
||||
std::vector<uint256> filter_hashes;
|
||||
|
||||
BOOST_CHECK(filter_index.LookupFilter(block_index, filter));
|
||||
BOOST_CHECK(filter_index.LookupFilterHeader(block_index, filter_header));
|
||||
BOOST_CHECK(filter_index.LookupFilterRange(block_index->nHeight, block_index, filters));
|
||||
BOOST_CHECK(filter_index.LookupFilterHashRange(block_index->nHeight, block_index,
|
||||
filter_hashes));
|
||||
|
||||
BOOST_CHECK_EQUAL(filters.size(), 1U);
|
||||
BOOST_CHECK_EQUAL(filter_hashes.size(), 1U);
|
||||
|
||||
BOOST_CHECK_EQUAL(filter.GetHash(), expected_filter.GetHash());
|
||||
BOOST_CHECK_EQUAL(filter_header, expected_filter.ComputeHeader(last_header));
|
||||
BOOST_CHECK_EQUAL(filters[0].GetHash(), expected_filter.GetHash());
|
||||
BOOST_CHECK_EQUAL(filter_hashes[0], expected_filter.GetHash());
|
||||
|
||||
filters.clear();
|
||||
filter_hashes.clear();
|
||||
last_header = filter_header;
|
||||
return true;
|
||||
}
|
||||
|
||||
CBlock BuildChainTestingSetup::CreateBlock(const CBlockIndex* prev,
|
||||
const std::vector<CMutableTransaction>& txns,
|
||||
const CScript& scriptPubKey)
|
||||
{
|
||||
const CChainParams& chainparams = Params();
|
||||
std::unique_ptr<CBlockTemplate> pblocktemplate = BlockAssembler(m_node.chainman->ActiveChainstate(), *m_node.mempool, chainparams).CreateNewBlock(scriptPubKey);
|
||||
CBlock& block = pblocktemplate->block;
|
||||
block.hashPrevBlock = prev->GetBlockHash();
|
||||
block.nTime = prev->nTime + 1;
|
||||
|
||||
// Replace mempool-selected txns with just coinbase plus passed-in txns:
|
||||
block.vtx.resize(1);
|
||||
for (const CMutableTransaction& tx : txns) {
|
||||
block.vtx.push_back(MakeTransactionRef(tx));
|
||||
}
|
||||
// IncrementExtraNonce creates a valid coinbase and merkleRoot
|
||||
unsigned int extraNonce = 0;
|
||||
IncrementExtraNonce(&block, prev, extraNonce);
|
||||
|
||||
while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce;
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
bool BuildChainTestingSetup::BuildChain(const CBlockIndex* pindex,
|
||||
const CScript& coinbase_script_pub_key,
|
||||
size_t length,
|
||||
std::vector<std::shared_ptr<CBlock>>& chain)
|
||||
{
|
||||
std::vector<CMutableTransaction> no_txns;
|
||||
|
||||
chain.resize(length);
|
||||
for (auto& block : chain) {
|
||||
block = std::make_shared<CBlock>(CreateBlock(pindex, no_txns, coinbase_script_pub_key));
|
||||
CBlockHeader header = block->GetBlockHeader();
|
||||
|
||||
BlockValidationState state;
|
||||
if (!Assert(m_node.chainman)->ProcessNewBlockHeaders({header}, state, Params(), &pindex)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE(blockfilter_index_initial_sync, BuildChainTestingSetup)
|
||||
{
|
||||
BlockFilterIndex filter_index(BlockFilterType::BASIC, 1 << 20, true);
|
||||
|
||||
uint256 last_header;
|
||||
|
||||
// Filter should not be found in the index before it is started.
|
||||
{
|
||||
LOCK(cs_main);
|
||||
|
||||
BlockFilter filter;
|
||||
uint256 filter_header;
|
||||
std::vector<BlockFilter> filters;
|
||||
std::vector<uint256> filter_hashes;
|
||||
|
||||
for (const CBlockIndex* block_index = m_node.chainman->ActiveChain().Genesis();
|
||||
block_index != nullptr;
|
||||
block_index = m_node.chainman->ActiveChain().Next(block_index)) {
|
||||
BOOST_CHECK(!filter_index.LookupFilter(block_index, filter));
|
||||
BOOST_CHECK(!filter_index.LookupFilterHeader(block_index, filter_header));
|
||||
BOOST_CHECK(!filter_index.LookupFilterRange(block_index->nHeight, block_index, filters));
|
||||
BOOST_CHECK(!filter_index.LookupFilterHashRange(block_index->nHeight, block_index,
|
||||
filter_hashes));
|
||||
}
|
||||
}
|
||||
|
||||
// BlockUntilSyncedToCurrentChain should return false before index is started.
|
||||
BOOST_CHECK(!filter_index.BlockUntilSyncedToCurrentChain());
|
||||
|
||||
BOOST_REQUIRE(filter_index.Start(m_node.chainman->ActiveChainstate()));
|
||||
|
||||
// Allow filter index to catch up with the block index.
|
||||
constexpr int64_t timeout_ms = 10 * 1000;
|
||||
int64_t time_start = GetTimeMillis();
|
||||
while (!filter_index.BlockUntilSyncedToCurrentChain()) {
|
||||
BOOST_REQUIRE(time_start + timeout_ms > GetTimeMillis());
|
||||
UninterruptibleSleep(std::chrono::milliseconds{100});
|
||||
}
|
||||
|
||||
// Check that filter index has all blocks that were in the chain before it started.
|
||||
{
|
||||
LOCK(cs_main);
|
||||
const CBlockIndex* block_index;
|
||||
for (block_index = m_node.chainman->ActiveChain().Genesis();
|
||||
block_index != nullptr;
|
||||
block_index = m_node.chainman->ActiveChain().Next(block_index)) {
|
||||
CheckFilterLookups(filter_index, block_index, last_header);
|
||||
}
|
||||
}
|
||||
|
||||
// Create two forks.
|
||||
const CBlockIndex* tip;
|
||||
{
|
||||
LOCK(cs_main);
|
||||
tip = m_node.chainman->ActiveChain().Tip();
|
||||
}
|
||||
CKey coinbase_key_A, coinbase_key_B;
|
||||
coinbase_key_A.MakeNewKey(true);
|
||||
coinbase_key_B.MakeNewKey(true);
|
||||
CScript coinbase_script_pub_key_A = GetScriptForDestination(PKHash(coinbase_key_A.GetPubKey()));
|
||||
CScript coinbase_script_pub_key_B = GetScriptForDestination(PKHash(coinbase_key_B.GetPubKey()));
|
||||
std::vector<std::shared_ptr<CBlock>> chainA, chainB;
|
||||
BOOST_REQUIRE(BuildChain(tip, coinbase_script_pub_key_A, 10, chainA));
|
||||
BOOST_REQUIRE(BuildChain(tip, coinbase_script_pub_key_B, 10, chainB));
|
||||
|
||||
// Check that new blocks on chain A get indexed.
|
||||
uint256 chainA_last_header = last_header;
|
||||
for (size_t i = 0; i < 2; i++) {
|
||||
const auto& block = chainA[i];
|
||||
BOOST_REQUIRE(Assert(m_node.chainman)->ProcessNewBlock(Params(), block, true, nullptr));
|
||||
}
|
||||
for (size_t i = 0; i < 2; i++) {
|
||||
const auto& block = chainA[i];
|
||||
const CBlockIndex* block_index;
|
||||
{
|
||||
LOCK(cs_main);
|
||||
block_index = m_node.chainman->m_blockman.LookupBlockIndex(block->GetHash());
|
||||
}
|
||||
|
||||
BOOST_CHECK(filter_index.BlockUntilSyncedToCurrentChain());
|
||||
CheckFilterLookups(filter_index, block_index, chainA_last_header);
|
||||
}
|
||||
|
||||
// Reorg to chain B.
|
||||
uint256 chainB_last_header = last_header;
|
||||
for (size_t i = 0; i < 3; i++) {
|
||||
const auto& block = chainB[i];
|
||||
BOOST_REQUIRE(Assert(m_node.chainman)->ProcessNewBlock(Params(), block, true, nullptr));
|
||||
}
|
||||
for (size_t i = 0; i < 3; i++) {
|
||||
const auto& block = chainB[i];
|
||||
const CBlockIndex* block_index;
|
||||
{
|
||||
LOCK(cs_main);
|
||||
block_index = m_node.chainman->m_blockman.LookupBlockIndex(block->GetHash());
|
||||
}
|
||||
|
||||
BOOST_CHECK(filter_index.BlockUntilSyncedToCurrentChain());
|
||||
CheckFilterLookups(filter_index, block_index, chainB_last_header);
|
||||
}
|
||||
|
||||
// Check that filters for stale blocks on A can be retrieved.
|
||||
chainA_last_header = last_header;
|
||||
for (size_t i = 0; i < 2; i++) {
|
||||
const auto& block = chainA[i];
|
||||
const CBlockIndex* block_index;
|
||||
{
|
||||
LOCK(cs_main);
|
||||
block_index = m_node.chainman->m_blockman.LookupBlockIndex(block->GetHash());
|
||||
}
|
||||
|
||||
BOOST_CHECK(filter_index.BlockUntilSyncedToCurrentChain());
|
||||
CheckFilterLookups(filter_index, block_index, chainA_last_header);
|
||||
}
|
||||
|
||||
// Reorg back to chain A.
|
||||
for (size_t i = 2; i < 4; i++) {
|
||||
const auto& block = chainA[i];
|
||||
BOOST_REQUIRE(Assert(m_node.chainman)->ProcessNewBlock(Params(), block, true, nullptr));
|
||||
}
|
||||
|
||||
// Check that chain A and B blocks can be retrieved.
|
||||
chainA_last_header = last_header;
|
||||
chainB_last_header = last_header;
|
||||
for (size_t i = 0; i < 3; i++) {
|
||||
const CBlockIndex* block_index;
|
||||
|
||||
{
|
||||
LOCK(cs_main);
|
||||
block_index = m_node.chainman->m_blockman.LookupBlockIndex(chainA[i]->GetHash());
|
||||
}
|
||||
BOOST_CHECK(filter_index.BlockUntilSyncedToCurrentChain());
|
||||
CheckFilterLookups(filter_index, block_index, chainA_last_header);
|
||||
|
||||
{
|
||||
LOCK(cs_main);
|
||||
block_index = m_node.chainman->m_blockman.LookupBlockIndex(chainB[i]->GetHash());
|
||||
}
|
||||
BOOST_CHECK(filter_index.BlockUntilSyncedToCurrentChain());
|
||||
CheckFilterLookups(filter_index, block_index, chainB_last_header);
|
||||
}
|
||||
|
||||
// Test lookups for a range of filters/hashes.
|
||||
std::vector<BlockFilter> filters;
|
||||
std::vector<uint256> filter_hashes;
|
||||
|
||||
{
|
||||
LOCK(cs_main);
|
||||
tip = m_node.chainman->ActiveChain().Tip();
|
||||
}
|
||||
BOOST_CHECK(filter_index.LookupFilterRange(0, tip, filters));
|
||||
BOOST_CHECK(filter_index.LookupFilterHashRange(0, tip, filter_hashes));
|
||||
|
||||
assert(tip->nHeight >= 0);
|
||||
BOOST_CHECK_EQUAL(filters.size(), tip->nHeight + 1U);
|
||||
BOOST_CHECK_EQUAL(filter_hashes.size(), tip->nHeight + 1U);
|
||||
|
||||
filters.clear();
|
||||
filter_hashes.clear();
|
||||
|
||||
filter_index.Interrupt();
|
||||
filter_index.Stop();
|
||||
}
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE(blockfilter_index_init_destroy, BasicTestingSetup)
|
||||
{
|
||||
BlockFilterIndex* filter_index;
|
||||
|
||||
filter_index = GetBlockFilterIndex(BlockFilterType::BASIC);
|
||||
BOOST_CHECK(filter_index == nullptr);
|
||||
|
||||
BOOST_CHECK(InitBlockFilterIndex(BlockFilterType::BASIC, 1 << 20, true, false));
|
||||
|
||||
filter_index = GetBlockFilterIndex(BlockFilterType::BASIC);
|
||||
BOOST_CHECK(filter_index != nullptr);
|
||||
BOOST_CHECK(filter_index->GetFilterType() == BlockFilterType::BASIC);
|
||||
|
||||
// Initialize returns false if index already exists.
|
||||
BOOST_CHECK(!InitBlockFilterIndex(BlockFilterType::BASIC, 1 << 20, true, false));
|
||||
|
||||
int iter_count = 0;
|
||||
ForEachBlockFilterIndex([&iter_count](BlockFilterIndex& _index) { iter_count++; });
|
||||
BOOST_CHECK_EQUAL(iter_count, 1);
|
||||
|
||||
BOOST_CHECK(DestroyBlockFilterIndex(BlockFilterType::BASIC));
|
||||
|
||||
// Destroy returns false because index was already destroyed.
|
||||
BOOST_CHECK(!DestroyBlockFilterIndex(BlockFilterType::BASIC));
|
||||
|
||||
filter_index = GetBlockFilterIndex(BlockFilterType::BASIC);
|
||||
BOOST_CHECK(filter_index == nullptr);
|
||||
|
||||
// Reinitialize index.
|
||||
BOOST_CHECK(InitBlockFilterIndex(BlockFilterType::BASIC, 1 << 20, true, false));
|
||||
|
||||
DestroyAllBlockFilterIndexes();
|
||||
|
||||
filter_index = GetBlockFilterIndex(BlockFilterType::BASIC);
|
||||
BOOST_CHECK(filter_index == nullptr);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
194
src/test/blockfilter_tests.cpp
Normal file
194
src/test/blockfilter_tests.cpp
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
// Copyright (c) 2018-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <test/data/blockfilters.json.h>
|
||||
#include <test/util/setup_common.h>
|
||||
|
||||
#include <blockfilter.h>
|
||||
#include <core_io.h>
|
||||
#include <serialize.h>
|
||||
#include <streams.h>
|
||||
#include <univalue.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(blockfilter_tests)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(gcsfilter_test)
|
||||
{
|
||||
GCSFilter::ElementSet included_elements, excluded_elements;
|
||||
for (int i = 0; i < 100; ++i) {
|
||||
GCSFilter::Element element1(32);
|
||||
element1[0] = i;
|
||||
included_elements.insert(std::move(element1));
|
||||
|
||||
GCSFilter::Element element2(32);
|
||||
element2[1] = i;
|
||||
excluded_elements.insert(std::move(element2));
|
||||
}
|
||||
|
||||
GCSFilter filter({0, 0, 10, 1 << 10}, included_elements);
|
||||
for (const auto& element : included_elements) {
|
||||
BOOST_CHECK(filter.Match(element));
|
||||
|
||||
auto insertion = excluded_elements.insert(element);
|
||||
BOOST_CHECK(filter.MatchAny(excluded_elements));
|
||||
excluded_elements.erase(insertion.first);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(gcsfilter_default_constructor)
|
||||
{
|
||||
GCSFilter filter;
|
||||
BOOST_CHECK_EQUAL(filter.GetN(), 0U);
|
||||
BOOST_CHECK_EQUAL(filter.GetEncoded().size(), 1U);
|
||||
|
||||
const GCSFilter::Params& params = filter.GetParams();
|
||||
BOOST_CHECK_EQUAL(params.m_siphash_k0, 0U);
|
||||
BOOST_CHECK_EQUAL(params.m_siphash_k1, 0U);
|
||||
BOOST_CHECK_EQUAL(params.m_P, 0);
|
||||
BOOST_CHECK_EQUAL(params.m_M, 1U);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(blockfilter_basic_test)
|
||||
{
|
||||
CScript included_scripts[5], excluded_scripts[4];
|
||||
|
||||
// First two are outputs on a single transaction.
|
||||
included_scripts[0] << std::vector<unsigned char>(0, 65) << OP_CHECKSIG;
|
||||
included_scripts[1] << OP_DUP << OP_HASH160 << std::vector<unsigned char>(1, 20) << OP_EQUALVERIFY << OP_CHECKSIG;
|
||||
|
||||
// Third is an output on in a second transaction.
|
||||
included_scripts[2] << OP_1 << std::vector<unsigned char>(2, 33) << OP_1 << OP_CHECKMULTISIG;
|
||||
|
||||
// Last two are spent by a single transaction.
|
||||
included_scripts[3] << OP_0 << std::vector<unsigned char>(3, 32);
|
||||
included_scripts[4] << OP_4 << OP_ADD << OP_8 << OP_EQUAL;
|
||||
|
||||
// OP_RETURN output is an output on the second transaction.
|
||||
excluded_scripts[0] << OP_RETURN << std::vector<unsigned char>(4, 40);
|
||||
|
||||
// This script is not related to the block at all.
|
||||
excluded_scripts[1] << std::vector<unsigned char>(5, 33) << OP_CHECKSIG;
|
||||
|
||||
// OP_RETURN is non-standard since it's not followed by a data push, but is still excluded from
|
||||
// filter.
|
||||
excluded_scripts[2] << OP_RETURN << OP_4 << OP_ADD << OP_8 << OP_EQUAL;
|
||||
|
||||
CMutableTransaction tx_1;
|
||||
tx_1.vout.emplace_back(100, included_scripts[0]);
|
||||
tx_1.vout.emplace_back(200, included_scripts[1]);
|
||||
tx_1.vout.emplace_back(0, excluded_scripts[0]);
|
||||
|
||||
CMutableTransaction tx_2;
|
||||
tx_2.vout.emplace_back(300, included_scripts[2]);
|
||||
tx_2.vout.emplace_back(0, excluded_scripts[2]);
|
||||
tx_2.vout.emplace_back(400, excluded_scripts[3]); // Script is empty
|
||||
|
||||
CBlock block;
|
||||
block.vtx.push_back(MakeTransactionRef(tx_1));
|
||||
block.vtx.push_back(MakeTransactionRef(tx_2));
|
||||
|
||||
CBlockUndo block_undo;
|
||||
block_undo.vtxundo.emplace_back();
|
||||
block_undo.vtxundo.back().vprevout.emplace_back(CTxOut(500, included_scripts[3]), 1000, true);
|
||||
block_undo.vtxundo.back().vprevout.emplace_back(CTxOut(600, included_scripts[4]), 10000, false);
|
||||
block_undo.vtxundo.back().vprevout.emplace_back(CTxOut(700, excluded_scripts[3]), 100000, false);
|
||||
|
||||
BlockFilter block_filter(BlockFilterType::BASIC, block, block_undo);
|
||||
const GCSFilter& filter = block_filter.GetFilter();
|
||||
|
||||
for (const CScript& script : included_scripts) {
|
||||
BOOST_CHECK(filter.Match(GCSFilter::Element(script.begin(), script.end())));
|
||||
}
|
||||
for (const CScript& script : excluded_scripts) {
|
||||
BOOST_CHECK(!filter.Match(GCSFilter::Element(script.begin(), script.end())));
|
||||
}
|
||||
|
||||
// Test serialization/unserialization.
|
||||
BlockFilter block_filter2;
|
||||
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
stream << block_filter;
|
||||
stream >> block_filter2;
|
||||
|
||||
BOOST_CHECK_EQUAL(block_filter.GetFilterType(), block_filter2.GetFilterType());
|
||||
BOOST_CHECK_EQUAL(block_filter.GetBlockHash(), block_filter2.GetBlockHash());
|
||||
BOOST_CHECK(block_filter.GetEncodedFilter() == block_filter2.GetEncodedFilter());
|
||||
|
||||
BlockFilter default_ctor_block_filter_1;
|
||||
BlockFilter default_ctor_block_filter_2;
|
||||
BOOST_CHECK_EQUAL(default_ctor_block_filter_1.GetFilterType(), default_ctor_block_filter_2.GetFilterType());
|
||||
BOOST_CHECK_EQUAL(default_ctor_block_filter_1.GetBlockHash(), default_ctor_block_filter_2.GetBlockHash());
|
||||
BOOST_CHECK(default_ctor_block_filter_1.GetEncodedFilter() == default_ctor_block_filter_2.GetEncodedFilter());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(blockfilters_json_test)
|
||||
{
|
||||
UniValue json;
|
||||
std::string json_data(json_tests::blockfilters,
|
||||
json_tests::blockfilters + sizeof(json_tests::blockfilters));
|
||||
if (!json.read(json_data) || !json.isArray()) {
|
||||
BOOST_ERROR("Parse error.");
|
||||
return;
|
||||
}
|
||||
|
||||
const UniValue& tests = json.get_array();
|
||||
for (unsigned int i = 0; i < tests.size(); i++) {
|
||||
UniValue test = tests[i];
|
||||
std::string strTest = test.write();
|
||||
|
||||
if (test.size() == 1) {
|
||||
continue;
|
||||
} else if (test.size() < 7) {
|
||||
BOOST_ERROR("Bad test: " << strTest);
|
||||
continue;
|
||||
}
|
||||
|
||||
unsigned int pos = 0;
|
||||
/*int block_height =*/ test[pos++].get_int();
|
||||
uint256 block_hash;
|
||||
BOOST_CHECK(ParseHashStr(test[pos++].get_str(), block_hash));
|
||||
|
||||
CBlock block;
|
||||
BOOST_REQUIRE(DecodeHexBlk(block, test[pos++].get_str()));
|
||||
|
||||
CBlockUndo block_undo;
|
||||
block_undo.vtxundo.emplace_back();
|
||||
CTxUndo& tx_undo = block_undo.vtxundo.back();
|
||||
const UniValue& prev_scripts = test[pos++].get_array();
|
||||
for (unsigned int ii = 0; ii < prev_scripts.size(); ii++) {
|
||||
std::vector<unsigned char> raw_script = ParseHex(prev_scripts[ii].get_str());
|
||||
CTxOut txout(0, CScript(raw_script.begin(), raw_script.end()));
|
||||
tx_undo.vprevout.emplace_back(txout, 0, false);
|
||||
}
|
||||
|
||||
uint256 prev_filter_header_basic;
|
||||
BOOST_CHECK(ParseHashStr(test[pos++].get_str(), prev_filter_header_basic));
|
||||
std::vector<unsigned char> filter_basic = ParseHex(test[pos++].get_str());
|
||||
uint256 filter_header_basic;
|
||||
BOOST_CHECK(ParseHashStr(test[pos++].get_str(), filter_header_basic));
|
||||
|
||||
BlockFilter computed_filter_basic(BlockFilterType::BASIC, block, block_undo);
|
||||
BOOST_CHECK(computed_filter_basic.GetFilter().GetEncoded() == filter_basic);
|
||||
|
||||
uint256 computed_header_basic = computed_filter_basic.ComputeHeader(prev_filter_header_basic);
|
||||
BOOST_CHECK(computed_header_basic == filter_header_basic);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(blockfilter_type_names)
|
||||
{
|
||||
BOOST_CHECK_EQUAL(BlockFilterTypeName(BlockFilterType::BASIC), "basic");
|
||||
BOOST_CHECK_EQUAL(BlockFilterTypeName(static_cast<BlockFilterType>(255)), "");
|
||||
|
||||
BlockFilterType filter_type;
|
||||
BOOST_CHECK(BlockFilterTypeByName("basic", filter_type));
|
||||
BOOST_CHECK_EQUAL(filter_type, BlockFilterType::BASIC);
|
||||
|
||||
BOOST_CHECK(!BlockFilterTypeByName("unknown", filter_type));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
518
src/test/bloom_tests.cpp
Normal file
518
src/test/bloom_tests.cpp
Normal file
File diff suppressed because one or more lines are too long
25
src/test/bswap_tests.cpp
Normal file
25
src/test/bswap_tests.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (c) 2016-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2016-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <compat/byteswap.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(bswap_tests)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(bswap_tests)
|
||||
{
|
||||
uint16_t u1 = 0x1234;
|
||||
uint32_t u2 = 0x56789abc;
|
||||
uint64_t u3 = 0xdef0123456789abc;
|
||||
uint16_t e1 = 0x3412;
|
||||
uint32_t e2 = 0xbc9a7856;
|
||||
uint64_t e3 = 0xbc9a78563412f0de;
|
||||
BOOST_CHECK(bswap_16(u1) == e1);
|
||||
BOOST_CHECK(bswap_32(u2) == e2);
|
||||
BOOST_CHECK(bswap_64(u3) == e3);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
426
src/test/checkqueue_tests.cpp
Normal file
426
src/test/checkqueue_tests.cpp
Normal file
|
|
@ -0,0 +1,426 @@
|
|||
// Copyright (c) 2009-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <validation.h>
|
||||
|
||||
#include <checkqueue.h>
|
||||
#include <sync.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <util/system.h>
|
||||
#include <util/time.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(checkqueue_tests, TestingSetup)
|
||||
|
||||
static const unsigned int QUEUE_BATCH_SIZE = 128;
|
||||
static const int SCRIPT_CHECK_THREADS = 3;
|
||||
|
||||
struct FakeCheck {
|
||||
bool operator()() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void swap(FakeCheck& x){};
|
||||
};
|
||||
|
||||
struct FakeCheckCheckCompletion {
|
||||
static std::atomic<size_t> n_calls;
|
||||
bool operator()()
|
||||
{
|
||||
n_calls.fetch_add(1, std::memory_order_relaxed);
|
||||
return true;
|
||||
}
|
||||
void swap(FakeCheckCheckCompletion& x){};
|
||||
};
|
||||
|
||||
struct FailingCheck {
|
||||
bool fails;
|
||||
FailingCheck(bool _fails) : fails(_fails){};
|
||||
FailingCheck() : fails(true){};
|
||||
bool operator()() const
|
||||
{
|
||||
return !fails;
|
||||
}
|
||||
void swap(FailingCheck& x)
|
||||
{
|
||||
std::swap(fails, x.fails);
|
||||
};
|
||||
};
|
||||
|
||||
struct UniqueCheck {
|
||||
static Mutex m;
|
||||
static std::unordered_multiset<size_t> results GUARDED_BY(m);
|
||||
size_t check_id;
|
||||
UniqueCheck(size_t check_id_in) : check_id(check_id_in){};
|
||||
UniqueCheck() : check_id(0){};
|
||||
bool operator()()
|
||||
{
|
||||
LOCK(m);
|
||||
results.insert(check_id);
|
||||
return true;
|
||||
}
|
||||
void swap(UniqueCheck& x) { std::swap(x.check_id, check_id); };
|
||||
};
|
||||
|
||||
|
||||
struct MemoryCheck {
|
||||
static std::atomic<size_t> fake_allocated_memory;
|
||||
bool b {false};
|
||||
bool operator()() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
MemoryCheck(){};
|
||||
MemoryCheck(const MemoryCheck& x)
|
||||
{
|
||||
// We have to do this to make sure that destructor calls are paired
|
||||
//
|
||||
// Really, copy constructor should be deletable, but CCheckQueue breaks
|
||||
// if it is deleted because of internal push_back.
|
||||
fake_allocated_memory.fetch_add(b, std::memory_order_relaxed);
|
||||
};
|
||||
MemoryCheck(bool b_) : b(b_)
|
||||
{
|
||||
fake_allocated_memory.fetch_add(b, std::memory_order_relaxed);
|
||||
};
|
||||
~MemoryCheck()
|
||||
{
|
||||
fake_allocated_memory.fetch_sub(b, std::memory_order_relaxed);
|
||||
};
|
||||
void swap(MemoryCheck& x) { std::swap(b, x.b); };
|
||||
};
|
||||
|
||||
struct FrozenCleanupCheck {
|
||||
static std::atomic<uint64_t> nFrozen;
|
||||
static std::condition_variable cv;
|
||||
static std::mutex m;
|
||||
// Freezing can't be the default initialized behavior given how the queue
|
||||
// swaps in default initialized Checks.
|
||||
bool should_freeze {false};
|
||||
bool operator()() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
FrozenCleanupCheck() {}
|
||||
~FrozenCleanupCheck()
|
||||
{
|
||||
if (should_freeze) {
|
||||
std::unique_lock<std::mutex> l(m);
|
||||
nFrozen.store(1, std::memory_order_relaxed);
|
||||
cv.notify_one();
|
||||
cv.wait(l, []{ return nFrozen.load(std::memory_order_relaxed) == 0;});
|
||||
}
|
||||
}
|
||||
void swap(FrozenCleanupCheck& x){std::swap(should_freeze, x.should_freeze);};
|
||||
};
|
||||
|
||||
// Static Allocations
|
||||
std::mutex FrozenCleanupCheck::m{};
|
||||
std::atomic<uint64_t> FrozenCleanupCheck::nFrozen{0};
|
||||
std::condition_variable FrozenCleanupCheck::cv{};
|
||||
Mutex UniqueCheck::m;
|
||||
std::unordered_multiset<size_t> UniqueCheck::results;
|
||||
std::atomic<size_t> FakeCheckCheckCompletion::n_calls{0};
|
||||
std::atomic<size_t> MemoryCheck::fake_allocated_memory{0};
|
||||
|
||||
// Queue Typedefs
|
||||
typedef CCheckQueue<FakeCheckCheckCompletion> Correct_Queue;
|
||||
typedef CCheckQueue<FakeCheck> Standard_Queue;
|
||||
typedef CCheckQueue<FailingCheck> Failing_Queue;
|
||||
typedef CCheckQueue<UniqueCheck> Unique_Queue;
|
||||
typedef CCheckQueue<MemoryCheck> Memory_Queue;
|
||||
typedef CCheckQueue<FrozenCleanupCheck> FrozenCleanup_Queue;
|
||||
|
||||
|
||||
/** This test case checks that the CCheckQueue works properly
|
||||
* with each specified size_t Checks pushed.
|
||||
*/
|
||||
static void Correct_Queue_range(std::vector<size_t> range)
|
||||
{
|
||||
auto small_queue = std::make_unique<Correct_Queue>(QUEUE_BATCH_SIZE);
|
||||
small_queue->StartWorkerThreads(SCRIPT_CHECK_THREADS);
|
||||
// Make vChecks here to save on malloc (this test can be slow...)
|
||||
std::vector<FakeCheckCheckCompletion> vChecks;
|
||||
for (const size_t i : range) {
|
||||
size_t total = i;
|
||||
FakeCheckCheckCompletion::n_calls = 0;
|
||||
CCheckQueueControl<FakeCheckCheckCompletion> control(small_queue.get());
|
||||
while (total) {
|
||||
vChecks.resize(std::min(total, (size_t) InsecureRandRange(10)));
|
||||
total -= vChecks.size();
|
||||
control.Add(vChecks);
|
||||
}
|
||||
BOOST_REQUIRE(control.Wait());
|
||||
if (FakeCheckCheckCompletion::n_calls != i) {
|
||||
BOOST_REQUIRE_EQUAL(FakeCheckCheckCompletion::n_calls, i);
|
||||
}
|
||||
}
|
||||
small_queue->StopWorkerThreads();
|
||||
}
|
||||
|
||||
/** Test that 0 checks is correct
|
||||
*/
|
||||
BOOST_AUTO_TEST_CASE(test_CheckQueue_Correct_Zero)
|
||||
{
|
||||
std::vector<size_t> range;
|
||||
range.push_back((size_t)0);
|
||||
Correct_Queue_range(range);
|
||||
}
|
||||
/** Test that 1 check is correct
|
||||
*/
|
||||
BOOST_AUTO_TEST_CASE(test_CheckQueue_Correct_One)
|
||||
{
|
||||
std::vector<size_t> range;
|
||||
range.push_back((size_t)1);
|
||||
Correct_Queue_range(range);
|
||||
}
|
||||
/** Test that MAX check is correct
|
||||
*/
|
||||
BOOST_AUTO_TEST_CASE(test_CheckQueue_Correct_Max)
|
||||
{
|
||||
std::vector<size_t> range;
|
||||
range.push_back(100000);
|
||||
Correct_Queue_range(range);
|
||||
}
|
||||
/** Test that random numbers of checks are correct
|
||||
*/
|
||||
BOOST_AUTO_TEST_CASE(test_CheckQueue_Correct_Random)
|
||||
{
|
||||
std::vector<size_t> range;
|
||||
range.reserve(100000/1000);
|
||||
for (size_t i = 2; i < 100000; i += std::max((size_t)1, (size_t)InsecureRandRange(std::min((size_t)1000, ((size_t)100000) - i))))
|
||||
range.push_back(i);
|
||||
Correct_Queue_range(range);
|
||||
}
|
||||
|
||||
|
||||
/** Test that failing checks are caught */
|
||||
BOOST_AUTO_TEST_CASE(test_CheckQueue_Catches_Failure)
|
||||
{
|
||||
auto fail_queue = std::make_unique<Failing_Queue>(QUEUE_BATCH_SIZE);
|
||||
fail_queue->StartWorkerThreads(SCRIPT_CHECK_THREADS);
|
||||
|
||||
for (size_t i = 0; i < 1001; ++i) {
|
||||
CCheckQueueControl<FailingCheck> control(fail_queue.get());
|
||||
size_t remaining = i;
|
||||
while (remaining) {
|
||||
size_t r = InsecureRandRange(10);
|
||||
|
||||
std::vector<FailingCheck> vChecks;
|
||||
vChecks.reserve(r);
|
||||
for (size_t k = 0; k < r && remaining; k++, remaining--)
|
||||
vChecks.emplace_back(remaining == 1);
|
||||
control.Add(vChecks);
|
||||
}
|
||||
bool success = control.Wait();
|
||||
if (i > 0) {
|
||||
BOOST_REQUIRE(!success);
|
||||
} else if (i == 0) {
|
||||
BOOST_REQUIRE(success);
|
||||
}
|
||||
}
|
||||
fail_queue->StopWorkerThreads();
|
||||
}
|
||||
// Test that a block validation which fails does not interfere with
|
||||
// future blocks, ie, the bad state is cleared.
|
||||
BOOST_AUTO_TEST_CASE(test_CheckQueue_Recovers_From_Failure)
|
||||
{
|
||||
auto fail_queue = std::make_unique<Failing_Queue>(QUEUE_BATCH_SIZE);
|
||||
fail_queue->StartWorkerThreads(SCRIPT_CHECK_THREADS);
|
||||
|
||||
for (auto times = 0; times < 10; ++times) {
|
||||
for (const bool end_fails : {true, false}) {
|
||||
CCheckQueueControl<FailingCheck> control(fail_queue.get());
|
||||
{
|
||||
std::vector<FailingCheck> vChecks;
|
||||
vChecks.resize(100, false);
|
||||
vChecks[99] = end_fails;
|
||||
control.Add(vChecks);
|
||||
}
|
||||
bool r =control.Wait();
|
||||
BOOST_REQUIRE(r != end_fails);
|
||||
}
|
||||
}
|
||||
fail_queue->StopWorkerThreads();
|
||||
}
|
||||
|
||||
// Test that unique checks are actually all called individually, rather than
|
||||
// just one check being called repeatedly. Test that checks are not called
|
||||
// more than once as well
|
||||
BOOST_AUTO_TEST_CASE(test_CheckQueue_UniqueCheck)
|
||||
{
|
||||
auto queue = std::make_unique<Unique_Queue>(QUEUE_BATCH_SIZE);
|
||||
queue->StartWorkerThreads(SCRIPT_CHECK_THREADS);
|
||||
|
||||
size_t COUNT = 100000;
|
||||
size_t total = COUNT;
|
||||
{
|
||||
CCheckQueueControl<UniqueCheck> control(queue.get());
|
||||
while (total) {
|
||||
size_t r = InsecureRandRange(10);
|
||||
std::vector<UniqueCheck> vChecks;
|
||||
for (size_t k = 0; k < r && total; k++)
|
||||
vChecks.emplace_back(--total);
|
||||
control.Add(vChecks);
|
||||
}
|
||||
}
|
||||
{
|
||||
LOCK(UniqueCheck::m);
|
||||
bool r = true;
|
||||
BOOST_REQUIRE_EQUAL(UniqueCheck::results.size(), COUNT);
|
||||
for (size_t i = 0; i < COUNT; ++i) {
|
||||
r = r && UniqueCheck::results.count(i) == 1;
|
||||
}
|
||||
BOOST_REQUIRE(r);
|
||||
}
|
||||
queue->StopWorkerThreads();
|
||||
}
|
||||
|
||||
|
||||
// Test that blocks which might allocate lots of memory free their memory aggressively.
|
||||
//
|
||||
// This test attempts to catch a pathological case where by lazily freeing
|
||||
// checks might mean leaving a check un-swapped out, and decreasing by 1 each
|
||||
// time could leave the data hanging across a sequence of blocks.
|
||||
BOOST_AUTO_TEST_CASE(test_CheckQueue_Memory)
|
||||
{
|
||||
auto queue = std::make_unique<Memory_Queue>(QUEUE_BATCH_SIZE);
|
||||
queue->StartWorkerThreads(SCRIPT_CHECK_THREADS);
|
||||
for (size_t i = 0; i < 1000; ++i) {
|
||||
size_t total = i;
|
||||
{
|
||||
CCheckQueueControl<MemoryCheck> control(queue.get());
|
||||
while (total) {
|
||||
size_t r = InsecureRandRange(10);
|
||||
std::vector<MemoryCheck> vChecks;
|
||||
for (size_t k = 0; k < r && total; k++) {
|
||||
total--;
|
||||
// Each iteration leaves data at the front, back, and middle
|
||||
// to catch any sort of deallocation failure
|
||||
vChecks.emplace_back(total == 0 || total == i || total == i/2);
|
||||
}
|
||||
control.Add(vChecks);
|
||||
}
|
||||
}
|
||||
BOOST_REQUIRE_EQUAL(MemoryCheck::fake_allocated_memory, 0U);
|
||||
}
|
||||
queue->StopWorkerThreads();
|
||||
}
|
||||
|
||||
// Test that a new verification cannot occur until all checks
|
||||
// have been destructed
|
||||
BOOST_AUTO_TEST_CASE(test_CheckQueue_FrozenCleanup)
|
||||
{
|
||||
auto queue = std::make_unique<FrozenCleanup_Queue>(QUEUE_BATCH_SIZE);
|
||||
bool fails = false;
|
||||
queue->StartWorkerThreads(SCRIPT_CHECK_THREADS);
|
||||
std::thread t0([&]() {
|
||||
CCheckQueueControl<FrozenCleanupCheck> control(queue.get());
|
||||
std::vector<FrozenCleanupCheck> vChecks(1);
|
||||
// Freezing can't be the default initialized behavior given how the queue
|
||||
// swaps in default initialized Checks (otherwise freezing destructor
|
||||
// would get called twice).
|
||||
vChecks[0].should_freeze = true;
|
||||
control.Add(vChecks);
|
||||
bool waitResult = control.Wait(); // Hangs here
|
||||
assert(waitResult);
|
||||
});
|
||||
{
|
||||
std::unique_lock<std::mutex> l(FrozenCleanupCheck::m);
|
||||
// Wait until the queue has finished all jobs and frozen
|
||||
FrozenCleanupCheck::cv.wait(l, [](){return FrozenCleanupCheck::nFrozen == 1;});
|
||||
}
|
||||
// Try to get control of the queue a bunch of times
|
||||
for (auto x = 0; x < 100 && !fails; ++x) {
|
||||
fails = queue->m_control_mutex.try_lock();
|
||||
}
|
||||
{
|
||||
// Unfreeze (we need lock n case of spurious wakeup)
|
||||
std::unique_lock<std::mutex> l(FrozenCleanupCheck::m);
|
||||
FrozenCleanupCheck::nFrozen = 0;
|
||||
}
|
||||
// Awaken frozen destructor
|
||||
FrozenCleanupCheck::cv.notify_one();
|
||||
// Wait for control to finish
|
||||
t0.join();
|
||||
BOOST_REQUIRE(!fails);
|
||||
queue->StopWorkerThreads();
|
||||
}
|
||||
|
||||
|
||||
/** Test that CCheckQueueControl is threadsafe */
|
||||
BOOST_AUTO_TEST_CASE(test_CheckQueueControl_Locks)
|
||||
{
|
||||
auto queue = std::make_unique<Standard_Queue>(QUEUE_BATCH_SIZE);
|
||||
{
|
||||
std::vector<std::thread> tg;
|
||||
std::atomic<int> nThreads {0};
|
||||
std::atomic<int> fails {0};
|
||||
for (size_t i = 0; i < 3; ++i) {
|
||||
tg.emplace_back(
|
||||
[&]{
|
||||
CCheckQueueControl<FakeCheck> control(queue.get());
|
||||
// While sleeping, no other thread should execute to this point
|
||||
auto observed = ++nThreads;
|
||||
UninterruptibleSleep(std::chrono::milliseconds{10});
|
||||
fails += observed != nThreads;
|
||||
});
|
||||
}
|
||||
for (auto& thread: tg) {
|
||||
if (thread.joinable()) thread.join();
|
||||
}
|
||||
BOOST_REQUIRE_EQUAL(fails, 0);
|
||||
}
|
||||
{
|
||||
std::vector<std::thread> tg;
|
||||
std::mutex m;
|
||||
std::condition_variable cv;
|
||||
bool has_lock{false};
|
||||
bool has_tried{false};
|
||||
bool done{false};
|
||||
bool done_ack{false};
|
||||
{
|
||||
std::unique_lock<std::mutex> l(m);
|
||||
tg.emplace_back([&]{
|
||||
CCheckQueueControl<FakeCheck> control(queue.get());
|
||||
std::unique_lock<std::mutex> ll(m);
|
||||
has_lock = true;
|
||||
cv.notify_one();
|
||||
cv.wait(ll, [&]{return has_tried;});
|
||||
done = true;
|
||||
cv.notify_one();
|
||||
// Wait until the done is acknowledged
|
||||
//
|
||||
cv.wait(ll, [&]{return done_ack;});
|
||||
});
|
||||
// Wait for thread to get the lock
|
||||
cv.wait(l, [&](){return has_lock;});
|
||||
bool fails = false;
|
||||
for (auto x = 0; x < 100 && !fails; ++x) {
|
||||
fails = queue->m_control_mutex.try_lock();
|
||||
}
|
||||
has_tried = true;
|
||||
cv.notify_one();
|
||||
cv.wait(l, [&](){return done;});
|
||||
// Acknowledge the done
|
||||
done_ack = true;
|
||||
cv.notify_one();
|
||||
BOOST_REQUIRE(!fails);
|
||||
}
|
||||
for (auto& thread: tg) {
|
||||
if (thread.joinable()) thread.join();
|
||||
}
|
||||
}
|
||||
}
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
882
src/test/coins_tests.cpp
Normal file
882
src/test/coins_tests.cpp
Normal file
|
|
@ -0,0 +1,882 @@
|
|||
// Copyright (c) 2014-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <attributes.h>
|
||||
#include <clientversion.h>
|
||||
#include <coins.h>
|
||||
#include <script/standard.h>
|
||||
#include <streams.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <txdb.h>
|
||||
#include <uint256.h>
|
||||
#include <undo.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
int ApplyTxInUndo(Coin&& undo, CCoinsViewCache& view, const COutPoint& out);
|
||||
void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, CTxUndo &txundo, int nHeight);
|
||||
|
||||
namespace
|
||||
{
|
||||
//! equality test
|
||||
bool operator==(const Coin &a, const Coin &b) {
|
||||
// Empty Coin objects are always equal.
|
||||
if (a.IsSpent() && b.IsSpent()) return true;
|
||||
return a.fCoinBase == b.fCoinBase &&
|
||||
a.nHeight == b.nHeight &&
|
||||
a.out == b.out;
|
||||
}
|
||||
|
||||
class CCoinsViewTest : public CCoinsView
|
||||
{
|
||||
uint256 hashBestBlock_;
|
||||
std::map<COutPoint, Coin> map_;
|
||||
|
||||
public:
|
||||
[[nodiscard]] bool GetCoin(const COutPoint& outpoint, Coin& coin) const override
|
||||
{
|
||||
std::map<COutPoint, Coin>::const_iterator it = map_.find(outpoint);
|
||||
if (it == map_.end()) {
|
||||
return false;
|
||||
}
|
||||
coin = it->second;
|
||||
if (coin.IsSpent() && InsecureRandBool() == 0) {
|
||||
// Randomly return false in case of an empty entry.
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
uint256 GetBestBlock() const override { return hashBestBlock_; }
|
||||
|
||||
bool BatchWrite(CCoinsMap& mapCoins, const uint256& hashBlock) override
|
||||
{
|
||||
for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end(); ) {
|
||||
if (it->second.flags & CCoinsCacheEntry::DIRTY) {
|
||||
// Same optimization used in CCoinsViewDB is to only write dirty entries.
|
||||
map_[it->first] = it->second.coin;
|
||||
if (it->second.coin.IsSpent() && InsecureRandRange(3) == 0) {
|
||||
// Randomly delete empty entries on write.
|
||||
map_.erase(it->first);
|
||||
}
|
||||
}
|
||||
mapCoins.erase(it++);
|
||||
}
|
||||
if (!hashBlock.IsNull())
|
||||
hashBestBlock_ = hashBlock;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CCoinsViewCacheTest : public CCoinsViewCache
|
||||
{
|
||||
public:
|
||||
explicit CCoinsViewCacheTest(CCoinsView* _base) : CCoinsViewCache(_base) {}
|
||||
|
||||
void SelfTest() const
|
||||
{
|
||||
// Manually recompute the dynamic usage of the whole data, and compare it.
|
||||
size_t ret = memusage::DynamicUsage(cacheCoins);
|
||||
size_t count = 0;
|
||||
for (const auto& entry : cacheCoins) {
|
||||
ret += entry.second.coin.DynamicMemoryUsage();
|
||||
++count;
|
||||
}
|
||||
BOOST_CHECK_EQUAL(GetCacheSize(), count);
|
||||
BOOST_CHECK_EQUAL(DynamicMemoryUsage(), ret);
|
||||
}
|
||||
|
||||
CCoinsMap& map() const { return cacheCoins; }
|
||||
size_t& usage() const { return cachedCoinsUsage; }
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(coins_tests, BasicTestingSetup)
|
||||
|
||||
static const unsigned int NUM_SIMULATION_ITERATIONS = 40000;
|
||||
|
||||
// This is a large randomized insert/remove simulation test on a variable-size
|
||||
// stack of caches on top of CCoinsViewTest.
|
||||
//
|
||||
// It will randomly create/update/delete Coin entries to a tip of caches, with
|
||||
// txids picked from a limited list of random 256-bit hashes. Occasionally, a
|
||||
// new tip is added to the stack of caches, or the tip is flushed and removed.
|
||||
//
|
||||
// During the process, booleans are kept to make sure that the randomized
|
||||
// operation hits all branches.
|
||||
//
|
||||
// If fake_best_block is true, assign a random uint256 to mock the recording
|
||||
// of best block on flush. This is necessary when using CCoinsViewDB as the base,
|
||||
// otherwise we'll hit an assertion in BatchWrite.
|
||||
//
|
||||
void SimulationTest(CCoinsView* base, bool fake_best_block)
|
||||
{
|
||||
// Various coverage trackers.
|
||||
bool removed_all_caches = false;
|
||||
bool reached_4_caches = false;
|
||||
bool added_an_entry = false;
|
||||
bool added_an_unspendable_entry = false;
|
||||
bool removed_an_entry = false;
|
||||
bool updated_an_entry = false;
|
||||
bool found_an_entry = false;
|
||||
bool missed_an_entry = false;
|
||||
bool uncached_an_entry = false;
|
||||
|
||||
// A simple map to track what we expect the cache stack to represent.
|
||||
std::map<COutPoint, Coin> result;
|
||||
|
||||
// The cache stack.
|
||||
std::vector<CCoinsViewCacheTest*> stack; // A stack of CCoinsViewCaches on top.
|
||||
stack.push_back(new CCoinsViewCacheTest(base)); // Start with one cache.
|
||||
|
||||
// Use a limited set of random transaction ids, so we do test overwriting entries.
|
||||
std::vector<uint256> txids;
|
||||
txids.resize(NUM_SIMULATION_ITERATIONS / 8);
|
||||
for (unsigned int i = 0; i < txids.size(); i++) {
|
||||
txids[i] = InsecureRand256();
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < NUM_SIMULATION_ITERATIONS; i++) {
|
||||
// Do a random modification.
|
||||
{
|
||||
uint256 txid = txids[InsecureRandRange(txids.size())]; // txid we're going to modify in this iteration.
|
||||
Coin& coin = result[COutPoint(txid, 0)];
|
||||
|
||||
// Determine whether to test HaveCoin before or after Access* (or both). As these functions
|
||||
// can influence each other's behaviour by pulling things into the cache, all combinations
|
||||
// are tested.
|
||||
bool test_havecoin_before = InsecureRandBits(2) == 0;
|
||||
bool test_havecoin_after = InsecureRandBits(2) == 0;
|
||||
|
||||
bool result_havecoin = test_havecoin_before ? stack.back()->HaveCoin(COutPoint(txid, 0)) : false;
|
||||
const Coin& entry = (InsecureRandRange(500) == 0) ? AccessByTxid(*stack.back(), txid) : stack.back()->AccessCoin(COutPoint(txid, 0));
|
||||
BOOST_CHECK(coin == entry);
|
||||
BOOST_CHECK(!test_havecoin_before || result_havecoin == !entry.IsSpent());
|
||||
|
||||
if (test_havecoin_after) {
|
||||
bool ret = stack.back()->HaveCoin(COutPoint(txid, 0));
|
||||
BOOST_CHECK(ret == !entry.IsSpent());
|
||||
}
|
||||
|
||||
if (InsecureRandRange(5) == 0 || coin.IsSpent()) {
|
||||
Coin newcoin;
|
||||
newcoin.out.nValue = InsecureRand32();
|
||||
newcoin.nHeight = 1;
|
||||
if (InsecureRandRange(16) == 0 && coin.IsSpent()) {
|
||||
newcoin.out.scriptPubKey.assign(1 + InsecureRandBits(6), OP_RETURN);
|
||||
BOOST_CHECK(newcoin.out.scriptPubKey.IsUnspendable());
|
||||
added_an_unspendable_entry = true;
|
||||
} else {
|
||||
newcoin.out.scriptPubKey.assign(InsecureRandBits(6), 0); // Random sizes so we can test memory usage accounting
|
||||
(coin.IsSpent() ? added_an_entry : updated_an_entry) = true;
|
||||
coin = newcoin;
|
||||
}
|
||||
stack.back()->AddCoin(COutPoint(txid, 0), std::move(newcoin), !coin.IsSpent() || InsecureRand32() & 1);
|
||||
} else {
|
||||
removed_an_entry = true;
|
||||
coin.Clear();
|
||||
BOOST_CHECK(stack.back()->SpendCoin(COutPoint(txid, 0)));
|
||||
}
|
||||
}
|
||||
|
||||
// One every 10 iterations, remove a random entry from the cache
|
||||
if (InsecureRandRange(10) == 0) {
|
||||
COutPoint out(txids[InsecureRand32() % txids.size()], 0);
|
||||
int cacheid = InsecureRand32() % stack.size();
|
||||
stack[cacheid]->Uncache(out);
|
||||
uncached_an_entry |= !stack[cacheid]->HaveCoinInCache(out);
|
||||
}
|
||||
|
||||
// Once every 1000 iterations and at the end, verify the full cache.
|
||||
if (InsecureRandRange(1000) == 1 || i == NUM_SIMULATION_ITERATIONS - 1) {
|
||||
for (const auto& entry : result) {
|
||||
bool have = stack.back()->HaveCoin(entry.first);
|
||||
const Coin& coin = stack.back()->AccessCoin(entry.first);
|
||||
BOOST_CHECK(have == !coin.IsSpent());
|
||||
BOOST_CHECK(coin == entry.second);
|
||||
if (coin.IsSpent()) {
|
||||
missed_an_entry = true;
|
||||
} else {
|
||||
BOOST_CHECK(stack.back()->HaveCoinInCache(entry.first));
|
||||
found_an_entry = true;
|
||||
}
|
||||
}
|
||||
for (const CCoinsViewCacheTest *test : stack) {
|
||||
test->SelfTest();
|
||||
}
|
||||
}
|
||||
|
||||
if (InsecureRandRange(100) == 0) {
|
||||
// Every 100 iterations, flush an intermediate cache
|
||||
if (stack.size() > 1 && InsecureRandBool() == 0) {
|
||||
unsigned int flushIndex = InsecureRandRange(stack.size() - 1);
|
||||
if (fake_best_block) stack[flushIndex]->SetBestBlock(InsecureRand256());
|
||||
BOOST_CHECK(stack[flushIndex]->Flush());
|
||||
}
|
||||
}
|
||||
if (InsecureRandRange(100) == 0) {
|
||||
// Every 100 iterations, change the cache stack.
|
||||
if (stack.size() > 0 && InsecureRandBool() == 0) {
|
||||
//Remove the top cache
|
||||
if (fake_best_block) stack.back()->SetBestBlock(InsecureRand256());
|
||||
BOOST_CHECK(stack.back()->Flush());
|
||||
delete stack.back();
|
||||
stack.pop_back();
|
||||
}
|
||||
if (stack.size() == 0 || (stack.size() < 4 && InsecureRandBool())) {
|
||||
//Add a new cache
|
||||
CCoinsView* tip = base;
|
||||
if (stack.size() > 0) {
|
||||
tip = stack.back();
|
||||
} else {
|
||||
removed_all_caches = true;
|
||||
}
|
||||
stack.push_back(new CCoinsViewCacheTest(tip));
|
||||
if (stack.size() == 4) {
|
||||
reached_4_caches = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Clean up the stack.
|
||||
while (stack.size() > 0) {
|
||||
delete stack.back();
|
||||
stack.pop_back();
|
||||
}
|
||||
|
||||
// Verify coverage.
|
||||
BOOST_CHECK(removed_all_caches);
|
||||
BOOST_CHECK(reached_4_caches);
|
||||
BOOST_CHECK(added_an_entry);
|
||||
BOOST_CHECK(added_an_unspendable_entry);
|
||||
BOOST_CHECK(removed_an_entry);
|
||||
BOOST_CHECK(updated_an_entry);
|
||||
BOOST_CHECK(found_an_entry);
|
||||
BOOST_CHECK(missed_an_entry);
|
||||
BOOST_CHECK(uncached_an_entry);
|
||||
}
|
||||
|
||||
// Run the above simulation for multiple base types.
|
||||
BOOST_AUTO_TEST_CASE(coins_cache_simulation_test)
|
||||
{
|
||||
CCoinsViewTest base;
|
||||
SimulationTest(&base, false);
|
||||
|
||||
CCoinsViewDB db_base{"test", /*nCacheSize*/ 1 << 23, /*fMemory*/ true, /*fWipe*/ false};
|
||||
SimulationTest(&db_base, true);
|
||||
}
|
||||
|
||||
// Store of all necessary tx and undo data for next test
|
||||
typedef std::map<COutPoint, std::tuple<CTransaction,CTxUndo,Coin>> UtxoData;
|
||||
UtxoData utxoData;
|
||||
|
||||
UtxoData::iterator FindRandomFrom(const std::set<COutPoint> &utxoSet) {
|
||||
assert(utxoSet.size());
|
||||
auto utxoSetIt = utxoSet.lower_bound(COutPoint(InsecureRand256(), 0));
|
||||
if (utxoSetIt == utxoSet.end()) {
|
||||
utxoSetIt = utxoSet.begin();
|
||||
}
|
||||
auto utxoDataIt = utxoData.find(*utxoSetIt);
|
||||
assert(utxoDataIt != utxoData.end());
|
||||
return utxoDataIt;
|
||||
}
|
||||
|
||||
|
||||
// This test is similar to the previous test
|
||||
// except the emphasis is on testing the functionality of UpdateCoins
|
||||
// random txs are created and UpdateCoins is used to update the cache stack
|
||||
// In particular it is tested that spending a duplicate coinbase tx
|
||||
// has the expected effect (the other duplicate is overwritten at all cache levels)
|
||||
BOOST_AUTO_TEST_CASE(updatecoins_simulation_test)
|
||||
{
|
||||
SeedInsecureRand(SeedRand::ZEROS);
|
||||
g_mock_deterministic_tests = true;
|
||||
|
||||
bool spent_a_duplicate_coinbase = false;
|
||||
// A simple map to track what we expect the cache stack to represent.
|
||||
std::map<COutPoint, Coin> result;
|
||||
|
||||
// The cache stack.
|
||||
CCoinsViewTest base; // A CCoinsViewTest at the bottom.
|
||||
std::vector<CCoinsViewCacheTest*> stack; // A stack of CCoinsViewCaches on top.
|
||||
stack.push_back(new CCoinsViewCacheTest(&base)); // Start with one cache.
|
||||
|
||||
// Track the txids we've used in various sets
|
||||
std::set<COutPoint> coinbase_coins;
|
||||
std::set<COutPoint> disconnected_coins;
|
||||
std::set<COutPoint> duplicate_coins;
|
||||
std::set<COutPoint> utxoset;
|
||||
|
||||
for (unsigned int i = 0; i < NUM_SIMULATION_ITERATIONS; i++) {
|
||||
uint32_t randiter = InsecureRand32();
|
||||
|
||||
// 19/20 txs add a new transaction
|
||||
if (randiter % 20 < 19) {
|
||||
CMutableTransaction tx;
|
||||
tx.vin.resize(1);
|
||||
tx.vout.resize(1);
|
||||
tx.vout[0].nValue = i; //Keep txs unique unless intended to duplicate
|
||||
tx.vout[0].scriptPubKey.assign(InsecureRand32() & 0x3F, 0); // Random sizes so we can test memory usage accounting
|
||||
unsigned int height = InsecureRand32();
|
||||
Coin old_coin;
|
||||
|
||||
// 2/20 times create a new coinbase
|
||||
if (randiter % 20 < 2 || coinbase_coins.size() < 10) {
|
||||
// 1/10 of those times create a duplicate coinbase
|
||||
if (InsecureRandRange(10) == 0 && coinbase_coins.size()) {
|
||||
auto utxod = FindRandomFrom(coinbase_coins);
|
||||
// Reuse the exact same coinbase
|
||||
tx = CMutableTransaction{std::get<0>(utxod->second)};
|
||||
// shouldn't be available for reconnection if it's been duplicated
|
||||
disconnected_coins.erase(utxod->first);
|
||||
|
||||
duplicate_coins.insert(utxod->first);
|
||||
}
|
||||
else {
|
||||
coinbase_coins.insert(COutPoint(tx.GetHash(), 0));
|
||||
}
|
||||
assert(CTransaction(tx).IsCoinBase());
|
||||
}
|
||||
|
||||
// 17/20 times reconnect previous or add a regular tx
|
||||
else {
|
||||
|
||||
COutPoint prevout;
|
||||
// 1/20 times reconnect a previously disconnected tx
|
||||
if (randiter % 20 == 2 && disconnected_coins.size()) {
|
||||
auto utxod = FindRandomFrom(disconnected_coins);
|
||||
tx = CMutableTransaction{std::get<0>(utxod->second)};
|
||||
prevout = tx.vin[0].prevout;
|
||||
if (!CTransaction(tx).IsCoinBase() && !utxoset.count(prevout)) {
|
||||
disconnected_coins.erase(utxod->first);
|
||||
continue;
|
||||
}
|
||||
|
||||
// If this tx is already IN the UTXO, then it must be a coinbase, and it must be a duplicate
|
||||
if (utxoset.count(utxod->first)) {
|
||||
assert(CTransaction(tx).IsCoinBase());
|
||||
assert(duplicate_coins.count(utxod->first));
|
||||
}
|
||||
disconnected_coins.erase(utxod->first);
|
||||
}
|
||||
|
||||
// 16/20 times create a regular tx
|
||||
else {
|
||||
auto utxod = FindRandomFrom(utxoset);
|
||||
prevout = utxod->first;
|
||||
|
||||
// Construct the tx to spend the coins of prevouthash
|
||||
tx.vin[0].prevout = prevout;
|
||||
assert(!CTransaction(tx).IsCoinBase());
|
||||
}
|
||||
// In this simple test coins only have two states, spent or unspent, save the unspent state to restore
|
||||
old_coin = result[prevout];
|
||||
// Update the expected result of prevouthash to know these coins are spent
|
||||
result[prevout].Clear();
|
||||
|
||||
utxoset.erase(prevout);
|
||||
|
||||
// The test is designed to ensure spending a duplicate coinbase will work properly
|
||||
// if that ever happens and not resurrect the previously overwritten coinbase
|
||||
if (duplicate_coins.count(prevout)) {
|
||||
spent_a_duplicate_coinbase = true;
|
||||
}
|
||||
|
||||
}
|
||||
// Update the expected result to know about the new output coins
|
||||
assert(tx.vout.size() == 1);
|
||||
const COutPoint outpoint(tx.GetHash(), 0);
|
||||
result[outpoint] = Coin(tx.vout[0], height, CTransaction(tx).IsCoinBase());
|
||||
|
||||
// Call UpdateCoins on the top cache
|
||||
CTxUndo undo;
|
||||
UpdateCoins(CTransaction(tx), *(stack.back()), undo, height);
|
||||
|
||||
// Update the utxo set for future spends
|
||||
utxoset.insert(outpoint);
|
||||
|
||||
// Track this tx and undo info to use later
|
||||
utxoData.emplace(outpoint, std::make_tuple(tx,undo,old_coin));
|
||||
} else if (utxoset.size()) {
|
||||
//1/20 times undo a previous transaction
|
||||
auto utxod = FindRandomFrom(utxoset);
|
||||
|
||||
CTransaction &tx = std::get<0>(utxod->second);
|
||||
CTxUndo &undo = std::get<1>(utxod->second);
|
||||
Coin &orig_coin = std::get<2>(utxod->second);
|
||||
|
||||
// Update the expected result
|
||||
// Remove new outputs
|
||||
result[utxod->first].Clear();
|
||||
// If not coinbase restore prevout
|
||||
if (!tx.IsCoinBase()) {
|
||||
result[tx.vin[0].prevout] = orig_coin;
|
||||
}
|
||||
|
||||
// Disconnect the tx from the current UTXO
|
||||
// See code in DisconnectBlock
|
||||
// remove outputs
|
||||
BOOST_CHECK(stack.back()->SpendCoin(utxod->first));
|
||||
// restore inputs
|
||||
if (!tx.IsCoinBase()) {
|
||||
const COutPoint &out = tx.vin[0].prevout;
|
||||
Coin coin = undo.vprevout[0];
|
||||
ApplyTxInUndo(std::move(coin), *(stack.back()), out);
|
||||
}
|
||||
// Store as a candidate for reconnection
|
||||
disconnected_coins.insert(utxod->first);
|
||||
|
||||
// Update the utxoset
|
||||
utxoset.erase(utxod->first);
|
||||
if (!tx.IsCoinBase())
|
||||
utxoset.insert(tx.vin[0].prevout);
|
||||
}
|
||||
|
||||
// Once every 1000 iterations and at the end, verify the full cache.
|
||||
if (InsecureRandRange(1000) == 1 || i == NUM_SIMULATION_ITERATIONS - 1) {
|
||||
for (const auto& entry : result) {
|
||||
bool have = stack.back()->HaveCoin(entry.first);
|
||||
const Coin& coin = stack.back()->AccessCoin(entry.first);
|
||||
BOOST_CHECK(have == !coin.IsSpent());
|
||||
BOOST_CHECK(coin == entry.second);
|
||||
}
|
||||
}
|
||||
|
||||
// One every 10 iterations, remove a random entry from the cache
|
||||
if (utxoset.size() > 1 && InsecureRandRange(30) == 0) {
|
||||
stack[InsecureRand32() % stack.size()]->Uncache(FindRandomFrom(utxoset)->first);
|
||||
}
|
||||
if (disconnected_coins.size() > 1 && InsecureRandRange(30) == 0) {
|
||||
stack[InsecureRand32() % stack.size()]->Uncache(FindRandomFrom(disconnected_coins)->first);
|
||||
}
|
||||
if (duplicate_coins.size() > 1 && InsecureRandRange(30) == 0) {
|
||||
stack[InsecureRand32() % stack.size()]->Uncache(FindRandomFrom(duplicate_coins)->first);
|
||||
}
|
||||
|
||||
if (InsecureRandRange(100) == 0) {
|
||||
// Every 100 iterations, flush an intermediate cache
|
||||
if (stack.size() > 1 && InsecureRandBool() == 0) {
|
||||
unsigned int flushIndex = InsecureRandRange(stack.size() - 1);
|
||||
BOOST_CHECK(stack[flushIndex]->Flush());
|
||||
}
|
||||
}
|
||||
if (InsecureRandRange(100) == 0) {
|
||||
// Every 100 iterations, change the cache stack.
|
||||
if (stack.size() > 0 && InsecureRandBool() == 0) {
|
||||
BOOST_CHECK(stack.back()->Flush());
|
||||
delete stack.back();
|
||||
stack.pop_back();
|
||||
}
|
||||
if (stack.size() == 0 || (stack.size() < 4 && InsecureRandBool())) {
|
||||
CCoinsView* tip = &base;
|
||||
if (stack.size() > 0) {
|
||||
tip = stack.back();
|
||||
}
|
||||
stack.push_back(new CCoinsViewCacheTest(tip));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Clean up the stack.
|
||||
while (stack.size() > 0) {
|
||||
delete stack.back();
|
||||
stack.pop_back();
|
||||
}
|
||||
|
||||
// Verify coverage.
|
||||
BOOST_CHECK(spent_a_duplicate_coinbase);
|
||||
|
||||
g_mock_deterministic_tests = false;
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ccoins_serialization)
|
||||
{
|
||||
// Good example
|
||||
CDataStream ss1(ParseHex("97f23c835800816115944e077fe7c803cfa57f29b36bf87c1d35"), SER_DISK, CLIENT_VERSION);
|
||||
Coin cc1;
|
||||
ss1 >> cc1;
|
||||
BOOST_CHECK_EQUAL(cc1.fCoinBase, false);
|
||||
BOOST_CHECK_EQUAL(cc1.nHeight, 203998U);
|
||||
BOOST_CHECK_EQUAL(cc1.out.nValue, CAmount{60000000000});
|
||||
BOOST_CHECK_EQUAL(HexStr(cc1.out.scriptPubKey), HexStr(GetScriptForDestination(PKHash(uint160(ParseHex("816115944e077fe7c803cfa57f29b36bf87c1d35"))))));
|
||||
|
||||
// Good example
|
||||
CDataStream ss2(ParseHex("8ddf77bbd123008c988f1a4a4de2161e0f50aac7f17e7f9555caa4"), SER_DISK, CLIENT_VERSION);
|
||||
Coin cc2;
|
||||
ss2 >> cc2;
|
||||
BOOST_CHECK_EQUAL(cc2.fCoinBase, true);
|
||||
BOOST_CHECK_EQUAL(cc2.nHeight, 120891U);
|
||||
BOOST_CHECK_EQUAL(cc2.out.nValue, 110397);
|
||||
BOOST_CHECK_EQUAL(HexStr(cc2.out.scriptPubKey), HexStr(GetScriptForDestination(PKHash(uint160(ParseHex("8c988f1a4a4de2161e0f50aac7f17e7f9555caa4"))))));
|
||||
|
||||
// Smallest possible example
|
||||
CDataStream ss3(ParseHex("000006"), SER_DISK, CLIENT_VERSION);
|
||||
Coin cc3;
|
||||
ss3 >> cc3;
|
||||
BOOST_CHECK_EQUAL(cc3.fCoinBase, false);
|
||||
BOOST_CHECK_EQUAL(cc3.nHeight, 0U);
|
||||
BOOST_CHECK_EQUAL(cc3.out.nValue, 0);
|
||||
BOOST_CHECK_EQUAL(cc3.out.scriptPubKey.size(), 0U);
|
||||
|
||||
// scriptPubKey that ends beyond the end of the stream
|
||||
CDataStream ss4(ParseHex("000007"), SER_DISK, CLIENT_VERSION);
|
||||
try {
|
||||
Coin cc4;
|
||||
ss4 >> cc4;
|
||||
BOOST_CHECK_MESSAGE(false, "We should have thrown");
|
||||
} catch (const std::ios_base::failure&) {
|
||||
}
|
||||
|
||||
// Very large scriptPubKey (3*10^9 bytes) past the end of the stream
|
||||
CDataStream tmp(SER_DISK, CLIENT_VERSION);
|
||||
uint64_t x = 3000000000ULL;
|
||||
tmp << VARINT(x);
|
||||
BOOST_CHECK_EQUAL(HexStr(tmp), "8a95c0bb00");
|
||||
CDataStream ss5(ParseHex("00008a95c0bb00"), SER_DISK, CLIENT_VERSION);
|
||||
try {
|
||||
Coin cc5;
|
||||
ss5 >> cc5;
|
||||
BOOST_CHECK_MESSAGE(false, "We should have thrown");
|
||||
} catch (const std::ios_base::failure&) {
|
||||
}
|
||||
}
|
||||
|
||||
const static COutPoint OUTPOINT;
|
||||
const static CAmount SPENT = -1;
|
||||
const static CAmount ABSENT = -2;
|
||||
const static CAmount FAIL = -3;
|
||||
const static CAmount VALUE1 = 100;
|
||||
const static CAmount VALUE2 = 200;
|
||||
const static CAmount VALUE3 = 300;
|
||||
const static char DIRTY = CCoinsCacheEntry::DIRTY;
|
||||
const static char FRESH = CCoinsCacheEntry::FRESH;
|
||||
const static char NO_ENTRY = -1;
|
||||
|
||||
const static auto FLAGS = {char(0), FRESH, DIRTY, char(DIRTY | FRESH)};
|
||||
const static auto CLEAN_FLAGS = {char(0), FRESH};
|
||||
const static auto ABSENT_FLAGS = {NO_ENTRY};
|
||||
|
||||
static void SetCoinsValue(CAmount value, Coin& coin)
|
||||
{
|
||||
assert(value != ABSENT);
|
||||
coin.Clear();
|
||||
assert(coin.IsSpent());
|
||||
if (value != SPENT) {
|
||||
coin.out.nValue = value;
|
||||
coin.nHeight = 1;
|
||||
assert(!coin.IsSpent());
|
||||
}
|
||||
}
|
||||
|
||||
static size_t InsertCoinsMapEntry(CCoinsMap& map, CAmount value, char flags)
|
||||
{
|
||||
if (value == ABSENT) {
|
||||
assert(flags == NO_ENTRY);
|
||||
return 0;
|
||||
}
|
||||
assert(flags != NO_ENTRY);
|
||||
CCoinsCacheEntry entry;
|
||||
entry.flags = flags;
|
||||
SetCoinsValue(value, entry.coin);
|
||||
auto inserted = map.emplace(OUTPOINT, std::move(entry));
|
||||
assert(inserted.second);
|
||||
return inserted.first->second.coin.DynamicMemoryUsage();
|
||||
}
|
||||
|
||||
void GetCoinsMapEntry(const CCoinsMap& map, CAmount& value, char& flags)
|
||||
{
|
||||
auto it = map.find(OUTPOINT);
|
||||
if (it == map.end()) {
|
||||
value = ABSENT;
|
||||
flags = NO_ENTRY;
|
||||
} else {
|
||||
if (it->second.coin.IsSpent()) {
|
||||
value = SPENT;
|
||||
} else {
|
||||
value = it->second.coin.out.nValue;
|
||||
}
|
||||
flags = it->second.flags;
|
||||
assert(flags != NO_ENTRY);
|
||||
}
|
||||
}
|
||||
|
||||
void WriteCoinsViewEntry(CCoinsView& view, CAmount value, char flags)
|
||||
{
|
||||
CCoinsMap map;
|
||||
InsertCoinsMapEntry(map, value, flags);
|
||||
BOOST_CHECK(view.BatchWrite(map, {}));
|
||||
}
|
||||
|
||||
class SingleEntryCacheTest
|
||||
{
|
||||
public:
|
||||
SingleEntryCacheTest(CAmount base_value, CAmount cache_value, char cache_flags)
|
||||
{
|
||||
WriteCoinsViewEntry(base, base_value, base_value == ABSENT ? NO_ENTRY : DIRTY);
|
||||
cache.usage() += InsertCoinsMapEntry(cache.map(), cache_value, cache_flags);
|
||||
}
|
||||
|
||||
CCoinsView root;
|
||||
CCoinsViewCacheTest base{&root};
|
||||
CCoinsViewCacheTest cache{&base};
|
||||
};
|
||||
|
||||
static void CheckAccessCoin(CAmount base_value, CAmount cache_value, CAmount expected_value, char cache_flags, char expected_flags)
|
||||
{
|
||||
SingleEntryCacheTest test(base_value, cache_value, cache_flags);
|
||||
test.cache.AccessCoin(OUTPOINT);
|
||||
test.cache.SelfTest();
|
||||
|
||||
CAmount result_value;
|
||||
char result_flags;
|
||||
GetCoinsMapEntry(test.cache.map(), result_value, result_flags);
|
||||
BOOST_CHECK_EQUAL(result_value, expected_value);
|
||||
BOOST_CHECK_EQUAL(result_flags, expected_flags);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ccoins_access)
|
||||
{
|
||||
/* Check AccessCoin behavior, requesting a coin from a cache view layered on
|
||||
* top of a base view, and checking the resulting entry in the cache after
|
||||
* the access.
|
||||
*
|
||||
* Base Cache Result Cache Result
|
||||
* Value Value Value Flags Flags
|
||||
*/
|
||||
CheckAccessCoin(ABSENT, ABSENT, ABSENT, NO_ENTRY , NO_ENTRY );
|
||||
CheckAccessCoin(ABSENT, SPENT , SPENT , 0 , 0 );
|
||||
CheckAccessCoin(ABSENT, SPENT , SPENT , FRESH , FRESH );
|
||||
CheckAccessCoin(ABSENT, SPENT , SPENT , DIRTY , DIRTY );
|
||||
CheckAccessCoin(ABSENT, SPENT , SPENT , DIRTY|FRESH, DIRTY|FRESH);
|
||||
CheckAccessCoin(ABSENT, VALUE2, VALUE2, 0 , 0 );
|
||||
CheckAccessCoin(ABSENT, VALUE2, VALUE2, FRESH , FRESH );
|
||||
CheckAccessCoin(ABSENT, VALUE2, VALUE2, DIRTY , DIRTY );
|
||||
CheckAccessCoin(ABSENT, VALUE2, VALUE2, DIRTY|FRESH, DIRTY|FRESH);
|
||||
CheckAccessCoin(SPENT , ABSENT, ABSENT, NO_ENTRY , NO_ENTRY );
|
||||
CheckAccessCoin(SPENT , SPENT , SPENT , 0 , 0 );
|
||||
CheckAccessCoin(SPENT , SPENT , SPENT , FRESH , FRESH );
|
||||
CheckAccessCoin(SPENT , SPENT , SPENT , DIRTY , DIRTY );
|
||||
CheckAccessCoin(SPENT , SPENT , SPENT , DIRTY|FRESH, DIRTY|FRESH);
|
||||
CheckAccessCoin(SPENT , VALUE2, VALUE2, 0 , 0 );
|
||||
CheckAccessCoin(SPENT , VALUE2, VALUE2, FRESH , FRESH );
|
||||
CheckAccessCoin(SPENT , VALUE2, VALUE2, DIRTY , DIRTY );
|
||||
CheckAccessCoin(SPENT , VALUE2, VALUE2, DIRTY|FRESH, DIRTY|FRESH);
|
||||
CheckAccessCoin(VALUE1, ABSENT, VALUE1, NO_ENTRY , 0 );
|
||||
CheckAccessCoin(VALUE1, SPENT , SPENT , 0 , 0 );
|
||||
CheckAccessCoin(VALUE1, SPENT , SPENT , FRESH , FRESH );
|
||||
CheckAccessCoin(VALUE1, SPENT , SPENT , DIRTY , DIRTY );
|
||||
CheckAccessCoin(VALUE1, SPENT , SPENT , DIRTY|FRESH, DIRTY|FRESH);
|
||||
CheckAccessCoin(VALUE1, VALUE2, VALUE2, 0 , 0 );
|
||||
CheckAccessCoin(VALUE1, VALUE2, VALUE2, FRESH , FRESH );
|
||||
CheckAccessCoin(VALUE1, VALUE2, VALUE2, DIRTY , DIRTY );
|
||||
CheckAccessCoin(VALUE1, VALUE2, VALUE2, DIRTY|FRESH, DIRTY|FRESH);
|
||||
}
|
||||
|
||||
static void CheckSpendCoins(CAmount base_value, CAmount cache_value, CAmount expected_value, char cache_flags, char expected_flags)
|
||||
{
|
||||
SingleEntryCacheTest test(base_value, cache_value, cache_flags);
|
||||
test.cache.SpendCoin(OUTPOINT);
|
||||
test.cache.SelfTest();
|
||||
|
||||
CAmount result_value;
|
||||
char result_flags;
|
||||
GetCoinsMapEntry(test.cache.map(), result_value, result_flags);
|
||||
BOOST_CHECK_EQUAL(result_value, expected_value);
|
||||
BOOST_CHECK_EQUAL(result_flags, expected_flags);
|
||||
};
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ccoins_spend)
|
||||
{
|
||||
/* Check SpendCoin behavior, requesting a coin from a cache view layered on
|
||||
* top of a base view, spending, and then checking
|
||||
* the resulting entry in the cache after the modification.
|
||||
*
|
||||
* Base Cache Result Cache Result
|
||||
* Value Value Value Flags Flags
|
||||
*/
|
||||
CheckSpendCoins(ABSENT, ABSENT, ABSENT, NO_ENTRY , NO_ENTRY );
|
||||
CheckSpendCoins(ABSENT, SPENT , SPENT , 0 , DIRTY );
|
||||
CheckSpendCoins(ABSENT, SPENT , ABSENT, FRESH , NO_ENTRY );
|
||||
CheckSpendCoins(ABSENT, SPENT , SPENT , DIRTY , DIRTY );
|
||||
CheckSpendCoins(ABSENT, SPENT , ABSENT, DIRTY|FRESH, NO_ENTRY );
|
||||
CheckSpendCoins(ABSENT, VALUE2, SPENT , 0 , DIRTY );
|
||||
CheckSpendCoins(ABSENT, VALUE2, ABSENT, FRESH , NO_ENTRY );
|
||||
CheckSpendCoins(ABSENT, VALUE2, SPENT , DIRTY , DIRTY );
|
||||
CheckSpendCoins(ABSENT, VALUE2, ABSENT, DIRTY|FRESH, NO_ENTRY );
|
||||
CheckSpendCoins(SPENT , ABSENT, ABSENT, NO_ENTRY , NO_ENTRY );
|
||||
CheckSpendCoins(SPENT , SPENT , SPENT , 0 , DIRTY );
|
||||
CheckSpendCoins(SPENT , SPENT , ABSENT, FRESH , NO_ENTRY );
|
||||
CheckSpendCoins(SPENT , SPENT , SPENT , DIRTY , DIRTY );
|
||||
CheckSpendCoins(SPENT , SPENT , ABSENT, DIRTY|FRESH, NO_ENTRY );
|
||||
CheckSpendCoins(SPENT , VALUE2, SPENT , 0 , DIRTY );
|
||||
CheckSpendCoins(SPENT , VALUE2, ABSENT, FRESH , NO_ENTRY );
|
||||
CheckSpendCoins(SPENT , VALUE2, SPENT , DIRTY , DIRTY );
|
||||
CheckSpendCoins(SPENT , VALUE2, ABSENT, DIRTY|FRESH, NO_ENTRY );
|
||||
CheckSpendCoins(VALUE1, ABSENT, SPENT , NO_ENTRY , DIRTY );
|
||||
CheckSpendCoins(VALUE1, SPENT , SPENT , 0 , DIRTY );
|
||||
CheckSpendCoins(VALUE1, SPENT , ABSENT, FRESH , NO_ENTRY );
|
||||
CheckSpendCoins(VALUE1, SPENT , SPENT , DIRTY , DIRTY );
|
||||
CheckSpendCoins(VALUE1, SPENT , ABSENT, DIRTY|FRESH, NO_ENTRY );
|
||||
CheckSpendCoins(VALUE1, VALUE2, SPENT , 0 , DIRTY );
|
||||
CheckSpendCoins(VALUE1, VALUE2, ABSENT, FRESH , NO_ENTRY );
|
||||
CheckSpendCoins(VALUE1, VALUE2, SPENT , DIRTY , DIRTY );
|
||||
CheckSpendCoins(VALUE1, VALUE2, ABSENT, DIRTY|FRESH, NO_ENTRY );
|
||||
}
|
||||
|
||||
static void CheckAddCoinBase(CAmount base_value, CAmount cache_value, CAmount modify_value, CAmount expected_value, char cache_flags, char expected_flags, bool coinbase)
|
||||
{
|
||||
SingleEntryCacheTest test(base_value, cache_value, cache_flags);
|
||||
|
||||
CAmount result_value;
|
||||
char result_flags;
|
||||
try {
|
||||
CTxOut output;
|
||||
output.nValue = modify_value;
|
||||
test.cache.AddCoin(OUTPOINT, Coin(std::move(output), 1, coinbase), coinbase);
|
||||
test.cache.SelfTest();
|
||||
GetCoinsMapEntry(test.cache.map(), result_value, result_flags);
|
||||
} catch (std::logic_error&) {
|
||||
result_value = FAIL;
|
||||
result_flags = NO_ENTRY;
|
||||
}
|
||||
|
||||
BOOST_CHECK_EQUAL(result_value, expected_value);
|
||||
BOOST_CHECK_EQUAL(result_flags, expected_flags);
|
||||
}
|
||||
|
||||
// Simple wrapper for CheckAddCoinBase function above that loops through
|
||||
// different possible base_values, making sure each one gives the same results.
|
||||
// This wrapper lets the coins_add test below be shorter and less repetitive,
|
||||
// while still verifying that the CoinsViewCache::AddCoin implementation
|
||||
// ignores base values.
|
||||
template <typename... Args>
|
||||
static void CheckAddCoin(Args&&... args)
|
||||
{
|
||||
for (const CAmount base_value : {ABSENT, SPENT, VALUE1})
|
||||
CheckAddCoinBase(base_value, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ccoins_add)
|
||||
{
|
||||
/* Check AddCoin behavior, requesting a new coin from a cache view,
|
||||
* writing a modification to the coin, and then checking the resulting
|
||||
* entry in the cache after the modification. Verify behavior with the
|
||||
* AddCoin possible_overwrite argument set to false, and to true.
|
||||
*
|
||||
* Cache Write Result Cache Result possible_overwrite
|
||||
* Value Value Value Flags Flags
|
||||
*/
|
||||
CheckAddCoin(ABSENT, VALUE3, VALUE3, NO_ENTRY , DIRTY|FRESH, false);
|
||||
CheckAddCoin(ABSENT, VALUE3, VALUE3, NO_ENTRY , DIRTY , true );
|
||||
CheckAddCoin(SPENT , VALUE3, VALUE3, 0 , DIRTY|FRESH, false);
|
||||
CheckAddCoin(SPENT , VALUE3, VALUE3, 0 , DIRTY , true );
|
||||
CheckAddCoin(SPENT , VALUE3, VALUE3, FRESH , DIRTY|FRESH, false);
|
||||
CheckAddCoin(SPENT , VALUE3, VALUE3, FRESH , DIRTY|FRESH, true );
|
||||
CheckAddCoin(SPENT , VALUE3, VALUE3, DIRTY , DIRTY , false);
|
||||
CheckAddCoin(SPENT , VALUE3, VALUE3, DIRTY , DIRTY , true );
|
||||
CheckAddCoin(SPENT , VALUE3, VALUE3, DIRTY|FRESH, DIRTY|FRESH, false);
|
||||
CheckAddCoin(SPENT , VALUE3, VALUE3, DIRTY|FRESH, DIRTY|FRESH, true );
|
||||
CheckAddCoin(VALUE2, VALUE3, FAIL , 0 , NO_ENTRY , false);
|
||||
CheckAddCoin(VALUE2, VALUE3, VALUE3, 0 , DIRTY , true );
|
||||
CheckAddCoin(VALUE2, VALUE3, FAIL , FRESH , NO_ENTRY , false);
|
||||
CheckAddCoin(VALUE2, VALUE3, VALUE3, FRESH , DIRTY|FRESH, true );
|
||||
CheckAddCoin(VALUE2, VALUE3, FAIL , DIRTY , NO_ENTRY , false);
|
||||
CheckAddCoin(VALUE2, VALUE3, VALUE3, DIRTY , DIRTY , true );
|
||||
CheckAddCoin(VALUE2, VALUE3, FAIL , DIRTY|FRESH, NO_ENTRY , false);
|
||||
CheckAddCoin(VALUE2, VALUE3, VALUE3, DIRTY|FRESH, DIRTY|FRESH, true );
|
||||
}
|
||||
|
||||
void CheckWriteCoins(CAmount parent_value, CAmount child_value, CAmount expected_value, char parent_flags, char child_flags, char expected_flags)
|
||||
{
|
||||
SingleEntryCacheTest test(ABSENT, parent_value, parent_flags);
|
||||
|
||||
CAmount result_value;
|
||||
char result_flags;
|
||||
try {
|
||||
WriteCoinsViewEntry(test.cache, child_value, child_flags);
|
||||
test.cache.SelfTest();
|
||||
GetCoinsMapEntry(test.cache.map(), result_value, result_flags);
|
||||
} catch (std::logic_error&) {
|
||||
result_value = FAIL;
|
||||
result_flags = NO_ENTRY;
|
||||
}
|
||||
|
||||
BOOST_CHECK_EQUAL(result_value, expected_value);
|
||||
BOOST_CHECK_EQUAL(result_flags, expected_flags);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ccoins_write)
|
||||
{
|
||||
/* Check BatchWrite behavior, flushing one entry from a child cache to a
|
||||
* parent cache, and checking the resulting entry in the parent cache
|
||||
* after the write.
|
||||
*
|
||||
* Parent Child Result Parent Child Result
|
||||
* Value Value Value Flags Flags Flags
|
||||
*/
|
||||
CheckWriteCoins(ABSENT, ABSENT, ABSENT, NO_ENTRY , NO_ENTRY , NO_ENTRY );
|
||||
CheckWriteCoins(ABSENT, SPENT , SPENT , NO_ENTRY , DIRTY , DIRTY );
|
||||
CheckWriteCoins(ABSENT, SPENT , ABSENT, NO_ENTRY , DIRTY|FRESH, NO_ENTRY );
|
||||
CheckWriteCoins(ABSENT, VALUE2, VALUE2, NO_ENTRY , DIRTY , DIRTY );
|
||||
CheckWriteCoins(ABSENT, VALUE2, VALUE2, NO_ENTRY , DIRTY|FRESH, DIRTY|FRESH);
|
||||
CheckWriteCoins(SPENT , ABSENT, SPENT , 0 , NO_ENTRY , 0 );
|
||||
CheckWriteCoins(SPENT , ABSENT, SPENT , FRESH , NO_ENTRY , FRESH );
|
||||
CheckWriteCoins(SPENT , ABSENT, SPENT , DIRTY , NO_ENTRY , DIRTY );
|
||||
CheckWriteCoins(SPENT , ABSENT, SPENT , DIRTY|FRESH, NO_ENTRY , DIRTY|FRESH);
|
||||
CheckWriteCoins(SPENT , SPENT , SPENT , 0 , DIRTY , DIRTY );
|
||||
CheckWriteCoins(SPENT , SPENT , SPENT , 0 , DIRTY|FRESH, DIRTY );
|
||||
CheckWriteCoins(SPENT , SPENT , ABSENT, FRESH , DIRTY , NO_ENTRY );
|
||||
CheckWriteCoins(SPENT , SPENT , ABSENT, FRESH , DIRTY|FRESH, NO_ENTRY );
|
||||
CheckWriteCoins(SPENT , SPENT , SPENT , DIRTY , DIRTY , DIRTY );
|
||||
CheckWriteCoins(SPENT , SPENT , SPENT , DIRTY , DIRTY|FRESH, DIRTY );
|
||||
CheckWriteCoins(SPENT , SPENT , ABSENT, DIRTY|FRESH, DIRTY , NO_ENTRY );
|
||||
CheckWriteCoins(SPENT , SPENT , ABSENT, DIRTY|FRESH, DIRTY|FRESH, NO_ENTRY );
|
||||
CheckWriteCoins(SPENT , VALUE2, VALUE2, 0 , DIRTY , DIRTY );
|
||||
CheckWriteCoins(SPENT , VALUE2, VALUE2, 0 , DIRTY|FRESH, DIRTY );
|
||||
CheckWriteCoins(SPENT , VALUE2, VALUE2, FRESH , DIRTY , DIRTY|FRESH);
|
||||
CheckWriteCoins(SPENT , VALUE2, VALUE2, FRESH , DIRTY|FRESH, DIRTY|FRESH);
|
||||
CheckWriteCoins(SPENT , VALUE2, VALUE2, DIRTY , DIRTY , DIRTY );
|
||||
CheckWriteCoins(SPENT , VALUE2, VALUE2, DIRTY , DIRTY|FRESH, DIRTY );
|
||||
CheckWriteCoins(SPENT , VALUE2, VALUE2, DIRTY|FRESH, DIRTY , DIRTY|FRESH);
|
||||
CheckWriteCoins(SPENT , VALUE2, VALUE2, DIRTY|FRESH, DIRTY|FRESH, DIRTY|FRESH);
|
||||
CheckWriteCoins(VALUE1, ABSENT, VALUE1, 0 , NO_ENTRY , 0 );
|
||||
CheckWriteCoins(VALUE1, ABSENT, VALUE1, FRESH , NO_ENTRY , FRESH );
|
||||
CheckWriteCoins(VALUE1, ABSENT, VALUE1, DIRTY , NO_ENTRY , DIRTY );
|
||||
CheckWriteCoins(VALUE1, ABSENT, VALUE1, DIRTY|FRESH, NO_ENTRY , DIRTY|FRESH);
|
||||
CheckWriteCoins(VALUE1, SPENT , SPENT , 0 , DIRTY , DIRTY );
|
||||
CheckWriteCoins(VALUE1, SPENT , FAIL , 0 , DIRTY|FRESH, NO_ENTRY );
|
||||
CheckWriteCoins(VALUE1, SPENT , ABSENT, FRESH , DIRTY , NO_ENTRY );
|
||||
CheckWriteCoins(VALUE1, SPENT , FAIL , FRESH , DIRTY|FRESH, NO_ENTRY );
|
||||
CheckWriteCoins(VALUE1, SPENT , SPENT , DIRTY , DIRTY , DIRTY );
|
||||
CheckWriteCoins(VALUE1, SPENT , FAIL , DIRTY , DIRTY|FRESH, NO_ENTRY );
|
||||
CheckWriteCoins(VALUE1, SPENT , ABSENT, DIRTY|FRESH, DIRTY , NO_ENTRY );
|
||||
CheckWriteCoins(VALUE1, SPENT , FAIL , DIRTY|FRESH, DIRTY|FRESH, NO_ENTRY );
|
||||
CheckWriteCoins(VALUE1, VALUE2, VALUE2, 0 , DIRTY , DIRTY );
|
||||
CheckWriteCoins(VALUE1, VALUE2, FAIL , 0 , DIRTY|FRESH, NO_ENTRY );
|
||||
CheckWriteCoins(VALUE1, VALUE2, VALUE2, FRESH , DIRTY , DIRTY|FRESH);
|
||||
CheckWriteCoins(VALUE1, VALUE2, FAIL , FRESH , DIRTY|FRESH, NO_ENTRY );
|
||||
CheckWriteCoins(VALUE1, VALUE2, VALUE2, DIRTY , DIRTY , DIRTY );
|
||||
CheckWriteCoins(VALUE1, VALUE2, FAIL , DIRTY , DIRTY|FRESH, NO_ENTRY );
|
||||
CheckWriteCoins(VALUE1, VALUE2, VALUE2, DIRTY|FRESH, DIRTY , DIRTY|FRESH);
|
||||
CheckWriteCoins(VALUE1, VALUE2, FAIL , DIRTY|FRESH, DIRTY|FRESH, NO_ENTRY );
|
||||
|
||||
// The checks above omit cases where the child flags are not DIRTY, since
|
||||
// they would be too repetitive (the parent cache is never updated in these
|
||||
// cases). The loop below covers these cases and makes sure the parent cache
|
||||
// is always left unchanged.
|
||||
for (const CAmount parent_value : {ABSENT, SPENT, VALUE1})
|
||||
for (const CAmount child_value : {ABSENT, SPENT, VALUE2})
|
||||
for (const char parent_flags : parent_value == ABSENT ? ABSENT_FLAGS : FLAGS)
|
||||
for (const char child_flags : child_value == ABSENT ? ABSENT_FLAGS : CLEAN_FLAGS)
|
||||
CheckWriteCoins(parent_value, child_value, parent_value, parent_flags, child_flags, parent_flags);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
79
src/test/coinstatsindex_tests.cpp
Normal file
79
src/test/coinstatsindex_tests.cpp
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <index/coinstatsindex.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <util/time.h>
|
||||
#include <validation.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <chrono>
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(coinstatsindex_tests)
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE(coinstatsindex_initial_sync, TestChain100Setup)
|
||||
{
|
||||
CoinStatsIndex coin_stats_index{1 << 20, true};
|
||||
|
||||
CCoinsStats coin_stats{CoinStatsHashType::MUHASH};
|
||||
const CBlockIndex* block_index;
|
||||
{
|
||||
LOCK(cs_main);
|
||||
block_index = m_node.chainman->ActiveChain().Tip();
|
||||
}
|
||||
|
||||
// CoinStatsIndex should not be found before it is started.
|
||||
BOOST_CHECK(!coin_stats_index.LookUpStats(block_index, coin_stats));
|
||||
|
||||
// BlockUntilSyncedToCurrentChain should return false before CoinStatsIndex
|
||||
// is started.
|
||||
BOOST_CHECK(!coin_stats_index.BlockUntilSyncedToCurrentChain());
|
||||
|
||||
BOOST_REQUIRE(coin_stats_index.Start(m_node.chainman->ActiveChainstate()));
|
||||
|
||||
// Allow the CoinStatsIndex to catch up with the block index that is syncing
|
||||
// in a background thread.
|
||||
const auto timeout = GetTime<std::chrono::seconds>() + 120s;
|
||||
while (!coin_stats_index.BlockUntilSyncedToCurrentChain()) {
|
||||
BOOST_REQUIRE(timeout > GetTime<std::chrono::milliseconds>());
|
||||
UninterruptibleSleep(100ms);
|
||||
}
|
||||
|
||||
// Check that CoinStatsIndex works for genesis block.
|
||||
const CBlockIndex* genesis_block_index;
|
||||
{
|
||||
LOCK(cs_main);
|
||||
genesis_block_index = m_node.chainman->ActiveChain().Genesis();
|
||||
}
|
||||
BOOST_CHECK(coin_stats_index.LookUpStats(genesis_block_index, coin_stats));
|
||||
|
||||
// Check that CoinStatsIndex updates with new blocks.
|
||||
coin_stats_index.LookUpStats(block_index, coin_stats);
|
||||
|
||||
const CScript script_pub_key{CScript() << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG};
|
||||
std::vector<CMutableTransaction> noTxns;
|
||||
CreateAndProcessBlock(noTxns, script_pub_key);
|
||||
|
||||
// Let the CoinStatsIndex to catch up again.
|
||||
BOOST_CHECK(coin_stats_index.BlockUntilSyncedToCurrentChain());
|
||||
|
||||
CCoinsStats new_coin_stats{CoinStatsHashType::MUHASH};
|
||||
const CBlockIndex* new_block_index;
|
||||
{
|
||||
LOCK(cs_main);
|
||||
new_block_index = m_node.chainman->ActiveChain().Tip();
|
||||
}
|
||||
coin_stats_index.LookUpStats(new_block_index, new_coin_stats);
|
||||
|
||||
BOOST_CHECK(block_index != new_block_index);
|
||||
|
||||
// Shutdown sequence (c.f. Shutdown() in init.cpp)
|
||||
coin_stats_index.Stop();
|
||||
|
||||
// Rest of shutdown sequence and destructors happen in ~TestingSetup()
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
42
src/test/compilerbug_tests.cpp
Normal file
42
src/test/compilerbug_tests.cpp
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
// Copyright (c) 2019-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(compilerbug_tests)
|
||||
|
||||
#if defined(__GNUC__)
|
||||
// This block will also be built under clang, which is fine (as it supports noinline)
|
||||
void __attribute__ ((noinline)) set_one(unsigned char* ptr)
|
||||
{
|
||||
*ptr = 1;
|
||||
}
|
||||
|
||||
int __attribute__ ((noinline)) check_zero(unsigned char const* in, unsigned int len)
|
||||
{
|
||||
for (unsigned int i = 0; i < len; ++i) {
|
||||
if (in[i] != 0) return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void set_one_on_stack() {
|
||||
unsigned char buf[1];
|
||||
set_one(buf);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(gccbug_90348) {
|
||||
// Test for GCC bug 90348. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348
|
||||
for (int i = 0; i <= 4; ++i) {
|
||||
unsigned char in[4];
|
||||
for (int j = 0; j < i; ++j) {
|
||||
in[j] = 0;
|
||||
set_one_on_stack(); // Apparently modifies in[0]
|
||||
}
|
||||
BOOST_CHECK(check_zero(in, i));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
138
src/test/compress_tests.cpp
Normal file
138
src/test/compress_tests.cpp
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
// Copyright (c) 2012-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <compressor.h>
|
||||
#include <script/standard.h>
|
||||
#include <test/util/setup_common.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
// amounts 0.00000001 .. 0.00100000
|
||||
#define NUM_MULTIPLES_UNIT 100000
|
||||
|
||||
// amounts 0.01 .. 100.00
|
||||
#define NUM_MULTIPLES_CENT 10000
|
||||
|
||||
// amounts 1 .. 10000
|
||||
#define NUM_MULTIPLES_1DGB 10000
|
||||
|
||||
// amounts 50 .. 21000000
|
||||
#define NUM_MULTIPLES_50DGB 420000
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(compress_tests, BasicTestingSetup)
|
||||
|
||||
bool static TestEncode(uint64_t in) {
|
||||
return in == DecompressAmount(CompressAmount(in));
|
||||
}
|
||||
|
||||
bool static TestDecode(uint64_t in) {
|
||||
return in == CompressAmount(DecompressAmount(in));
|
||||
}
|
||||
|
||||
bool static TestPair(uint64_t dec, uint64_t enc) {
|
||||
return CompressAmount(dec) == enc &&
|
||||
DecompressAmount(enc) == dec;
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(compress_amounts)
|
||||
{
|
||||
BOOST_CHECK(TestPair( 0, 0x0));
|
||||
BOOST_CHECK(TestPair( 1, 0x1));
|
||||
BOOST_CHECK(TestPair( CENT, 0x7));
|
||||
BOOST_CHECK(TestPair( COIN, 0x9));
|
||||
BOOST_CHECK(TestPair( 50*COIN, 0x32));
|
||||
BOOST_CHECK(TestPair(21000000*COIN, 0x1406f40));
|
||||
|
||||
for (uint64_t i = 1; i <= NUM_MULTIPLES_UNIT; i++)
|
||||
BOOST_CHECK(TestEncode(i));
|
||||
|
||||
for (uint64_t i = 1; i <= NUM_MULTIPLES_CENT; i++)
|
||||
BOOST_CHECK(TestEncode(i * CENT));
|
||||
|
||||
for (uint64_t i = 1; i <= NUM_MULTIPLES_1DGB; i++)
|
||||
BOOST_CHECK(TestEncode(i * COIN));
|
||||
|
||||
for (uint64_t i = 1; i <= NUM_MULTIPLES_50DGB; i++)
|
||||
BOOST_CHECK(TestEncode(i * 50 * COIN));
|
||||
|
||||
for (uint64_t i = 0; i < 100000; i++)
|
||||
BOOST_CHECK(TestDecode(i));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(compress_script_to_ckey_id)
|
||||
{
|
||||
// case CKeyID
|
||||
CKey key;
|
||||
key.MakeNewKey(true);
|
||||
CPubKey pubkey = key.GetPubKey();
|
||||
|
||||
CScript script = CScript() << OP_DUP << OP_HASH160 << ToByteVector(pubkey.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG;
|
||||
BOOST_CHECK_EQUAL(script.size(), 25U);
|
||||
|
||||
CompressedScript out;
|
||||
bool done = CompressScript(script, out);
|
||||
BOOST_CHECK_EQUAL(done, true);
|
||||
|
||||
// Check compressed script
|
||||
BOOST_CHECK_EQUAL(out.size(), 21U);
|
||||
BOOST_CHECK_EQUAL(out[0], 0x00);
|
||||
BOOST_CHECK_EQUAL(memcmp(out.data() + 1, script.data() + 3, 20), 0); // compare the 20 relevant chars of the CKeyId in the script
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(compress_script_to_cscript_id)
|
||||
{
|
||||
// case CScriptID
|
||||
CScript script, redeemScript;
|
||||
script << OP_HASH160 << ToByteVector(CScriptID(redeemScript)) << OP_EQUAL;
|
||||
BOOST_CHECK_EQUAL(script.size(), 23U);
|
||||
|
||||
CompressedScript out;
|
||||
bool done = CompressScript(script, out);
|
||||
BOOST_CHECK_EQUAL(done, true);
|
||||
|
||||
// Check compressed script
|
||||
BOOST_CHECK_EQUAL(out.size(), 21U);
|
||||
BOOST_CHECK_EQUAL(out[0], 0x01);
|
||||
BOOST_CHECK_EQUAL(memcmp(out.data() + 1, script.data() + 2, 20), 0); // compare the 20 relevant chars of the CScriptId in the script
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(compress_script_to_compressed_pubkey_id)
|
||||
{
|
||||
CKey key;
|
||||
key.MakeNewKey(true); // case compressed PubKeyID
|
||||
|
||||
CScript script = CScript() << ToByteVector(key.GetPubKey()) << OP_CHECKSIG; // COMPRESSED_PUBLIC_KEY_SIZE (33)
|
||||
BOOST_CHECK_EQUAL(script.size(), 35U);
|
||||
|
||||
CompressedScript out;
|
||||
bool done = CompressScript(script, out);
|
||||
BOOST_CHECK_EQUAL(done, true);
|
||||
|
||||
// Check compressed script
|
||||
BOOST_CHECK_EQUAL(out.size(), 33U);
|
||||
BOOST_CHECK_EQUAL(memcmp(out.data(), script.data() + 1, 1), 0);
|
||||
BOOST_CHECK_EQUAL(memcmp(out.data() + 1, script.data() + 2, 32), 0); // compare the 32 chars of the compressed CPubKey
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(compress_script_to_uncompressed_pubkey_id)
|
||||
{
|
||||
CKey key;
|
||||
key.MakeNewKey(false); // case uncompressed PubKeyID
|
||||
CScript script = CScript() << ToByteVector(key.GetPubKey()) << OP_CHECKSIG; // PUBLIC_KEY_SIZE (65)
|
||||
BOOST_CHECK_EQUAL(script.size(), 67U); // 1 char code + 65 char pubkey + OP_CHECKSIG
|
||||
|
||||
CompressedScript out;
|
||||
bool done = CompressScript(script, out);
|
||||
BOOST_CHECK_EQUAL(done, true);
|
||||
|
||||
// Check compressed script
|
||||
BOOST_CHECK_EQUAL(out.size(), 33U);
|
||||
BOOST_CHECK_EQUAL(memcmp(out.data() + 1, script.data() + 2, 32), 0); // first 32 chars of CPubKey are copied into out[1:]
|
||||
BOOST_CHECK_EQUAL(out[0], 0x04 | (script[65] & 0x01)); // least significant bit (lsb) of last char of pubkey is mapped into out[0]
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
994
src/test/crypto_tests.cpp
Normal file
994
src/test/crypto_tests.cpp
Normal file
|
|
@ -0,0 +1,994 @@
|
|||
// Copyright (c) 2014-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/chacha20.h>
|
||||
#include <crypto/chacha_poly_aead.h>
|
||||
#include <crypto/hkdf_sha256_32.h>
|
||||
#include <crypto/hmac_sha256.h>
|
||||
#include <crypto/hmac_sha512.h>
|
||||
#include <crypto/poly1305.h>
|
||||
#include <crypto/ripemd160.h>
|
||||
#include <crypto/sha1.h>
|
||||
#include <crypto/sha256.h>
|
||||
#include <crypto/sha3.h>
|
||||
#include <crypto/sha512.h>
|
||||
#include <crypto/muhash.h>
|
||||
#include <random.h>
|
||||
#include <streams.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <vector>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(crypto_tests, BasicTestingSetup)
|
||||
|
||||
template<typename Hasher, typename In, typename Out>
|
||||
static void TestVector(const Hasher &h, const In &in, const Out &out) {
|
||||
Out hash;
|
||||
BOOST_CHECK(out.size() == h.OUTPUT_SIZE);
|
||||
hash.resize(out.size());
|
||||
{
|
||||
// Test that writing the whole input string at once works.
|
||||
Hasher(h).Write((const uint8_t*)in.data(), in.size()).Finalize(hash.data());
|
||||
BOOST_CHECK(hash == out);
|
||||
}
|
||||
for (int i=0; i<32; i++) {
|
||||
// Test that writing the string broken up in random pieces works.
|
||||
Hasher hasher(h);
|
||||
size_t pos = 0;
|
||||
while (pos < in.size()) {
|
||||
size_t len = InsecureRandRange((in.size() - pos + 1) / 2 + 1);
|
||||
hasher.Write((const uint8_t*)in.data() + pos, len);
|
||||
pos += len;
|
||||
if (pos > 0 && pos + 2 * out.size() > in.size() && pos < in.size()) {
|
||||
// Test that writing the rest at once to a copy of a hasher works.
|
||||
Hasher(hasher).Write((const uint8_t*)in.data() + pos, in.size() - pos).Finalize(hash.data());
|
||||
BOOST_CHECK(hash == out);
|
||||
}
|
||||
}
|
||||
hasher.Finalize(hash.data());
|
||||
BOOST_CHECK(hash == out);
|
||||
}
|
||||
}
|
||||
|
||||
static void TestSHA1(const std::string &in, const std::string &hexout) { TestVector(CSHA1(), in, ParseHex(hexout));}
|
||||
static void TestSHA256(const std::string &in, const std::string &hexout) { TestVector(CSHA256(), in, ParseHex(hexout));}
|
||||
static void TestSHA512(const std::string &in, const std::string &hexout) { TestVector(CSHA512(), in, ParseHex(hexout));}
|
||||
static void TestRIPEMD160(const std::string &in, const std::string &hexout) { TestVector(CRIPEMD160(), in, ParseHex(hexout));}
|
||||
|
||||
static void TestHMACSHA256(const std::string &hexkey, const std::string &hexin, const std::string &hexout) {
|
||||
std::vector<unsigned char> key = ParseHex(hexkey);
|
||||
TestVector(CHMAC_SHA256(key.data(), key.size()), ParseHex(hexin), ParseHex(hexout));
|
||||
}
|
||||
|
||||
static void TestHMACSHA512(const std::string &hexkey, const std::string &hexin, const std::string &hexout) {
|
||||
std::vector<unsigned char> key = ParseHex(hexkey);
|
||||
TestVector(CHMAC_SHA512(key.data(), key.size()), ParseHex(hexin), ParseHex(hexout));
|
||||
}
|
||||
|
||||
static void TestAES256(const std::string &hexkey, const std::string &hexin, const std::string &hexout)
|
||||
{
|
||||
std::vector<unsigned char> key = ParseHex(hexkey);
|
||||
std::vector<unsigned char> in = ParseHex(hexin);
|
||||
std::vector<unsigned char> correctout = ParseHex(hexout);
|
||||
std::vector<unsigned char> buf;
|
||||
|
||||
assert(key.size() == 32);
|
||||
assert(in.size() == 16);
|
||||
assert(correctout.size() == 16);
|
||||
AES256Encrypt enc(key.data());
|
||||
buf.resize(correctout.size());
|
||||
enc.Encrypt(buf.data(), in.data());
|
||||
BOOST_CHECK(buf == correctout);
|
||||
AES256Decrypt dec(key.data());
|
||||
dec.Decrypt(buf.data(), buf.data());
|
||||
BOOST_CHECK(buf == in);
|
||||
}
|
||||
|
||||
static void TestAES256CBC(const std::string &hexkey, const std::string &hexiv, bool pad, const std::string &hexin, const std::string &hexout)
|
||||
{
|
||||
std::vector<unsigned char> key = ParseHex(hexkey);
|
||||
std::vector<unsigned char> iv = ParseHex(hexiv);
|
||||
std::vector<unsigned char> in = ParseHex(hexin);
|
||||
std::vector<unsigned char> correctout = ParseHex(hexout);
|
||||
std::vector<unsigned char> realout(in.size() + AES_BLOCKSIZE);
|
||||
|
||||
// Encrypt the plaintext and verify that it equals the cipher
|
||||
AES256CBCEncrypt enc(key.data(), iv.data(), pad);
|
||||
int size = enc.Encrypt(in.data(), in.size(), realout.data());
|
||||
realout.resize(size);
|
||||
BOOST_CHECK(realout.size() == correctout.size());
|
||||
BOOST_CHECK_MESSAGE(realout == correctout, HexStr(realout) + std::string(" != ") + hexout);
|
||||
|
||||
// Decrypt the cipher and verify that it equals the plaintext
|
||||
std::vector<unsigned char> decrypted(correctout.size());
|
||||
AES256CBCDecrypt dec(key.data(), iv.data(), pad);
|
||||
size = dec.Decrypt(correctout.data(), correctout.size(), decrypted.data());
|
||||
decrypted.resize(size);
|
||||
BOOST_CHECK(decrypted.size() == in.size());
|
||||
BOOST_CHECK_MESSAGE(decrypted == in, HexStr(decrypted) + std::string(" != ") + hexin);
|
||||
|
||||
// Encrypt and re-decrypt substrings of the plaintext and verify that they equal each-other
|
||||
for(std::vector<unsigned char>::iterator i(in.begin()); i != in.end(); ++i)
|
||||
{
|
||||
std::vector<unsigned char> sub(i, in.end());
|
||||
std::vector<unsigned char> subout(sub.size() + AES_BLOCKSIZE);
|
||||
int _size = enc.Encrypt(sub.data(), sub.size(), subout.data());
|
||||
if (_size != 0)
|
||||
{
|
||||
subout.resize(_size);
|
||||
std::vector<unsigned char> subdecrypted(subout.size());
|
||||
_size = dec.Decrypt(subout.data(), subout.size(), subdecrypted.data());
|
||||
subdecrypted.resize(_size);
|
||||
BOOST_CHECK(decrypted.size() == in.size());
|
||||
BOOST_CHECK_MESSAGE(subdecrypted == sub, HexStr(subdecrypted) + std::string(" != ") + HexStr(sub));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TestChaCha20(const std::string &hex_message, const std::string &hexkey, uint64_t nonce, uint64_t seek, const std::string& hexout)
|
||||
{
|
||||
std::vector<unsigned char> key = ParseHex(hexkey);
|
||||
std::vector<unsigned char> m = ParseHex(hex_message);
|
||||
ChaCha20 rng(key.data(), key.size());
|
||||
rng.SetIV(nonce);
|
||||
rng.Seek(seek);
|
||||
std::vector<unsigned char> out = ParseHex(hexout);
|
||||
std::vector<unsigned char> outres;
|
||||
outres.resize(out.size());
|
||||
assert(hex_message.empty() || m.size() == out.size());
|
||||
|
||||
// perform the ChaCha20 round(s), if message is provided it will output the encrypted ciphertext otherwise the keystream
|
||||
if (!hex_message.empty()) {
|
||||
rng.Crypt(m.data(), outres.data(), outres.size());
|
||||
} else {
|
||||
rng.Keystream(outres.data(), outres.size());
|
||||
}
|
||||
BOOST_CHECK(out == outres);
|
||||
if (!hex_message.empty()) {
|
||||
// Manually XOR with the keystream and compare the output
|
||||
rng.SetIV(nonce);
|
||||
rng.Seek(seek);
|
||||
std::vector<unsigned char> only_keystream(outres.size());
|
||||
rng.Keystream(only_keystream.data(), only_keystream.size());
|
||||
for (size_t i = 0; i != m.size(); i++) {
|
||||
outres[i] = m[i] ^ only_keystream[i];
|
||||
}
|
||||
BOOST_CHECK(out == outres);
|
||||
}
|
||||
}
|
||||
|
||||
static void TestPoly1305(const std::string &hexmessage, const std::string &hexkey, const std::string& hextag)
|
||||
{
|
||||
std::vector<unsigned char> key = ParseHex(hexkey);
|
||||
std::vector<unsigned char> m = ParseHex(hexmessage);
|
||||
std::vector<unsigned char> tag = ParseHex(hextag);
|
||||
std::vector<unsigned char> tagres;
|
||||
tagres.resize(POLY1305_TAGLEN);
|
||||
poly1305_auth(tagres.data(), m.data(), m.size(), key.data());
|
||||
BOOST_CHECK(tag == tagres);
|
||||
}
|
||||
|
||||
static void TestHKDF_SHA256_32(const std::string &ikm_hex, const std::string &salt_hex, const std::string &info_hex, const std::string &okm_check_hex) {
|
||||
std::vector<unsigned char> initial_key_material = ParseHex(ikm_hex);
|
||||
std::vector<unsigned char> salt = ParseHex(salt_hex);
|
||||
std::vector<unsigned char> info = ParseHex(info_hex);
|
||||
|
||||
|
||||
// our implementation only supports strings for the "info" and "salt", stringify them
|
||||
std::string salt_stringified(reinterpret_cast<char*>(salt.data()), salt.size());
|
||||
std::string info_stringified(reinterpret_cast<char*>(info.data()), info.size());
|
||||
|
||||
CHKDF_HMAC_SHA256_L32 hkdf32(initial_key_material.data(), initial_key_material.size(), salt_stringified);
|
||||
unsigned char out[32];
|
||||
hkdf32.Expand32(info_stringified, out);
|
||||
BOOST_CHECK(HexStr(out) == okm_check_hex);
|
||||
}
|
||||
|
||||
static void TestOdo(uint32_t key, const std::string &in, const std::string &hexout)
|
||||
{
|
||||
assert(in.length() == OdoCrypt::DIGEST_SIZE);
|
||||
std::vector<unsigned char> out = ParseHex(hexout);
|
||||
std::vector<unsigned char> outres(OdoCrypt::DIGEST_SIZE);
|
||||
OdoCrypt(key).Encrypt(reinterpret_cast<char*>(outres.data()), in.c_str());
|
||||
BOOST_CHECK(out == outres);
|
||||
}
|
||||
|
||||
static std::string LongTestString()
|
||||
{
|
||||
std::string ret;
|
||||
for (int i = 0; i < 200000; i++) {
|
||||
ret += (char)(i);
|
||||
ret += (char)(i >> 4);
|
||||
ret += (char)(i >> 8);
|
||||
ret += (char)(i >> 12);
|
||||
ret += (char)(i >> 16);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
const std::string test1 = LongTestString();
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ripemd160_testvectors) {
|
||||
TestRIPEMD160("", "9c1185a5c5e9fc54612808977ee8f548b2258d31");
|
||||
TestRIPEMD160("abc", "8eb208f7e05d987a9b044a8e98c6b087f15a0bfc");
|
||||
TestRIPEMD160("message digest", "5d0689ef49d2fae572b881b123a85ffa21595f36");
|
||||
TestRIPEMD160("secure hash algorithm", "20397528223b6a5f4cbc2808aba0464e645544f9");
|
||||
TestRIPEMD160("RIPEMD160 is considered to be safe", "a7d78608c7af8a8e728778e81576870734122b66");
|
||||
TestRIPEMD160("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
|
||||
"12a053384a9c0c88e405a06c27dcf49ada62eb2b");
|
||||
TestRIPEMD160("For this sample, this 63-byte string will be used as input data",
|
||||
"de90dbfee14b63fb5abf27c2ad4a82aaa5f27a11");
|
||||
TestRIPEMD160("This is exactly 64 bytes long, not counting the terminating byte",
|
||||
"eda31d51d3a623b81e19eb02e24ff65d27d67b37");
|
||||
TestRIPEMD160(std::string(1000000, 'a'), "52783243c1697bdbe16d37f97f68f08325dc1528");
|
||||
TestRIPEMD160(test1, "464243587bd146ea835cdf57bdae582f25ec45f1");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(sha1_testvectors) {
|
||||
TestSHA1("", "da39a3ee5e6b4b0d3255bfef95601890afd80709");
|
||||
TestSHA1("abc", "a9993e364706816aba3e25717850c26c9cd0d89d");
|
||||
TestSHA1("message digest", "c12252ceda8be8994d5fa0290a47231c1d16aae3");
|
||||
TestSHA1("secure hash algorithm", "d4d6d2f0ebe317513bbd8d967d89bac5819c2f60");
|
||||
TestSHA1("SHA1 is considered to be safe", "f2b6650569ad3a8720348dd6ea6c497dee3a842a");
|
||||
TestSHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
|
||||
"84983e441c3bd26ebaae4aa1f95129e5e54670f1");
|
||||
TestSHA1("For this sample, this 63-byte string will be used as input data",
|
||||
"4f0ea5cd0585a23d028abdc1a6684e5a8094dc49");
|
||||
TestSHA1("This is exactly 64 bytes long, not counting the terminating byte",
|
||||
"fb679f23e7d1ce053313e66e127ab1b444397057");
|
||||
TestSHA1(std::string(1000000, 'a'), "34aa973cd4c4daa4f61eeb2bdbad27316534016f");
|
||||
TestSHA1(test1, "b7755760681cbfd971451668f32af5774f4656b5");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(sha256_testvectors) {
|
||||
TestSHA256("", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");
|
||||
TestSHA256("abc", "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad");
|
||||
TestSHA256("message digest",
|
||||
"f7846f55cf23e14eebeab5b4e1550cad5b509e3348fbc4efa3a1413d393cb650");
|
||||
TestSHA256("secure hash algorithm",
|
||||
"f30ceb2bb2829e79e4ca9753d35a8ecc00262d164cc077080295381cbd643f0d");
|
||||
TestSHA256("SHA256 is considered to be safe",
|
||||
"6819d915c73f4d1e77e4e1b52d1fa0f9cf9beaead3939f15874bd988e2a23630");
|
||||
TestSHA256("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
|
||||
"248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1");
|
||||
TestSHA256("For this sample, this 63-byte string will be used as input data",
|
||||
"f08a78cbbaee082b052ae0708f32fa1e50c5c421aa772ba5dbb406a2ea6be342");
|
||||
TestSHA256("This is exactly 64 bytes long, not counting the terminating byte",
|
||||
"ab64eff7e88e2e46165e29f2bce41826bd4c7b3552f6b382a9e7d3af47c245f8");
|
||||
TestSHA256("As Bitcoin relies on 80 byte header hashes, we want to have an example for that.",
|
||||
"7406e8de7d6e4fffc573daef05aefb8806e7790f55eab5576f31349743cca743");
|
||||
TestSHA256(std::string(1000000, 'a'),
|
||||
"cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0");
|
||||
TestSHA256(test1, "a316d55510b49662420f49d145d42fb83f31ef8dc016aa4e32df049991a91e26");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(sha512_testvectors) {
|
||||
TestSHA512("",
|
||||
"cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce"
|
||||
"47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e");
|
||||
TestSHA512("abc",
|
||||
"ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a"
|
||||
"2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f");
|
||||
TestSHA512("message digest",
|
||||
"107dbf389d9e9f71a3a95f6c055b9251bc5268c2be16d6c13492ea45b0199f33"
|
||||
"09e16455ab1e96118e8a905d5597b72038ddb372a89826046de66687bb420e7c");
|
||||
TestSHA512("secure hash algorithm",
|
||||
"7746d91f3de30c68cec0dd693120a7e8b04d8073cb699bdce1a3f64127bca7a3"
|
||||
"d5db502e814bb63c063a7a5043b2df87c61133395f4ad1edca7fcf4b30c3236e");
|
||||
TestSHA512("SHA512 is considered to be safe",
|
||||
"099e6468d889e1c79092a89ae925a9499b5408e01b66cb5b0a3bd0dfa51a9964"
|
||||
"6b4a3901caab1318189f74cd8cf2e941829012f2449df52067d3dd5b978456c2");
|
||||
TestSHA512("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
|
||||
"204a8fc6dda82f0a0ced7beb8e08a41657c16ef468b228a8279be331a703c335"
|
||||
"96fd15c13b1b07f9aa1d3bea57789ca031ad85c7a71dd70354ec631238ca3445");
|
||||
TestSHA512("For this sample, this 63-byte string will be used as input data",
|
||||
"b3de4afbc516d2478fe9b518d063bda6c8dd65fc38402dd81d1eb7364e72fb6e"
|
||||
"6663cf6d2771c8f5a6da09601712fb3d2a36c6ffea3e28b0818b05b0a8660766");
|
||||
TestSHA512("This is exactly 64 bytes long, not counting the terminating byte",
|
||||
"70aefeaa0e7ac4f8fe17532d7185a289bee3b428d950c14fa8b713ca09814a38"
|
||||
"7d245870e007a80ad97c369d193e41701aa07f3221d15f0e65a1ff970cedf030");
|
||||
TestSHA512("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmno"
|
||||
"ijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
|
||||
"8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018"
|
||||
"501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909");
|
||||
TestSHA512(std::string(1000000, 'a'),
|
||||
"e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb"
|
||||
"de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b");
|
||||
TestSHA512(test1,
|
||||
"40cac46c147e6131c5193dd5f34e9d8bb4951395f27b08c558c65ff4ba2de594"
|
||||
"37de8c3ef5459d76a52cedc02dc499a3c9ed9dedbfb3281afd9653b8a112fafc");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(hmac_sha256_testvectors) {
|
||||
// test cases 1, 2, 3, 4, 6 and 7 of RFC 4231
|
||||
TestHMACSHA256("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b",
|
||||
"4869205468657265",
|
||||
"b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7");
|
||||
TestHMACSHA256("4a656665",
|
||||
"7768617420646f2079612077616e7420666f72206e6f7468696e673f",
|
||||
"5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843");
|
||||
TestHMACSHA256("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
||||
"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
|
||||
"dddddddddddddddddddddddddddddddddddd",
|
||||
"773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fe");
|
||||
TestHMACSHA256("0102030405060708090a0b0c0d0e0f10111213141516171819",
|
||||
"cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd"
|
||||
"cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd",
|
||||
"82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665b");
|
||||
TestHMACSHA256("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaa",
|
||||
"54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a"
|
||||
"65204b6579202d2048617368204b6579204669727374",
|
||||
"60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54");
|
||||
TestHMACSHA256("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaa",
|
||||
"5468697320697320612074657374207573696e672061206c6172676572207468"
|
||||
"616e20626c6f636b2d73697a65206b657920616e642061206c61726765722074"
|
||||
"68616e20626c6f636b2d73697a6520646174612e20546865206b6579206e6565"
|
||||
"647320746f20626520686173686564206265666f7265206265696e6720757365"
|
||||
"642062792074686520484d414320616c676f726974686d2e",
|
||||
"9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2");
|
||||
// Test case with key length 63 bytes.
|
||||
TestHMACSHA256("4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665"
|
||||
"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a6566",
|
||||
"7768617420646f2079612077616e7420666f72206e6f7468696e673f",
|
||||
"9de4b546756c83516720a4ad7fe7bdbeac4298c6fdd82b15f895a6d10b0769a6");
|
||||
// Test case with key length 64 bytes.
|
||||
TestHMACSHA256("4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665"
|
||||
"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665",
|
||||
"7768617420646f2079612077616e7420666f72206e6f7468696e673f",
|
||||
"528c609a4c9254c274585334946b7c2661bad8f1fc406b20f6892478d19163dd");
|
||||
// Test case with key length 65 bytes.
|
||||
TestHMACSHA256("4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665"
|
||||
"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665"
|
||||
"4a",
|
||||
"7768617420646f2079612077616e7420666f72206e6f7468696e673f",
|
||||
"d06af337f359a2330deffb8e3cbe4b5b7aa8ca1f208528cdbd245d5dc63c4483");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(hmac_sha512_testvectors) {
|
||||
// test cases 1, 2, 3, 4, 6 and 7 of RFC 4231
|
||||
TestHMACSHA512("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b",
|
||||
"4869205468657265",
|
||||
"87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cde"
|
||||
"daa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f1702e696c203a126854");
|
||||
TestHMACSHA512("4a656665",
|
||||
"7768617420646f2079612077616e7420666f72206e6f7468696e673f",
|
||||
"164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7ea250554"
|
||||
"9758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b636e070a38bce737");
|
||||
TestHMACSHA512("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
||||
"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
|
||||
"dddddddddddddddddddddddddddddddddddd",
|
||||
"fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33b2279d39"
|
||||
"bf3e848279a722c806b485a47e67c807b946a337bee8942674278859e13292fb");
|
||||
TestHMACSHA512("0102030405060708090a0b0c0d0e0f10111213141516171819",
|
||||
"cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd"
|
||||
"cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd",
|
||||
"b0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050361ee3db"
|
||||
"a91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2de2adebeb10a298dd");
|
||||
TestHMACSHA512("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaa",
|
||||
"54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a"
|
||||
"65204b6579202d2048617368204b6579204669727374",
|
||||
"80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b013783f8f352"
|
||||
"6b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec8b915a985d786598");
|
||||
TestHMACSHA512("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"aaaaaa",
|
||||
"5468697320697320612074657374207573696e672061206c6172676572207468"
|
||||
"616e20626c6f636b2d73697a65206b657920616e642061206c61726765722074"
|
||||
"68616e20626c6f636b2d73697a6520646174612e20546865206b6579206e6565"
|
||||
"647320746f20626520686173686564206265666f7265206265696e6720757365"
|
||||
"642062792074686520484d414320616c676f726974686d2e",
|
||||
"e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d20cdc944"
|
||||
"b6022cac3c4982b10d5eeb55c3e4de15134676fb6de0446065c97440fa8c6a58");
|
||||
// Test case with key length 127 bytes.
|
||||
TestHMACSHA512("4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665"
|
||||
"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665"
|
||||
"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665"
|
||||
"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a6566",
|
||||
"7768617420646f2079612077616e7420666f72206e6f7468696e673f",
|
||||
"267424dfb8eeb999f3e5ec39a4fe9fd14c923e6187e0897063e5c9e02b2e624a"
|
||||
"c04413e762977df71a9fb5d562b37f89dfdfb930fce2ed1fa783bbc2a203d80e");
|
||||
// Test case with key length 128 bytes.
|
||||
TestHMACSHA512("4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665"
|
||||
"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665"
|
||||
"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665"
|
||||
"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665",
|
||||
"7768617420646f2079612077616e7420666f72206e6f7468696e673f",
|
||||
"43aaac07bb1dd97c82c04df921f83b16a68d76815cd1a30d3455ad43a3d80484"
|
||||
"2bb35462be42cc2e4b5902de4d204c1c66d93b47d1383e3e13a3788687d61258");
|
||||
// Test case with key length 129 bytes.
|
||||
TestHMACSHA512("4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665"
|
||||
"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665"
|
||||
"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665"
|
||||
"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665"
|
||||
"4a",
|
||||
"7768617420646f2079612077616e7420666f72206e6f7468696e673f",
|
||||
"0b273325191cfc1b4b71d5075c8fcad67696309d292b1dad2cd23983a35feb8e"
|
||||
"fb29795e79f2ef27f68cb1e16d76178c307a67beaad9456fac5fdffeadb16e2c");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(aes_testvectors) {
|
||||
// AES test vectors from FIPS 197.
|
||||
TestAES256("000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", "00112233445566778899aabbccddeeff", "8ea2b7ca516745bfeafc49904b496089");
|
||||
|
||||
// AES-ECB test vectors from NIST sp800-38a.
|
||||
TestAES256("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4", "6bc1bee22e409f96e93d7e117393172a", "f3eed1bdb5d2a03c064b5a7e3db181f8");
|
||||
TestAES256("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4", "ae2d8a571e03ac9c9eb76fac45af8e51", "591ccb10d410ed26dc5ba74a31362870");
|
||||
TestAES256("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4", "30c81c46a35ce411e5fbc1191a0a52ef", "b6ed21b99ca6f4f9f153e7b1beafed1d");
|
||||
TestAES256("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4", "f69f2445df4f9b17ad2b417be66c3710", "23304b7a39f9f3ff067d8d8f9e24ecc7");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(aes_cbc_testvectors) {
|
||||
// NIST AES CBC 256-bit encryption test-vectors
|
||||
TestAES256CBC("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4", \
|
||||
"000102030405060708090A0B0C0D0E0F", false, "6bc1bee22e409f96e93d7e117393172a", \
|
||||
"f58c4c04d6e5f1ba779eabfb5f7bfbd6");
|
||||
TestAES256CBC("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4", \
|
||||
"F58C4C04D6E5F1BA779EABFB5F7BFBD6", false, "ae2d8a571e03ac9c9eb76fac45af8e51", \
|
||||
"9cfc4e967edb808d679f777bc6702c7d");
|
||||
TestAES256CBC("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4", \
|
||||
"9CFC4E967EDB808D679F777BC6702C7D", false, "30c81c46a35ce411e5fbc1191a0a52ef",
|
||||
"39f23369a9d9bacfa530e26304231461");
|
||||
TestAES256CBC("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4", \
|
||||
"39F23369A9D9BACFA530E26304231461", false, "f69f2445df4f9b17ad2b417be66c3710", \
|
||||
"b2eb05e2c39be9fcda6c19078c6a9d1b");
|
||||
|
||||
// The same vectors with padding enabled
|
||||
TestAES256CBC("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4", \
|
||||
"000102030405060708090A0B0C0D0E0F", true, "6bc1bee22e409f96e93d7e117393172a", \
|
||||
"f58c4c04d6e5f1ba779eabfb5f7bfbd6485a5c81519cf378fa36d42b8547edc0");
|
||||
TestAES256CBC("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4", \
|
||||
"F58C4C04D6E5F1BA779EABFB5F7BFBD6", true, "ae2d8a571e03ac9c9eb76fac45af8e51", \
|
||||
"9cfc4e967edb808d679f777bc6702c7d3a3aa5e0213db1a9901f9036cf5102d2");
|
||||
TestAES256CBC("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4", \
|
||||
"9CFC4E967EDB808D679F777BC6702C7D", true, "30c81c46a35ce411e5fbc1191a0a52ef",
|
||||
"39f23369a9d9bacfa530e263042314612f8da707643c90a6f732b3de1d3f5cee");
|
||||
TestAES256CBC("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4", \
|
||||
"39F23369A9D9BACFA530E26304231461", true, "f69f2445df4f9b17ad2b417be66c3710", \
|
||||
"b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644");
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(chacha20_testvector)
|
||||
{
|
||||
// Test vector from RFC 7539
|
||||
|
||||
// test encryption
|
||||
TestChaCha20("4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393a204966204920636f756"
|
||||
"c64206f6666657220796f75206f6e6c79206f6e652074697020666f7220746865206675747572652c2073756e73637265656e"
|
||||
"20776f756c642062652069742e",
|
||||
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", 0x4a000000UL, 1,
|
||||
"6e2e359a2568f98041ba0728dd0d6981e97e7aec1d4360c20a27afccfd9fae0bf91b65c5524733ab8f593dabcd62b3571639d"
|
||||
"624e65152ab8f530c359f0861d807ca0dbf500d6a6156a38e088a22b65e52bc514d16ccf806818ce91ab77937365af90bbf74"
|
||||
"a35be6b40b8eedf2785e42874d"
|
||||
);
|
||||
|
||||
// test keystream output
|
||||
TestChaCha20("", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", 0x4a000000UL, 1,
|
||||
"224f51f3401bd9e12fde276fb8631ded8c131f823d2c06e27e4fcaec9ef3cf788a3b0aa372600a92b57974cded2b9334794cb"
|
||||
"a40c63e34cdea212c4cf07d41b769a6749f3f630f4122cafe28ec4dc47e26d4346d70b98c73f3e9c53ac40c5945398b6eda1a"
|
||||
"832c89c167eacd901d7e2bf363");
|
||||
|
||||
// Test vectors from https://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-04#section-7
|
||||
TestChaCha20("", "0000000000000000000000000000000000000000000000000000000000000000", 0, 0,
|
||||
"76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7724e03fb8d84a376a43b"
|
||||
"8f41518a11cc387b669b2ee6586");
|
||||
TestChaCha20("", "0000000000000000000000000000000000000000000000000000000000000001", 0, 0,
|
||||
"4540f05a9f1fb296d7736e7b208e3c96eb4fe1834688d2604f450952ed432d41bbe2a0b6ea7566d2a5d1e7e20d42af2c53d79"
|
||||
"2b1c43fea817e9ad275ae546963");
|
||||
TestChaCha20("", "0000000000000000000000000000000000000000000000000000000000000000", 0x0100000000000000ULL, 0,
|
||||
"de9cba7bf3d69ef5e786dc63973f653a0b49e015adbff7134fcb7df137821031e85a050278a7084527214f73efc7fa5b52770"
|
||||
"62eb7a0433e445f41e3");
|
||||
TestChaCha20("", "0000000000000000000000000000000000000000000000000000000000000000", 1, 0,
|
||||
"ef3fdfd6c61578fbf5cf35bd3dd33b8009631634d21e42ac33960bd138e50d32111e4caf237ee53ca8ad6426194a88545ddc4"
|
||||
"97a0b466e7d6bbdb0041b2f586b");
|
||||
TestChaCha20("", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", 0x0706050403020100ULL, 0,
|
||||
"f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3b"
|
||||
"e59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc1"
|
||||
"18be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5"
|
||||
"a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5"
|
||||
"360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78"
|
||||
"fab78c9");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(odo_testvector)
|
||||
{
|
||||
TestOdo(0, "00000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"9724ebfef40d7808bc21b212d8645a1df4d7fc4a0d91ee8e7f747ca1383eaeb1bb264b3a3b1b1f19"
|
||||
"a8d458616e9a19572e3ceb2f58773076e829a288c8fdb61ab619ffaa84a4ee752fea52dbb359620e");
|
||||
TestOdo(1, "00000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"c659c70bd9335a0bec67e526cdf99569543ca7e258fad19d439fb8ada1bc68efa5553d270d236cf0"
|
||||
"3b1c179c684cfc93ae15b3c239c11e384303785cc0d828114c28e08091f42ec707aba712fe999c68");
|
||||
TestOdo(0x80808080u, "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopqopqrpqrsqrstrstustuvtuvw",
|
||||
"dc5d9757b16bfa425f527817ee88a070595a662474d06bb96b439e25bc3097fc7068ab9d934fcd19"
|
||||
"c9587478dd9ab8f79f2c85175c51e49306135e561561725b0aa7a44366a1135ff93194da22d1e9ba");
|
||||
TestOdo(0x12345678, "As DigiByte relies on 80 byte header hashes, we want to have an example for that",
|
||||
"13dddebb0d65daa0f3e4a5bd9a1b74af7ca5a7b32ef118fb1684b200e377ce504346adcd2354e818"
|
||||
"bf530dd870386104f706f4fecde1cec5cee804aae2569821aa5b2db3ac048607be36714e2bce48c6");
|
||||
TestOdo(1729, test1.substr(0x4ffb0, OdoCrypt::DIGEST_SIZE),
|
||||
"de79362f40cf0c755b21cf30798fa828b21cba61222ebeccc5a1ee385183ff2a981926403529080f"
|
||||
"6c5a650bb299770222e7dbc0bdd559f479fac21d08044d306513067f2bf6accdb8b55942a5430e1c");
|
||||
TestOdo(0xD59, "Mora labelled me Unknown Sample, which the overseer translated as Odo'ital......",
|
||||
"a7dd19a7fcdf3b7c0a8da1765553d903ff42687fe2f36c3930b82d7a68e426a90f49f1fc4b06263d"
|
||||
"cf95d70a1b436337586955ef61c976f97785da2d2c8144b6767f824d53dd518c2cfdce1e9bd74fe1");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(poly1305_testvector)
|
||||
{
|
||||
// RFC 7539, section 2.5.2.
|
||||
TestPoly1305("43727970746f6772617068696320466f72756d2052657365617263682047726f7570",
|
||||
"85d6be7857556d337f4452fe42d506a80103808afb0db2fd4abff6af4149f51b",
|
||||
"a8061dc1305136c6c22b8baf0c0127a9");
|
||||
|
||||
// RFC 7539, section A.3.
|
||||
TestPoly1305("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
||||
"000000000000000000000000000",
|
||||
"0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"00000000000000000000000000000000");
|
||||
|
||||
TestPoly1305("416e79207375626d697373696f6e20746f20746865204945544620696e74656e6465642062792074686520436f6e747269627"
|
||||
"5746f7220666f72207075626c69636174696f6e20617320616c6c206f722070617274206f6620616e204945544620496e7465"
|
||||
"726e65742d4472616674206f722052464320616e6420616e792073746174656d656e74206d6164652077697468696e2074686"
|
||||
"520636f6e74657874206f6620616e204945544620616374697669747920697320636f6e7369646572656420616e2022494554"
|
||||
"4620436f6e747269627574696f6e222e20537563682073746174656d656e747320696e636c756465206f72616c20737461746"
|
||||
"56d656e747320696e20494554462073657373696f6e732c2061732077656c6c206173207772697474656e20616e6420656c65"
|
||||
"6374726f6e696320636f6d6d756e69636174696f6e73206d61646520617420616e792074696d65206f7220706c6163652c207"
|
||||
"768696368206172652061646472657373656420746f",
|
||||
"0000000000000000000000000000000036e5f6b5c5e06070f0efca96227a863e",
|
||||
"36e5f6b5c5e06070f0efca96227a863e");
|
||||
|
||||
TestPoly1305("416e79207375626d697373696f6e20746f20746865204945544620696e74656e6465642062792074686520436f6e747269627"
|
||||
"5746f7220666f72207075626c69636174696f6e20617320616c6c206f722070617274206f6620616e204945544620496e7465"
|
||||
"726e65742d4472616674206f722052464320616e6420616e792073746174656d656e74206d6164652077697468696e2074686"
|
||||
"520636f6e74657874206f6620616e204945544620616374697669747920697320636f6e7369646572656420616e2022494554"
|
||||
"4620436f6e747269627574696f6e222e20537563682073746174656d656e747320696e636c756465206f72616c20737461746"
|
||||
"56d656e747320696e20494554462073657373696f6e732c2061732077656c6c206173207772697474656e20616e6420656c65"
|
||||
"6374726f6e696320636f6d6d756e69636174696f6e73206d61646520617420616e792074696d65206f7220706c6163652c207"
|
||||
"768696368206172652061646472657373656420746f",
|
||||
"36e5f6b5c5e06070f0efca96227a863e00000000000000000000000000000000",
|
||||
"f3477e7cd95417af89a6b8794c310cf0");
|
||||
|
||||
TestPoly1305("2754776173206272696c6c69672c20616e642074686520736c6974687920746f7665730a446964206779726520616e6420676"
|
||||
"96d626c6520696e2074686520776162653a0a416c6c206d696d737920776572652074686520626f726f676f7665732c0a416e"
|
||||
"6420746865206d6f6d65207261746873206f757467726162652e",
|
||||
"1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0",
|
||||
"4541669a7eaaee61e708dc7cbcc5eb62");
|
||||
|
||||
TestPoly1305("ffffffffffffffffffffffffffffffff",
|
||||
"0200000000000000000000000000000000000000000000000000000000000000",
|
||||
"03000000000000000000000000000000");
|
||||
|
||||
TestPoly1305("02000000000000000000000000000000",
|
||||
"02000000000000000000000000000000ffffffffffffffffffffffffffffffff",
|
||||
"03000000000000000000000000000000");
|
||||
|
||||
TestPoly1305("fffffffffffffffffffffffffffffffff0ffffffffffffffffffffffffffffff11000000000000000000000000000000",
|
||||
"0100000000000000000000000000000000000000000000000000000000000000",
|
||||
"05000000000000000000000000000000");
|
||||
|
||||
TestPoly1305("fffffffffffffffffffffffffffffffffbfefefefefefefefefefefefefefefe01010101010101010101010101010101",
|
||||
"0100000000000000000000000000000000000000000000000000000000000000",
|
||||
"00000000000000000000000000000000");
|
||||
|
||||
TestPoly1305("fdffffffffffffffffffffffffffffff",
|
||||
"0200000000000000000000000000000000000000000000000000000000000000",
|
||||
"faffffffffffffffffffffffffffffff");
|
||||
|
||||
TestPoly1305("e33594d7505e43b900000000000000003394d7505e4379cd01000000000000000000000000000000000000000000000001000000000000000000000000000000",
|
||||
"0100000000000000040000000000000000000000000000000000000000000000",
|
||||
"14000000000000005500000000000000");
|
||||
|
||||
TestPoly1305("e33594d7505e43b900000000000000003394d7505e4379cd010000000000000000000000000000000000000000000000",
|
||||
"0100000000000000040000000000000000000000000000000000000000000000",
|
||||
"13000000000000000000000000000000");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(hkdf_hmac_sha256_l32_tests)
|
||||
{
|
||||
// Use rfc5869 test vectors but truncated to 32 bytes (our implementation only support length 32)
|
||||
TestHKDF_SHA256_32(
|
||||
/* IKM */ "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b",
|
||||
/* salt */ "000102030405060708090a0b0c",
|
||||
/* info */ "f0f1f2f3f4f5f6f7f8f9",
|
||||
/* expected OKM */ "3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf");
|
||||
TestHKDF_SHA256_32(
|
||||
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f",
|
||||
"606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf",
|
||||
"b0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff",
|
||||
"b11e398dc80327a1c8e7f78c596a49344f012eda2d4efad8a050cc4c19afa97c");
|
||||
TestHKDF_SHA256_32(
|
||||
"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b",
|
||||
"",
|
||||
"",
|
||||
"8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879ec3454e5f3c738d2d");
|
||||
}
|
||||
|
||||
static void TestChaCha20Poly1305AEAD(bool must_succeed, unsigned int expected_aad_length, const std::string& hex_m, const std::string& hex_k1, const std::string& hex_k2, const std::string& hex_aad_keystream, const std::string& hex_encrypted_message, const std::string& hex_encrypted_message_seq_999)
|
||||
{
|
||||
// we need two sequence numbers, one for the payload cipher instance...
|
||||
uint32_t seqnr_payload = 0;
|
||||
// ... and one for the AAD (length) cipher instance
|
||||
uint32_t seqnr_aad = 0;
|
||||
// we need to keep track of the position in the AAD cipher instance
|
||||
// keystream since we use the same 64byte output 21 times
|
||||
// (21 times 3 bytes length < 64)
|
||||
int aad_pos = 0;
|
||||
|
||||
std::vector<unsigned char> aead_K_1 = ParseHex(hex_k1);
|
||||
std::vector<unsigned char> aead_K_2 = ParseHex(hex_k2);
|
||||
std::vector<unsigned char> plaintext_buf = ParseHex(hex_m);
|
||||
std::vector<unsigned char> expected_aad_keystream = ParseHex(hex_aad_keystream);
|
||||
std::vector<unsigned char> expected_ciphertext_and_mac = ParseHex(hex_encrypted_message);
|
||||
std::vector<unsigned char> expected_ciphertext_and_mac_sequence999 = ParseHex(hex_encrypted_message_seq_999);
|
||||
|
||||
std::vector<unsigned char> ciphertext_buf(plaintext_buf.size() + POLY1305_TAGLEN, 0);
|
||||
std::vector<unsigned char> plaintext_buf_new(plaintext_buf.size(), 0);
|
||||
std::vector<unsigned char> cmp_ctx_buffer(64);
|
||||
uint32_t out_len = 0;
|
||||
|
||||
// create the AEAD instance
|
||||
ChaCha20Poly1305AEAD aead(aead_K_1.data(), aead_K_1.size(), aead_K_2.data(), aead_K_2.size());
|
||||
|
||||
// create a chacha20 instance to compare against
|
||||
ChaCha20 cmp_ctx(aead_K_2.data(), 32);
|
||||
|
||||
// encipher
|
||||
bool res = aead.Crypt(seqnr_payload, seqnr_aad, aad_pos, ciphertext_buf.data(), ciphertext_buf.size(), plaintext_buf.data(), plaintext_buf.size(), true);
|
||||
// make sure the operation succeeded if expected to succeed
|
||||
BOOST_CHECK_EQUAL(res, must_succeed);
|
||||
if (!res) return;
|
||||
|
||||
// verify ciphertext & mac against the test vector
|
||||
BOOST_CHECK_EQUAL(expected_ciphertext_and_mac.size(), ciphertext_buf.size());
|
||||
BOOST_CHECK(memcmp(ciphertext_buf.data(), expected_ciphertext_and_mac.data(), ciphertext_buf.size()) == 0);
|
||||
|
||||
// manually construct the AAD keystream
|
||||
cmp_ctx.SetIV(seqnr_aad);
|
||||
cmp_ctx.Seek(0);
|
||||
cmp_ctx.Keystream(cmp_ctx_buffer.data(), 64);
|
||||
BOOST_CHECK(memcmp(expected_aad_keystream.data(), cmp_ctx_buffer.data(), expected_aad_keystream.size()) == 0);
|
||||
// crypt the 3 length bytes and compare the length
|
||||
uint32_t len_cmp = 0;
|
||||
len_cmp = (ciphertext_buf[0] ^ cmp_ctx_buffer[aad_pos + 0]) |
|
||||
(ciphertext_buf[1] ^ cmp_ctx_buffer[aad_pos + 1]) << 8 |
|
||||
(ciphertext_buf[2] ^ cmp_ctx_buffer[aad_pos + 2]) << 16;
|
||||
BOOST_CHECK_EQUAL(len_cmp, expected_aad_length);
|
||||
|
||||
// encrypt / decrypt 1000 packets
|
||||
for (size_t i = 0; i < 1000; ++i) {
|
||||
res = aead.Crypt(seqnr_payload, seqnr_aad, aad_pos, ciphertext_buf.data(), ciphertext_buf.size(), plaintext_buf.data(), plaintext_buf.size(), true);
|
||||
BOOST_CHECK(res);
|
||||
BOOST_CHECK(aead.GetLength(&out_len, seqnr_aad, aad_pos, ciphertext_buf.data()));
|
||||
BOOST_CHECK_EQUAL(out_len, expected_aad_length);
|
||||
res = aead.Crypt(seqnr_payload, seqnr_aad, aad_pos, plaintext_buf_new.data(), plaintext_buf_new.size(), ciphertext_buf.data(), ciphertext_buf.size(), false);
|
||||
BOOST_CHECK(res);
|
||||
|
||||
// make sure we repetitive get the same plaintext
|
||||
BOOST_CHECK(memcmp(plaintext_buf.data(), plaintext_buf_new.data(), plaintext_buf.size()) == 0);
|
||||
|
||||
// compare sequence number 999 against the test vector
|
||||
if (seqnr_payload == 999) {
|
||||
BOOST_CHECK(memcmp(ciphertext_buf.data(), expected_ciphertext_and_mac_sequence999.data(), expected_ciphertext_and_mac_sequence999.size()) == 0);
|
||||
}
|
||||
// set nonce and block counter, output the keystream
|
||||
cmp_ctx.SetIV(seqnr_aad);
|
||||
cmp_ctx.Seek(0);
|
||||
cmp_ctx.Keystream(cmp_ctx_buffer.data(), 64);
|
||||
|
||||
// crypt the 3 length bytes and compare the length
|
||||
len_cmp = 0;
|
||||
len_cmp = (ciphertext_buf[0] ^ cmp_ctx_buffer[aad_pos + 0]) |
|
||||
(ciphertext_buf[1] ^ cmp_ctx_buffer[aad_pos + 1]) << 8 |
|
||||
(ciphertext_buf[2] ^ cmp_ctx_buffer[aad_pos + 2]) << 16;
|
||||
BOOST_CHECK_EQUAL(len_cmp, expected_aad_length);
|
||||
|
||||
// increment the sequence number(s)
|
||||
// always increment the payload sequence number
|
||||
// increment the AAD keystream position by its size (3)
|
||||
// increment the AAD sequence number if we would hit the 64 byte limit
|
||||
seqnr_payload++;
|
||||
aad_pos += CHACHA20_POLY1305_AEAD_AAD_LEN;
|
||||
if (aad_pos + CHACHA20_POLY1305_AEAD_AAD_LEN > CHACHA20_ROUND_OUTPUT) {
|
||||
aad_pos = 0;
|
||||
seqnr_aad++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(chacha20_poly1305_aead_testvector)
|
||||
{
|
||||
/* test chacha20poly1305@digibyte AEAD */
|
||||
|
||||
// must fail with no message
|
||||
TestChaCha20Poly1305AEAD(false, 0,
|
||||
"",
|
||||
"0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"0000000000000000000000000000000000000000000000000000000000000000", "", "", "");
|
||||
|
||||
TestChaCha20Poly1305AEAD(true, 0,
|
||||
/* m */ "0000000000000000000000000000000000000000000000000000000000000000",
|
||||
/* k1 (payload) */ "0000000000000000000000000000000000000000000000000000000000000000",
|
||||
/* k2 (AAD) */ "0000000000000000000000000000000000000000000000000000000000000000",
|
||||
/* AAD keystream */ "76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7724e03fb8d84a376a43b8f41518a11cc387b669b2ee6586",
|
||||
/* encrypted message & MAC */ "76b8e09f07e7be5551387a98ba977c732d080dcb0f29a048e3656912c6533e32d2fc11829c1b6c1df1f551cd6131ff08",
|
||||
/* encrypted message & MAC at sequence 999 */ "b0a03d5bd2855d60699e7d3a3133fa47be740fe4e4c1f967555e2d9271f31c3aaa7aa16ec62c5e24f040c08bb20c3598");
|
||||
TestChaCha20Poly1305AEAD(true, 1,
|
||||
"0100000000000000000000000000000000000000000000000000000000000000",
|
||||
"0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7724e03fb8d84a376a43b8f41518a11cc387b669b2ee6586",
|
||||
"77b8e09f07e7be5551387a98ba977c732d080dcb0f29a048e3656912c6533e32baf0c85b6dff8602b06cf52a6aefc62e",
|
||||
"b1a03d5bd2855d60699e7d3a3133fa47be740fe4e4c1f967555e2d9271f31c3a8bd94d54b5ecabbc41ffbb0c90924080");
|
||||
TestChaCha20Poly1305AEAD(true, 255,
|
||||
"ff0000f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c9",
|
||||
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
|
||||
"ff0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
|
||||
"c640c1711e3ee904ac35c57ab9791c8a1c408603a90b77a83b54f6c844cb4b06d94e7fc6c800e165acd66147e80ec45a567f6ce66d05ec0cae679dceeb890017",
|
||||
"3940c1e92da4582ff6f92a776aeb14d014d384eeb30f660dacf70a14a23fd31e91212701334e2ce1acf5199dc84f4d61ddbe6571bca5af874b4c9226c26e650995d157644e1848b96ed6c2102d5489a050e71d29a5a66ece11de5fb5c9558d54da28fe45b0bc4db4e5b88030bfc4a352b4b7068eccf656bae7ad6a35615315fc7c49d4200388d5eca67c2e822e069336c69b40db67e0f3c81209c50f3216a4b89fb3ae1b984b7851a2ec6f68ab12b101ab120e1ea7313bb93b5a0f71185c7fea017ddb92769861c29dba4fbc432280d5dff21b36d1c4c790128b22699950bb18bf74c448cdfe547d8ed4f657d8005fdc0cd7a050c2d46050a44c4376355858981fbe8b184288276e7a93eabc899c4a",
|
||||
"f039c6689eaeef0456685200feaab9d54bbd9acde4410a3b6f4321296f4a8ca2604b49727d8892c57e005d799b2a38e85e809f20146e08eec75169691c8d4f54a0d51a1e1c7b381e0474eb02f994be9415ef3ffcbd2343f0601e1f3b172a1d494f838824e4df570f8e3b0c04e27966e36c82abd352d07054ef7bd36b84c63f9369afe7ed79b94f953873006b920c3fa251a771de1b63da927058ade119aa898b8c97e42a606b2f6df1e2d957c22f7593c1e2002f4252f4c9ae4bf773499e5cfcfe14dfc1ede26508953f88553bf4a76a802f6a0068d59295b01503fd9a600067624203e880fdf53933b96e1f4d9eb3f4e363dd8165a278ff667a41ee42b9892b077cefff92b93441f7be74cf10e6cd");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(countbits_tests)
|
||||
{
|
||||
FastRandomContext ctx;
|
||||
for (unsigned int i = 0; i <= 64; ++i) {
|
||||
if (i == 0) {
|
||||
// Check handling of zero.
|
||||
BOOST_CHECK_EQUAL(CountBits(0), 0U);
|
||||
} else if (i < 10) {
|
||||
for (uint64_t j = (uint64_t)1 << (i - 1); (j >> i) == 0; ++j) {
|
||||
// Exhaustively test up to 10 bits
|
||||
BOOST_CHECK_EQUAL(CountBits(j), i);
|
||||
}
|
||||
} else {
|
||||
for (int k = 0; k < 1000; k++) {
|
||||
// Randomly test 1000 samples of each length above 10 bits.
|
||||
uint64_t j = ((uint64_t)1) << (i - 1) | ctx.randbits(i - 1);
|
||||
BOOST_CHECK_EQUAL(CountBits(j), i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(sha256d64)
|
||||
{
|
||||
for (int i = 0; i <= 32; ++i) {
|
||||
unsigned char in[64 * 32];
|
||||
unsigned char out1[32 * 32], out2[32 * 32];
|
||||
for (int j = 0; j < 64 * i; ++j) {
|
||||
in[j] = InsecureRandBits(8);
|
||||
}
|
||||
for (int j = 0; j < i; ++j) {
|
||||
CHash256().Write({in + 64 * j, 64}).Finalize({out1 + 32 * j, 32});
|
||||
}
|
||||
SHA256D64(out2, in, i);
|
||||
BOOST_CHECK(memcmp(out1, out2, 32 * i) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(odo_permutation)
|
||||
{
|
||||
char buf[OdoCrypt::DIGEST_SIZE];
|
||||
for (int i = 0; i < OdoCrypt::DIGEST_SIZE; i++)
|
||||
buf[i] = i;
|
||||
for (int i = 0; i < 20; i++)
|
||||
OdoCrypt(i).Encrypt(buf, buf);
|
||||
for (int i = 19; i >= 0; i--)
|
||||
OdoCrypt(i).Decrypt(buf, buf);
|
||||
for (int i = 0; i < OdoCrypt::DIGEST_SIZE; i++)
|
||||
BOOST_CHECK(buf[i] == i);
|
||||
}
|
||||
|
||||
static void TestSHA3_256(const std::string& input, const std::string& output)
|
||||
{
|
||||
const auto in_bytes = ParseHex(input);
|
||||
const auto out_bytes = ParseHex(output);
|
||||
|
||||
SHA3_256 sha;
|
||||
// Hash the whole thing.
|
||||
unsigned char out[SHA3_256::OUTPUT_SIZE];
|
||||
sha.Write(in_bytes).Finalize(out);
|
||||
assert(out_bytes.size() == sizeof(out));
|
||||
BOOST_CHECK(std::equal(std::begin(out_bytes), std::end(out_bytes), out));
|
||||
|
||||
// Reset and split randomly in 3
|
||||
sha.Reset();
|
||||
int s1 = InsecureRandRange(in_bytes.size() + 1);
|
||||
int s2 = InsecureRandRange(in_bytes.size() + 1 - s1);
|
||||
int s3 = in_bytes.size() - s1 - s2;
|
||||
sha.Write(MakeSpan(in_bytes).first(s1)).Write(MakeSpan(in_bytes).subspan(s1, s2));
|
||||
sha.Write(MakeSpan(in_bytes).last(s3)).Finalize(out);
|
||||
BOOST_CHECK(std::equal(std::begin(out_bytes), std::end(out_bytes), out));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(keccak_tests)
|
||||
{
|
||||
// Start with the zero state.
|
||||
uint64_t state[25] = {0};
|
||||
CSHA256 tester;
|
||||
for (int i = 0; i < 262144; ++i) {
|
||||
KeccakF(state);
|
||||
for (int j = 0; j < 25; ++j) {
|
||||
unsigned char buf[8];
|
||||
WriteLE64(buf, state[j]);
|
||||
tester.Write(buf, 8);
|
||||
}
|
||||
}
|
||||
uint256 out;
|
||||
tester.Finalize(out.begin());
|
||||
// Expected hash of the concatenated serialized states after 1...262144 iterations of KeccakF.
|
||||
// Verified against an independent implementation.
|
||||
BOOST_CHECK_EQUAL(out.ToString(), "5f4a7f2eca7d57740ef9f1a077b4fc67328092ec62620447fe27ad8ed5f7e34f");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(sha3_256_tests)
|
||||
{
|
||||
// Test vectors from https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/sha3/sha-3bytetestvectors.zip
|
||||
|
||||
// SHA3-256 Short test vectors (SHA3_256ShortMsg.rsp)
|
||||
TestSHA3_256("", "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a");
|
||||
TestSHA3_256("e9", "f0d04dd1e6cfc29a4460d521796852f25d9ef8d28b44ee91ff5b759d72c1e6d6");
|
||||
TestSHA3_256("d477", "94279e8f5ccdf6e17f292b59698ab4e614dfe696a46c46da78305fc6a3146ab7");
|
||||
TestSHA3_256("b053fa", "9d0ff086cd0ec06a682c51c094dc73abdc492004292344bd41b82a60498ccfdb");
|
||||
TestSHA3_256("e7372105", "3a42b68ab079f28c4ca3c752296f279006c4fe78b1eb79d989777f051e4046ae");
|
||||
TestSHA3_256("0296f2c40a", "53a018937221081d09ed0497377e32a1fa724025dfdc1871fa503d545df4b40d");
|
||||
TestSHA3_256("e6fd42037f80", "2294f8d3834f24aa9037c431f8c233a66a57b23fa3de10530bbb6911f6e1850f");
|
||||
TestSHA3_256("37b442385e0538", "cfa55031e716bbd7a83f2157513099e229a88891bb899d9ccd317191819998f8");
|
||||
TestSHA3_256("8bca931c8a132d2f", "dbb8be5dec1d715bd117b24566dc3f24f2cc0c799795d0638d9537481ef1e03e");
|
||||
TestSHA3_256("fb8dfa3a132f9813ac", "fd09b3501888445ffc8c3bb95d106440ceee469415fce1474743273094306e2e");
|
||||
TestSHA3_256("71fbacdbf8541779c24a", "cc4e5a216b01f987f24ab9cad5eb196e89d32ed4aac85acb727e18e40ceef00e");
|
||||
TestSHA3_256("7e8f1fd1882e4a7c49e674", "79bef78c78aa71e11a3375394c2562037cd0f82a033b48a6cc932cc43358fd9e");
|
||||
TestSHA3_256("5c56a6b18c39e66e1b7a993a", "b697556cb30d6df448ee38b973cb6942559de4c2567b1556240188c55ec0841c");
|
||||
TestSHA3_256("9c76ca5b6f8d1212d8e6896ad8", "69dfc3a25865f3535f18b4a7bd9c0c69d78455f1fc1f4bf4e29fc82bf32818ec");
|
||||
TestSHA3_256("687ff7485b7eb51fe208f6ff9a1b", "fe7e68ae3e1a91944e4d1d2146d9360e5333c099a256f3711edc372bc6eeb226");
|
||||
TestSHA3_256("4149f41be1d265e668c536b85dde41", "229a7702448c640f55dafed08a52aa0b1139657ba9fc4c5eb8587e174ecd9b92");
|
||||
TestSHA3_256("d83c721ee51b060c5a41438a8221e040", "b87d9e4722edd3918729ded9a6d03af8256998ee088a1ae662ef4bcaff142a96");
|
||||
TestSHA3_256("266e8cbd3e73d80df2a49cfdaf0dc39cd1", "6c2de3c95900a1bcec6bd4ca780056af4acf3aa36ee640474b6e870187f59361");
|
||||
TestSHA3_256("a1d7ce5104eb25d6131bb8f66e1fb13f3523", "ee9062f39720b821b88be5e64621d7e0ca026a9fe7248d78150b14bdbaa40bed");
|
||||
TestSHA3_256("d751ccd2cd65f27db539176920a70057a08a6b", "7aaca80dbeb8dc3677d18b84795985463650d72f2543e0ec709c9e70b8cd7b79");
|
||||
TestSHA3_256("b32dec58865ab74614ea982efb93c08d9acb1bb0", "6a12e535dbfddab6d374058d92338e760b1a211451a6c09be9b61ee22f3bb467");
|
||||
TestSHA3_256("4e0cc4f5c6dcf0e2efca1f9f129372e2dcbca57ea6", "d2b7717864e9438dd02a4f8bb0203b77e2d3cd8f8ffcf9dc684e63de5ef39f0d");
|
||||
TestSHA3_256("d16d978dfbaecf2c8a04090f6eebdb421a5a711137a6", "7f497913318defdc60c924b3704b65ada7ca3ba203f23fb918c6fb03d4b0c0da");
|
||||
TestSHA3_256("47249c7cb85d8f0242ab240efd164b9c8b0bd3104bba3b", "435e276f06ae73aa5d5d6018f58e0f009be351eada47b677c2f7c06455f384e7");
|
||||
TestSHA3_256("cf549a383c0ac31eae870c40867eeb94fa1b6f3cac4473f2", "cdfd1afa793e48fd0ee5b34dfc53fbcee43e9d2ac21515e4746475453ab3831f");
|
||||
TestSHA3_256("9b3fdf8d448680840d6284f2997d3af55ffd85f6f4b33d7f8d", "25005d10e84ff97c74a589013be42fb37f68db64bdfc7626efc0dd628077493a");
|
||||
TestSHA3_256("6b22fe94be2d0b2528d9847e127eb6c7d6967e7ec8b9660e77cc", "157a52b0477639b3bc179667b35c1cdfbb3eef845e4486f0f84a526e940b518c");
|
||||
TestSHA3_256("d8decafdad377904a2789551135e782e302aed8450a42cfb89600c", "3ddecf5bba51643cd77ebde2141c8545f862067b209990d4cb65bfa65f4fa0c0");
|
||||
TestSHA3_256("938fe6afdbf14d1229e03576e532f078898769e20620ae2164f5abfa", "9511abd13c756772b852114578ef9b96f9dc7d0f2b8dcde6ea7d1bd14c518890");
|
||||
TestSHA3_256("66eb5e7396f5b451a02f39699da4dbc50538fb10678ec39a5e28baa3c0", "540acf81810a199996a612e885781308802fe460e9c638cc022e17076be8597a");
|
||||
TestSHA3_256("de98968c8bd9408bd562ac6efbca2b10f5769aacaa01365763e1b2ce8048", "6b2f2547781449d4fa158180a178ef68d7056121bf8a2f2f49891afc24978521");
|
||||
TestSHA3_256("94464e8fafd82f630e6aab9aa339d981db0a372dc5c1efb177305995ae2dc0", "ea7952ad759653cd47a18004ac2dbb9cf4a1e7bba8a530cf070570c711a634ea");
|
||||
TestSHA3_256("c178ce0f720a6d73c6cf1caa905ee724d5ba941c2e2628136e3aad7d853733ba", "64537b87892835ff0963ef9ad5145ab4cfce5d303a0cb0415b3b03f9d16e7d6b");
|
||||
TestSHA3_256("14365d3301150d7c5ba6bb8c1fc26e9dab218fc5d01c9ed528b72482aadee9c27bef667907797d55514468f68791f053daa2df598d7db7d54beea493bdcbb0c75c7b36ad84b9996dca96354190bd96d9d7fbe8ff54ffaf77c55eb92985da50825ee3b4179f5ec88b6fa60bb361d0caf9493494fe4d28ef843f0f498a2a9331b82a", "9b690531dee948a9c559a2e0efab2ec824151a9175f2730a030b748d07cbaa7f");
|
||||
TestSHA3_256("4a757db93f6d4c6529211d70d5f8491799c0f73ae7f24bbd2138db2eaf2c63a85063b9f7adaa03fc348f275323248334e3ffdf9798859f9cf6693d29566ff7d50976c505ecb58e543c459b39acdf4ce4b5e80a682eaa7c1f1ce5fe4acb864ff91eb6892b23165735ea49626898b40ceeb78161f5d0ea4a103cb404d937f9d1dc362b", "1ac7cc7e2e8ea14fb1b90096f41265100712c5dd41519d78b2786cfb6355af72");
|
||||
TestSHA3_256("da11c39c77250f6264dda4b096341ff9c4cc2c900633b20ea1664bf32193f790a923112488f882450cf334819bbaca46ffb88eff0265aa803bc79ca42739e4347c6bff0bb9aa99780261ffe42be0d3b5135d03723338fb2776841a0b4bc26360f9ef769b34c2bec5ed2feb216e2fa30fa5c37430c0360ecbfba3af6fb6b8dedacbb95c", "c163cd43de224ac5c262ae39db746cfcad66074ebaec4a6da23d86b310520f21");
|
||||
TestSHA3_256("3341ca020d4835838b0d6c8f93aaaebb7af60730d208c85283f6369f1ee27fd96d38f2674f316ef9c29c1b6b42dd59ec5236f65f5845a401adceaa4cf5bbd91cac61c21102052634e99faedd6cdddcd4426b42b6a372f29a5a5f35f51ce580bb1845a3c7cfcd447d269e8caeb9b320bb731f53fe5c969a65b12f40603a685afed86bfe53", "6c3e93f2b49f493344cc3eb1e9454f79363032beee2f7ea65b3d994b5cae438f");
|
||||
TestSHA3_256("989fc49594afc73405bacee4dbbe7135804f800368de39e2ea3bbec04e59c6c52752927ee3aa233ba0d8aab5410240f4c109d770c8c570777c928fce9a0bec9bc5156c821e204f0f14a9ab547e0319d3e758ae9e28eb2dbc3d9f7acf51bd52f41bf23aeb6d97b5780a35ba08b94965989744edd3b1d6d67ad26c68099af85f98d0f0e4fff9", "b10adeb6a9395a48788931d45a7b4e4f69300a76d8b716c40c614c3113a0f051");
|
||||
TestSHA3_256("e5022f4c7dfe2dbd207105e2f27aaedd5a765c27c0bc60de958b49609440501848ccf398cf66dfe8dd7d131e04f1432f32827a057b8904d218e68ba3b0398038d755bd13d5f168cfa8a11ab34c0540873940c2a62eace3552dcd6953c683fdb29983d4e417078f1988c560c9521e6f8c78997c32618fc510db282a985f868f2d973f82351d11", "3293a4b9aeb8a65e1014d3847500ffc8241594e9c4564cbd7ce978bfa50767fe");
|
||||
TestSHA3_256("b1f6076509938432145bb15dbe1a7b2e007934be5f753908b50fd24333455970a7429f2ffbd28bd6fe1804c4688311f318fe3fcd9f6744410243e115bcb00d7e039a4fee4c326c2d119c42abd2e8f4155a44472643704cc0bc72403b8a8ab0fd4d68e04a059d6e5ed45033b906326abb4eb4147052779bad6a03b55ca5bd8b140e131bed2dfada", "f82d9602b231d332d902cb6436b15aef89acc591cb8626233ced20c0a6e80d7a");
|
||||
TestSHA3_256("56ea14d7fcb0db748ff649aaa5d0afdc2357528a9aad6076d73b2805b53d89e73681abfad26bee6c0f3d20215295f354f538ae80990d2281be6de0f6919aa9eb048c26b524f4d91ca87b54c0c54aa9b54ad02171e8bf31e8d158a9f586e92ffce994ecce9a5185cc80364d50a6f7b94849a914242fcb73f33a86ecc83c3403630d20650ddb8cd9c4", "4beae3515ba35ec8cbd1d94567e22b0d7809c466abfbafe9610349597ba15b45");
|
||||
|
||||
// SHA3-256 Long test vectors (SHA3_256LongMsg.rsp)
|
||||
TestSHA3_256("b1caa396771a09a1db9bc20543e988e359d47c2a616417bbca1b62cb02796a888fc6eeff5c0b5c3d5062fcb4256f6ae1782f492c1cf03610b4a1fb7b814c057878e1190b9835425c7a4a0e182ad1f91535ed2a35033a5d8c670e21c575ff43c194a58a82d4a1a44881dd61f9f8161fc6b998860cbe4975780be93b6f87980bad0a99aa2cb7556b478ca35d1f3746c33e2bb7c47af426641cc7bbb3425e2144820345e1d0ea5b7da2c3236a52906acdc3b4d34e474dd714c0c40bf006a3a1d889a632983814bbc4a14fe5f159aa89249e7c738b3b73666bac2a615a83fd21ae0a1ce7352ade7b278b587158fd2fabb217aa1fe31d0bda53272045598015a8ae4d8cec226fefa58daa05500906c4d85e7567", "cb5648a1d61c6c5bdacd96f81c9591debc3950dcf658145b8d996570ba881a05");
|
||||
TestSHA3_256("712b03d9ebe78d3a032a612939c518a6166ca9a161183a7596aa35b294d19d1f962da3ff64b57494cb5656e24adcf3b50e16f4e52135d2d9de76e94aa801cf49db10e384035329c54c9455bb3a9725fd9a44f44cb9078d18d3783d46ce372c31281aecef2f8b53d5702b863d71bc5786a33dd15d9256103b5ff7572f703d5cde6695e6c84f239acd1d6512ef581330590f4ab2a114ea064a693d5f8df5d908587bc7f998cde4a8b43d8821595566597dc8b3bf9ea78b154bd8907ee6c5d4d8a851f94be510962292b7ddda04d17b79fab4c022deb400e5489639dbc448f573d5cf72073a8001b36f73ac6677351b39d9bdb900e9a1121f488a7fa0aee60682e7dc7c531c85ec0154593ded3ae70e4121cae58445d8896b549cacf22d07cdace7625d57158721b44851d796d6511c38dac28dd37cbf2d7073b407fbc813149adc485e3dacee66755443c389d2d90dc70d8ff91816c0c5d7adbad7e30772a1f3ce76c72a6a2284ec7f174aefb6e9a895c118717999421b470a9665d2728c3c60c6d3e048d58b43c0d1b5b2f00be8b64bfe453d1e8fadf5699331f9", "095dcd0bc55206d2e1e715fb7173fc16a81979f278495dfc69a6d8f3174eba5a");
|
||||
TestSHA3_256("2a459282195123ebc6cf5782ab611a11b9487706f7795e236df3a476404f4b8c1e9904e2dc5ef29c5e06b179b8649707928c3913d1e53164747f1fa9bba6eeaf8fb759d71e32adc8c611d061345882f1cdeee3ab4cab3554adb2e43f4b01c37b4546994b25f4dcd6c497bc206865643930157cb5b2f4f25be235fa223688535907efcc253bcd083021407ea09cb1c34684aa0c1849e7efe2d9af6938c46525af9e5afb4da6e5b83da4b61dc718672a8090549cbe5aadb44f5bc93a6b3fbdc2e6d32e2eaaae637465179ea17f23ad1e4f1ebc328e2c6dc90c302b74a1edbbb0676c136b269d70c41040a313af06ab291bf489d9700950b77f207c1fc41884799931b3bca8b93331a6e96b7a3f0a8bd24cdb64964c377e0512f36444bb0643a4e3ecb328194cd5428fd89ede167472a14a9bf5730aff1e3b2c708de96eff1ebaaf63beb75f9c7d8034d6e5471e8f8a1f7efce37793a958e134619c19c54d3d42645f7a7263f25471fbaae8be3ea2fbd34ec6d7aacd7d5680948c3cd9a837c9c469a88f600d95829f4d1e4e4a5ef4ed4623c07815a1c33d9fb3b91333ff04eac92806a68a46cf2e9293f8bff466ce87fe66b46fbff7c238c7f9b2c92eb2fdc7d8084167f6f4e680d03301e5c33f78f1857d6863b1b8c36c7fce3e07d2a96a8979712079ae0023a1e3970165bfcf3a5463d2a4fdf1ca0e044f9a247528cd935734cb6d85ba53ceb95325c0eaf0ff5cd81ecb32e58917eb26bfc52dba3704bf5a927fee3220", "cb1c691c87244c0caf733aacd427f83412cd48820b358c1b15dd9fadee54e5af");
|
||||
TestSHA3_256("32659902674c94473a283be00835eb86339d394a189a87da41dad500db27da6b6a4753b2bb219c961a227d88c6df466ba2fc1e9a2d4c982db4398778c76714d5e9940da48bc3808f3c9989131a07683b8c29d6af336e9aee1dfa57d83c48a86f17146edec07869bb06550689ebf4788159ed0a921048b4a6e3e3ec272413bec15d8e1f6a40897fa0e11d9df223ef9fc270106249ae220fdc6ebdef6d6611805421ccc850f53ee9c836baf657a94005883b5a85def344d218264f07b2ea8714afcc941096c6ded0bb6bf5b8bf652fd15a21931c58c9f526e27363ddff98c0a25bc7af9f469ab35bffea948b333f042cc18a82cec0177f33c3bdbf185b580353de79e51e675b03b31e195f19ba1f063d44def0441dc52820426c2c61cf12974ec249fd3502f017ffa06220075ced7e2d6b86a52677ba3916e8e8726062aec5bc8ea1c18b1e4137680b2c9d002191b423bee8691bd7e0f93c3b9959bc1c14d5c5cbe8f7c9c336aa16e9de9faa12f3f048c66d04cb441eb2bbc5e8a91e052c0f9000856896f9b7ba30c1e2eead36fc7ac30a7d3ddfc65caaba0e3b292d26dfba46b5e2dc9bc9acadde1c9f52b2969299bd1281ddff65822b629cfba2928613200e73661b803afdcc4a817d9361389e975e67dfadd22a797bdaf991ddf42db18711c079ecec55925f9978e478612609bacd900172011c27e24bad639ffc24a23877278318872153aef6893ccb5b68b94b33154df7334375aadd3edbb35272cc7b672dec68faa62900873ded52f6049891b77f2d0311a84b19b73660e09d1f1998095c1da1edecfa9f741b5fd6db048dd68255085d43529279021d59ed853470d6863b7c8e07fcb0d1e6acfb1eb16f7f60bb1f46ce70493010e57930a3b4b8b87e065272f6f1dd31df057627f4214e58798b664e1e40960f2789d44ccacfb3dbd8b02a68a053976711f8034c1ed3a8", "5ac9275e02543410359a3f364b2ae3b85763321fd6d374d13fe54314e5561b01");
|
||||
TestSHA3_256("a65da8277a3b3738432bca9822d43b3d810cdad3b0ed2468d02bd269f1a416cd77392190c2dde8630eeb28a297bda786017abe9cf82f14751422ac9fff6322d5d9a33173db49792d3bc37fff501af667f7ca3dd335d028551e04039ef5a9d42a9443e1b80ea872fd945ad8999514ae4a29a35f60b0f7e971b67ae04d1ba1b53470c03847a3225c3ddf593a57aed3599661ae2d2bb1cddd2fa62c4a94b8704c5c35c33e08e2debe54e567ae21e27e7eb36593ae1c807a8ef8b5c1495b15412108aaf3fce4130520aa6e2d3bdf7b3ea609fdf9ea1c64258435aae2e58a7b3abda198f979c17dbe0aa74253e979bf3a5800f388ea11a7f7454c4e36270a3083a790c77cbe89693205b32880c0d8f79b1c000ee9b5e58f175ba7696616c17c45673cff25d1221f899836e95cc9e26a887a7115c4537e65ad4eacc319ba98a9a8860c089cbc76e7ea4c984d900b80622afbbbd1c0cdc670e3a4c523f81c77fed38b6aa988876b097da8411cc48e9b25a826460a862aa3fadfe75952aa4347c2effebdac9138ebcc6c34991e9f5b19fc2b847a87be72ff49c99ecf19d837ee3e23686cd760d9dd7adc78091bca79e42fdb9bc0120faec1a6ca52913e2a0156ba9850e1f39d712859f7fdf7daedf0e206dff67e7121e5d1590a8a068947a8657d753e83c7f009b6b2e54acc24afc9fdc9601a1d6d9d1f17aab0ce96c4d83405d1e3baba1dffa86ecccee7f1c1b80b1bbf859106ce2b647ae1e4a6a9b584ae1dfc0a4deebb755638f1d95dcc79b1be263177e2a05c72bde545d09ba726f41d9547117e876af81bfc672e33c71442eb05675d9552df1b313d1f9934f9ddd08955fa21d6edf23000a277f6f149591299a0a96032861ecdc96bb76afa05a2bffb445d61dc891bc70c13695920b911cad0df3fa842a3e2318c57556974343f69794cb8fa18c1ad624835857e4781041198aa705c4d11f3ef82e941be2aee7a770e54521312fe6facbaf1138eee08fa90fae986a5d93719aeb30ac292a49c1d91bf4574d553a92a4a6c305ab09db6bbeffd84c7aa707f1c1628a0220d6ba4ee5e960566686228a6e766d8a30dddf30ed5aa637c949950c3d0e894a7560670b6879a7d70f3c7e5ab29aed236cc3527bdea076fec8add12d784fbcf9a", "68f62c418a6b97026cc70f6abf8419b671ee373709fa13074e37bd39f0a50fcb");
|
||||
TestSHA3_256("460f8c7aac921fa9a55800b1d04cf981717c78217cd43f98f02c5c0e66865c2eea90bcce0971a0d22bc1c74d24d9bfea054e558b38b8502fccb85f190d394f2f58f581a02d3b9cc986f07f5a67d57ab4b707bd964ecc10f94f8cc538b81eeb743746c537407b7b575ced0e1ec4c691a72eb0978be798e8be22b278b390be99c730896fdc69b6a44456be5ee261366e8b1351cbb22aa53e45ec325ed2bca0bfeeebc867d7d07681581b6d56ed66ac78280df04053407a7b57561261dd644cc7b20f0a95709e42795b5402dd89fcb11746c597e0b650a008bc085c681bb24b17db4458e1effba3f414a883ddfc4bccb3ace24d9223839d4b3ca9185ad5cc24193134b9339b0e205a4cc0fa3d8f7a85b4230d1b3ee101fbae9ee14c2153da5f337c853573bd004114cb436ee58ab1648373ee07cc39f14198ac5a02a4dd0585cf83dfd4899df88e8859dae8bc351af286642c1c25737bf8712cb941cbbb741d540feb9f5d831f901fbe2d6facd7dab626bd705f2fd7c9a7a0e7a9127e3451af2ae8509dd7b79dce41c1e30b9dba1c38cb4861dad3ac00d68fa5d07ba591c1c3b9d6b7d6e08099d0572ca4c475240601decba894fa3c4b0ea52ed687281beee268a1c8535e283b1fc7c51aa31d5ec098c50fec958acdd0d54a49643bef170093a1102a1b3bf5ad42fb55ebaf7db07385eadcd6e66da8b7b6e6c022a1e3d01f5fccec86365d3014c159a3bff17d614751b3fa0e8e89152936e159b7c0ea8d71cd4ffd83adae209b254b793f6f06bb63838a303b95c85b4edfa4ddcca0ed952165930bca87140f67f5389d1233fe04f0a3d647050410c44d389513084ad53155af00de02cc7943a3b988d8e1454f85153aff0816e24b964ec91dc514c588a93634ff3dd485c40575faa2f254abdf86fbcf6d381337601a7b1ba5b99719f045eb7bf6f2e8b9dd9d053ef0b3126f984fc9ea87a2a70b3798fab593b83a4ff44d9c0c4ec3e570ac537c10d9e3c4996027a813b70d7867b858f31f508aa56e7b087370707974b2186f02f5c549112f2158c0d365402e52cba18fe245f77f7e6fbf952ec2dc3c880b38be771caea23bc22838b1f70472d558bdf585d9c77088b7ba2dceaeb3e6f96df7d91d47da1ec42be03936d621ecf747f24f9073c122923b4161d99bc8190e24f57b6fac952ed344c7eae86a5f43c08089c28c7daf3aa7e39c59d6f1e17ece1977caf6b4a77a6ff52774521b861f38ebc978005e5763cc97123e4d17c7bc4134c8f139c7d7a9a02646fef9525d2a6871fc99747e81430b3fec38c677427c6f5e2f16c14eee646ebf6eb16775ad0957f8684c7045f7826bc3736eca", "7d495ddf961cbff060f80b509f2b9e20bed95319eef61c7adb5edeec18e64713");
|
||||
TestSHA3_256("c8a2a26587d0126abe9ba8031f37d8a7d18219c41fe639bc7281f32d7c83c376b7d8f9770e080d98d95b320c0f402d57b7ef680da04e42dd5211aacf4426ecca5050ca596312cfae79cee0e8c92e14913cc3c66b24ece86c2bfa99078991faad7b513e94f0b601b7853ddb1eb3c9345f47445a651389d070e482ea5db48d962820257daf1cbe4bb8e5f04a3637d836c8c1bc4d83d6eda5f165f2c2592be268412712ae324ef054bb812f56b8bc25c1d59071c64dd3e00df896924c84575817027861faa5f016c5c74142272daa767e8c9dacee4c732ab08b5fa9ad65a0b74c73fb5a889169f645e50d70e41d689415f7d0b4ec071e9238b5a88110856fc6ae9b9944817e21597d1ccd03b60e60472d1e11d3e9063de24a7b59609b6a2a4ee68238690cf2800614746941c48af9566e07494f0dd236e091e75a8f769e3b179b30c10f5277eec7b3f5c97337189b8b82bc5e717ff27355b2009356caa908e976ae1d7f7a94d36202a8d5e03641aeac0e453a8168ee5a0858ceecfcbf11fb8c1f033201add297a0a89476d2ea8b9a82bda8c3c7ef4f55c3295a4ecb7c607ac73d37eadc13b7a2494ec1928f7a80c8d534efe38a3d9ccb4ccdab9f092a1def6478532c5ad3cd5c259b3812600fa89e6d1e228114795d246cedc9c9fff0d1c1297a5ddfc1169c2efb3800df8dd18a8511214785abcc1bc7eb31bdb2f5f70358dfe860ed5a03ab7e95cc21df5ee7aee68be568d6985e5c1e91408e4432663b1c4e6d613d6dc382b5b900a4fc1b7a9c27a1138c5e2356ab9026c34465006602753daf6ab7427da93c307c901d0bb1ddb21c53bc0493dd8d857161e8ffa51fdecb75568243205aa979c2e7ed2a77b5f8edc34cffb0321a8c653bc381f96ab85a86bf0bb2c9518208d636eac40aa7ad754260a75d4a46362f994c90173b975afb0ee17601311b1c51ba562c1ca7e3c2dd18b90bdebb1858fe876c71b3ad742c4bcba33e7763c750098de856fde8731cb6d698218be9f0a98298630e5b374957d126cf0b1c489c48bab6b50f6fb59ee28be6c3916bbd16514234f80e1ac15d0215852b87f9c6e429eb9f85007bf6ae3de1af0202861fd177c7c4f51af533f956a051815815c6e51e25af20d02893e95442991f1de5f86a4397ae20d9f675657bf9f397267831e94cef4e4d287f759850350ce0898f2e29de3c5c41f4246fe998a8d1359a2bed36ded1e4d6b08682025843700fee8cab56703e342212870acdd53655255b35e414fa53d9810f47a37195f22d72f6e555392023a08adc282c585b2ae62e129efccdc9fe9617eecac12b2ecdabd247a1161a17750740f90ebed3520ceb17676f1fa87259815ff415c2794c5953f689c8d5407dbbd10d1241a986e265cea901af34ec1ded0323ca3290a317208ba865637af4797e65b9cfcad3b931bbf6ac896623e2f4408529172911f1b6a9bcae8279ec7e33452d0cd7b026b46a99cbe8a69cd4d21cdc6d3a84002fab527c4fd18a121526d49890ced3fb89beb384b524015a2e03c049241eb9", "b8d4b29b086ef6d6f73802b9e7a4f2001e384c8258e7046e6779662fd958517e");
|
||||
TestSHA3_256("3a86a182b54704a3af811e3e660abcfbaef2fb8f39bab09115c1068976ff694bb6f5a3839ae44590d73e4996d45af5ceb26b03218ab3fef6f5f4ef48d22839fb4371c270f9535357b22142c4ffb54e854b64cab41932fe888d41ca702e908c63eae244715bfbf69f481250f16f848dc881c6996e6f9d76f0e491de2c129f2a2ab22e72b04644f610a2fabc45aa2d7b3e5d77b87a135d2fd502ca74a207bddaf9a43e945245961a53c7bfcfe73a1ae090e6606ffe8ddbf1e0f0d6d4fa94526578c6faf282dd592b10bf4bce00a7b1846625690623667e83b9b59b465d42c6944e224ad36698f5f2ee938404b7775c2e66207bc41025adaf07590312f398812d24c0178126fdd334964a54b8353482a83be17cf2ee52d23b72e5f57fe31eebf8a1a64742eb9459bcb0eca231a1658ab88b7056d8e47554f0a46058d6565c6cbf6edec45fdde6f051e38255b82493de27ffd3efbe1b179b9642d2166073db6d4832707420237a00bad7125795e645e5bc3e1431ecbabf0ff5f74416626322545c966241cce6d8f2c035a78f100e030741f13b02a9eaf618d468bc40274db98bc342be12ad4d892c2ba546e571c556ac7cbf4e4c3fd3431efd40457cf65a297845dd8cce09811418c3cef941ff32c43c375157f6f49c2e893625e4b216b1f985aa0fd25f29a9011d4f59c78b037ed71f384e5de8116e3fc148c0a3cad07cb119b9829aac55eed9a299edb9abc5d017be485f690add70ff2efbb889ac6ce0da9b3bdbeb9dd47823116733d58a8d510b7f2e2c8244a2cbf53816b59e413207fb75f9c5ce1af06e67d182d3250ea3283bcbb45cb07ea6a6aa486361eb6f69199c0eb8e6490beff82e4ab274b1204e7f2f0ba097fba0332aa4c4a861771f5b3d45ce43e667581a40fee4bebe7fa9d87b70a5bb876c928f7e6d16ae604b3a4e9c7f1d616e2deab96b6207705b9a8f87468503cdd20a3c02cc8da43d046da68b5ed163d926a5a714a4df1b8ef007bca408f68b9e20de86d6398ad81df5e74d5aaac40874b5d6787211ff88e128cf1676e84ca7f51aee5951efee1915dcc11502a8df74fac4c8451dda49b631a8fb87470f0ebe9b67449bbd1640ceee6101e8cd82aa1033fa84f75b28450e461b93f65da5c43759b0e83660d50961702bb1ad015dad42e600117475237cf6e7279d4a02d1f67cf59de0108355d03963e3d84ce7647173dd7d77a6b3f275d7de74236d7bbb2df437d536136dbe1dbe8f307facc7bc7d0cde1abf745cbeb81af1ab2c46138cf007e901f22668377958bcbbadb7e9905973b27ff0c5baaece25e974c1bd116cc81dd1c81a30bae86a6fb12c6a5494068e122153128313eb3e628d76e9babc823c9eb9d3b81bacfa7a6b372abe6b1246a350f23e2e95b09c9037a75aac255ef7d4f267cad3ce869531b4165db2e5a9792094efea4ae3d9ea4d0efdc712e63df21882a353743190e016b2166e4da8a2c78e48defc7155d5fdfc4e596624e6a19c91b43719a22c1204b1cefe05989d455773d3881fa8d3eefc255f81dfe90bd41dc6f1e9c265a753298a6e98c999acd9525a9db5f9f9456a0f51a93dd9693e1d9c3fa283f7c58a9c752afcaa635abea8dfc80e2c326b939260069457fdad68c341852dcb5fcbbd351318defd7ae3b9f827478eb77306a5ae14cf8895f2bc6f0f361ffc8aa37e286629dc7e59b73a8712525e851c64d363065631edc1609f3d49a09575876a", "b71ec00c0fcc4f8663312711540df1cd236eb52f237409415b749ff9436dc331");
|
||||
TestSHA3_256("c041e23b6d55998681802114abc73d2776967cab715572698d3d497ec66a790b0531d32f45b3c432f5b2d8039ea47de5c6060a6514f3ff8fb5f58e61fd1b5b80524c812a46dad56c035a6e95ecb465ea8176d99b836e36f65977b7dbb3932a706d3af415b6f2549b7120ecb0db1e7d9e6f8df23607eda006436bccd32ef96d431fa434d9de22ca2608ab593eb50b4d6a57f45c1ce698c3283a77d330b876ad6030324a5c0693be7790a4bd26c0a25eb403531f37689829c20546d6dc97327131688b3d88766db8f5d1b22050450c37e53951446dd7155a3e6d7edcbe1354411d8f58154475d74008937e8ba48b706066c296d1a87936dd023ac8eebe7605a58c6c40da774cf9df189db0050adcf7629e66cbd1cf9824397834cb13c4066c26e6c8ec950b44fc1c8db8ef976a7ec8c4f4ec9849ca7a07f906223053b80db24b946b034ee7a30880d0ace348acba0d0ed21ea443816706a216ce9eb682d1fe9dfc1d2e0bf3b1449247413520b8d8ebc99fc298c6dca949be0ffebe450b9b79a387a615d617b8d9da5b3e8d2776208c7cc2a11bdbc387f9d4597b380739b24ae59dcd5fb63bfeefe0746d9266cfda18afa583d6891e483e6d5c0db305f5609beba75bb5b447ccac2dfb94ede4a94db6eaaf3070d8d5353f107f7bd74528eb913e0b19bed6236a3b48567c46a9eec28fb6486f92d0d09625452d8f4dd1b89c566533cc2326b820c2b9efed43be8481cb9ad809e47af7b31795cb0fbdb18fbb12e8853f8bacec366a092daf8f2a55d2911fc7c70ddd33d33e86c2c4ceeb9390ec506b399f6fa8f35abf7789d0f547fd09cb7e6fb6016a3fc2a27a762989ae620d234c810777d5a1bb633744af2844495d2963c986ef8540ca715bed7692c77b9dec90e06acc5986b47dd4a8d3ca3300b2bedf9f26ae6d1c7e7acef05c0fc521c3309e1e70771eea6e96b67de5e3fb6833145bb73d46081b074539498307929da779e003c27f0a171035458b8c7c86c905b23dda74c040878d5a05be94821537724ebd5608ec0754c3e3e99a719bbb6d5320eed07323fca637429b18378936364c389de1e9c6fce8af270a713b4b829b43e7d761e17724c22e84611e1322dde45cbee86a0e16d01cfb8910d99391c39afd8e5f5567c59f219aa8c19ad158f287cb6807ba1fe46d38d091639a217766b3aa9ded73ac14570ba236225218305d68c0be6099c336ba8455c86b7c8c04542e729ceb84596c33ca6eb7ec1091b406cf64495ccfa2169f47b3b590477d4073537c14c05015d51ba527b3869ae4ebd603df906323658b04cb11e13bc29b34ac69f18dd49f8958f7e3f5b05ab8b8ddb34e581bde5eb49dd15698d2d2b68fe7e8baf88d8f395cfcafcdff38cf34b59386f6f77333483655ee316f12bfeb00610d8cba9e59e637ca2cab6ed24dd584143844e61fcca994ba44a4c029682997ab04285f479a6dc2c854c569073c62cd68af804aa70f4976d5b9f6b09d3738fcccb6d60e11ba97a4001062195d05a43798d5f24e9466f082ac367169f892dfd6cc0adeef82212c867a49cba65e0e636bab91e2176d3865634aa45b13c1e3e7cdb4e7872b2437f40f3de5493792c06611a9ca97d0baed71bfb4e9fdd58191198a8b371aea7f65b6e851ce22f4808377d09b6a5a9f04eddc3ff4ef9fd8bf043bb559e1df5319113cb8beea9e06b0c05c50885873acd19f6e8a109c894403a415f627cd1e8f7ca54c288c230795aaddde3a787c2a20ac6dee4913da0240d6d971f3fce31fc53087afe0c45fa3c8f744c53673bec6231abe2623029053f4be0b1557e00b291ebb212d876e88bcc81e5bd9eb820691dca5fbdcc1e7a6c58945a2cac8db2d86c2a7d98dc5908598bda78ce202ac3cd174d48ad9cac9039e27f30658eef6317cd87c199944343e7fce1b3ea7", "ad635385a289163fbaf04b5850285bfe3759774aee7fd0211d770f63985e1b44");
|
||||
TestSHA3_256("01ec0bfc6cc56e4964808e2f1e516416717dad133061e30cb6b66b1dc213103b86b3b017fa7935457631c79e801941e3e3a0e1a3016d435e69a390eaac64f3166d944c8eb8df29fe95fdf27adc34631e4a1f3ff1d5af430f3d6f5908e40c0f83df1447274dfe30bbe76b758bd9abb40ed18331c7552dcc6959a1303e11134ec904bd0aab62de33c39703b99920851afd9d531eeb28f1c4b2e6c17c55db8296320316fbe19e881b5fcb4d266c58ca7f31d9176e26f70315330b58a516ec60d10404a78393aa03ced7acd225cb2a83caf3ab5888406a69a534f1ed1346e9b5e68831f90b872d57367361191c803eb7e38b3b9cd601282d5efdbf082db07d89bd06b093f986d08d3a7b12aa74513b6eb241b26ebf31da5726d59e315d1b4ee53ec6a9fdb6583bacc136e90e9607cab01e5d3853ab9727ede706b6f10b4e04d0510f45c0abc515bcb5ed0bcce86a92861126f4d502fcb8f988d62ecf9d124853de2bab633f9506c6fde8a36cd4413cf773e50f7b2d283482f18e2f547c2fc275cd60056ed98fb8d0816fd777c1566f0c2ae3b1cd92e344910a75e006106d193e06f7786ae37dd0e529cacf74176fd4cc1f6500549af5902dbbd56a70c194f5b671372edec425f90add40b4eb3d55123f3ab62797ad25bf5eecf4f417f86b00e6f76a4f52e44fd949851aae649dd0d26d641d4c1f343c7a2c851ca7851bbbdfd57ed6024eabc518a909a1e4689ea7bc5f83e19872950368a06e93ab41944c3d8befc5705b814e5f33511a7f7ea8a4771c804b321a3a3f32c18fa127d3c9e6c011337dc100ceb156ed45d0a62f238dacac44a3429f89bb7f98d09043c42451106e30471cc6fab7a4e1ce0a8202772b0218b631f287ec3ef82b1aa6299a0b54d6aad06aa9346d28f117d20f3b7f0d462267bd3c685cca8f4584532dfee0e8b9bacefa3092d28fcce7953a28f82e4ba6b3a1430ecca58b770dab656bed1b224663e196dffc28c96a2c65ef9de1989a125ecf2fed47eb96bef8a636a91bd521c47aeb8bc011bf81cc688fd8b620446353cbf7692201b5552cb07fb02eb3954dfaa6f5c31bf91e20b84419dcbbdaba0c31a124d8f4218b2f88da3eba44dbe40eb290052538dccd0ff7670de5f33a83ff74895b66adcff58c9c21e93b31bb49ccb2e026995ee155b5517b72daa76526a2e42aa6fa94357cd42e2a8a1d3e7d4cefc33d5d07d6303d798d2551a21f862b5f492d0c7cf078a77007a02847b34675dfad4fb457e9f20dc5750fb127a3c31b9d6a3996d50ac3ffc6ef29cca1d8414d0438bf3271dc4f4e00cfe19a507b447dc310f74aeb2a3c0b3fae6d7d13f4935bc72c35df3efa6e879164421505ee32d93b030e32a7970b53430b1643855167278e5058c4a48a7840e2fcdb282e45b5b86c0b2756f19b595f3bcfc926df35e33ac26dd1e88cd394015a5f54deb4c9f4a0bef0eabcb27c4eb88dc2302f09e92f1bcc4b4754df1eeb536154543c7dbf181c9979fe6ed08311e5a3acf365ebb5745212b2630e83b3a5bd5fa4834c727248b165700c7435f8cb6ee455bad16ee0da68fe6acd2062dae9c8bc178b157b29ade98a9bbbd4c723a3dcb7852c7978b488e4f73a2c9163dbdffae175119f812b6f4b70c2b498704bc2b58603f167f277a74e64ec296a6dfdb0de3486c0f36ac1b55f80af9fc817ba4f84b898b2a3c5725e2faf466bb26a8a84f91e123d182033a7ae2029236aa4b673ceb50c1733d7edd60e3f119b7141c882d508e0331689c96fbfb9f7e888fe88561de427c721123036737c1460b0da00d3f958b948f68fcb321ab4e297290f781ff8afb06b755d82a7e6ce1963761d799eed786524bf19801b4877b2d856becdf7e87d71aa359f2d51f09de64bcbf27d0c3aceac70790e314fd06c2f5216f3d10574b7302d6bc2775b185145c1b741524567c456d42c5826f93afa20ae7196ca7224c3b69b1eada9eee752fb6d43f24170fcc02af7e1dea73f0f884f936f900165800acb9d57480a31e409d3f676ed92b6812cf182a088fc49d68082aa19c7be0711f436db1d7be44d97dc9405591a8d3e7f6f731c6f3e6c401749829b7624497f5eeac1fc782e7d6988340541f2617a317e", "2a6283b1c02c6aaf74c4155091ff54a904bb700077f96a9c4bd84e8e51b54d01");
|
||||
TestSHA3_256("9271fd111dcf260c04cf4b748f269ac80f7485c41f7724352a7ed40b2e2125b0bf30f3984ee9d21aab6eb07ec976b557c2426e131ad32bd0485aa57172f0e4f1798760f8352067ac023fbeca7b9c8bf5851c724e90ffff44195b44ae73c9c317c85e8e585bddac6d0f2abf812d02e44b62eadb9d0765683aa56af8e9b91588c7b49dc3e146866a02dc18f9ca680f88006094ef29096c2d5af5700b4aca3dfcab462c48bb8085691671efb5ceb22b3ebd8702f71a1d7c184b1053c3fa30a7e76b85f3650d9140714fd4993bb496becf2ae01d3a98ccfdefb6fefd692173bd11af7adb61ffff214a550ffcd3a5993004ee72cb02ca9c577b42c85444e619e6411e2bca86bb548ebbd12a02c5c945eaa3b246f595d817f3849875429e72ac894160a2a91a6617f18e6b2b9258472152741d62843cebc537d25f0daebdedb410d71ee761662bd1b189ca1c93d648b5d141d8d05e3f2b2d8c2c40997fea7eb7e2cc0000d8b2300936759704ef85f38ad0d08a986de6bfd75b5be3209f6d4d3f67e7adf7f8469d47e81979ec8dae7127b5eadcc09779cf4b0a28efaaf58e83d307f2ced4a8699b142f3f19db5598e914e9577652c63f851203580d40699548fc2ab30a9dcf6452f673ad1ed92f8d84dad5dfff55e18107b3acb6e4e8e3c9c34038f40a5c577fe9771c2c31ef03d36a00e04a20d2d0877db66f091dac4b741d2a997b75182702881f9284fa23b9b3c20e715f80d07b9910a4b3185f9489dc7d3fb510f4da273559753d7d207f3975b48df2e7c857caffe703dfac53a786490c09f57d2fa93f60810186df4c0b6b616a04caab9f70a5002c5e5d8da0ed2805f20fbf89cd8d57ca2b4bd37125ce38bf09fb6170ae21f4e6043a9483ef6e585756d97cfb778e57bc7ddc8dfc54d086d6bcfa1f019c749ff79921ec56e833ff8660f0959cd4b5277e9f3b1d4880193fefa98a6c2512718e7c139acdcd324303db3adb70348d09b058baf0e91d52b24952f832b0a3b81fa9bc9a2e9fb276a64e9e0922778b4992d892f6845b4372a28e47d27b53443586d9015463cacb5b65c617f84e1168b15988737a7eda8187f1f4165fecbdd032ae04916cc4b6e18a87558d2ce6a5946c65a9446f66cda139a76506c60d560f56a013b508d6ccbbaa14e24ad0729dd823bf214efcc59e6932cdc860306687c84a63efb551237223641554940a7a60fa7e6ddad64a21b4a2176b046dc480b6c5b5ff7ed96e3211df609195b4028756c22479ba278105771493870372abe24dcc407daa69878b12b845908cf2e220e7fabeeaab88c8f64f864c2bacba0c14b2a693e45aacc6b7db76bc1a2195cfce7b68f3c99440477ea4c1ea5ee78c109f4f1b553c76eb513dd6e16c383ce7f3187ad66c1d5c982724de8e16299c2fde0a8af22e8de56e50a56ac0fef1c52e76864c0ad1eeedd8907065b37892b3eca0ddcdf5c8e0917dec78fedd194ea4b380a059ccc9452e48a9eba2f8b7a4150b7ba17feac83c61604c3cfcfe6655c2be37ef0ae6fc29072f9b1cfb277b64a8d499dd079ad9aa3d5e9a7ccbec8c100596c6fac51e13a260d78d8cd9066edc558e2219cfcda1310dc1fbbdd36f348756855349f33eb6b82186a8c1a55f361305833edd3e4ac8d9b9cf99897c4e06c19ed10765fd0c8c7433851445c5f87b119ef913b2bcdbf7aa2ad19c672e53a9c6c3c309d549513edd7c1cf8a0a399e6df0939cc1fb146d6ad460e2ce05144c69eafa3822141d473fbe5927c58a50c1e842f8b8fad85540ce9f6d06f7b4dea045248b999d24c5fd4d75631caf73518cc08f73684e2a1cd4266235d90c08a0d0ce8784c776fd1b80978b83f0705ba8498744884d5496b791f2db3ffb5377175856b25a643803aa8b9e7f1055e089c1929cf0cbba7674c204c4590fb076968e918e0390d268eeef78c2aebcbf58a429f28212a2425c6ad8970b6a09cadddd8336d519bca4820556d2c4b8cd9f41216de3c728a0774edf47d3489cd29cf1b2a192bc53325d0bed7d23e51be7684297f9d0ecb14acbf648bc440c5fde997acc464fb45e965e6f0dced6d4568ebcd55e5a64633b05a2cb4d8263b721a252b1710dc84d8a5d4b43fcc875e2e7281f621b0bf8bb3465be364456bcd990b26b3e474486f864fb85f320f68bc14c37d271249b18552bef50dfc385a9f41b831589c5a716357cf5a12520d582d00452a8ab21643dd180071d2041bbc5972099141c6292009540d02f3252f1f59f8dfcf4488803f3b0df41759055559a334e68c98ea491b0984f2f82a35db84ea0779b3801cf06b463a832e", "4e75bf3c580474575c96ec7faa03feb732379f95660b77149974133644f5d2a0");
|
||||
TestSHA3_256("075997f09ab1980a3179d4da78c2e914a1ff48f34e5d3c2ab157281ef1841052d0b45a228c3cd6b5028efd2d190d76205e1fdf4cec83c9868fe504f429af1e7c5423267c48a7b5bc005f30a1980147a3fae5c100b95c7cb23d43af9f21d87311d9cc826598993e077015f59ebc476383bb7a78787d915c97039ab188a2a618f7a8d7f64542ba787e9dd7d48c4c87d2aaea068c1b00c9711b2812901673c11418096d0a850fb36b0acece56d311689dfeceb0835009adc427f6d2d6b05ed26f5a43b6478bc72c1f914a2202dbd393cb69b1a1e78162e55ca4b3030ac0298131a7a0d934c032cc9dfc5afa600c59b064d2d9013f15d1184278a8ccb5ad9d7563e666fe5a8c173cec34467ef9cf6d6671208ff714741fee7c8d1d565edf82570dffde4f3f584024142056d8548ad55df83d1babed06141114c95ac88dbea0ce35d950f16d8a732a1ea7d22dfaa75a3e0410c546523277261116a64bcbb2be83e55e040f6c8c79f911b301a8718cc4b19a81d5f0cb6312d87c5b4b079e23a61d247541cfc2c41a37f52b2c6e43a3db5dc47892d0e1feabcc5c808f2391791e45fb065159f99c1d8dd2f69baaf75267eb89dd460f1b6c0badb96cbbc8291cefa370fa7ad6997a4ca2b1fe968216032f02f29837d40215fa219c09161df074e1de8e37056e28c86d1f992a651e271dfc4b0592ad481c613fd00c3eea4b6deabb9f5aa63a4830ed49ab93624fa7b208966eccb1f293f4b9a46411f37d7928e4478dde2f608d3851a8efa68e9d45402bc5124fde4ddc0f83ef82b31019d0aacb4b5121bbc064c95c5292da97981f58f051df9502054bf728e9d4fb7e04787a0890922b30a3f66a760e3d3763855e82be017fa603630a33115a02f02386982001def905784f6ba307a598c6dbaf2946fe9e978acbaf3e4ba50ab49ae8e9582520fc2eb6790deafc77e04a8ee75da92d16f0d249403112c74bc09102b573e110ccb4d8461d249bfe2e85fc9770d606be6fbfd5ec4c30ac306d46412f736e5b696ccc9fbe4adea730955c55ea5c63678271d34b7bd6f6340e72626d290820eeb96a0d2d25ea81361a122ffe8e954cf4ff84f4dafcc5c9d3e7c2ddbdf95ed2c0862d3f2783e4566f450ec49e8b01d9d7bf11e92a7903f2b045c57ed8a65ccbfc5b1d2a38e020a57b38f2e4deea8a52354a7e7be4f977b8f5afe30f6738e955c8bda295064586b6827b245766b217fe39263572b0850965c7ae845611b8efb64c36244a39b9fed0ab970ee5ddeb8f2608dd9c963524a14050c9101d7f2d5537b24d0b0f7a45703c1e131656ec9edc12cdf71dae1cde2790b888ef2a589f03201f8bbfad71f0c4430477a6713ad2e50aaefa1f840cbb839e277389454517e0b9bd76a8ecc5c2e22b854c25ff708f9256d3700adeaec49eb2c4134638ee9bd649b4982f931ec3b23cc819fbc835ddcb3d65e04585aa005e13b7ef8fcafa36cc1a2c79ba6c26fc1dc0f6668f9432c578088cd33a41a778ac0b298fcac212edab724c9fb33d827409fd36bc4b2b0e4e81006fd050d94d3271e0427c61e9ddca599a3c9480cfdd33603cb1a196557281ce6a375fef17463893db293dba0704d4bfda25e08beadd4208c58ea0d8d9066448910b087fc13792fc44075a3fe42e13c5792f093a552aa8ebe0f63e7a807102d5bc145468a0cb469263035c5647049054c18199f7da6d6defd51105e2125c605e327aca137ca85e3f7f46ca69f92d5252f84418293f4e9afeeb067c79576e88cc3c64f3e61d76e1e9e2f72cdfc35261a9679f0c374d7436ff6cfe2ba71650810522fa554a4aded87ad23f0b206b1bc63f56bbff8bcc8849d99e209bd519a953f32c667aa8cd874ad99846ed94b92f88fe0dbf788c8431dc76ca9553692622077da2cdea666c1b3fee7c335da37737afccd3d400a23d18f5bd3784dbcd0663a38acb5a2beef03fc0a1c52ee0b56bda4493f2221e35bee59f962f16bc6781133204f032c7a6209dd3dabd6100325ec14e3ab0d05aadd03fdfe9f8737da15edab9d2598046f8c6dd8381aaf244821994d5a956073c733bcebf9edbc2a6e2676242dc4e6a2e4ba8a7d57ed509340d61fae2c82bee4dedc73b469e202cc0916250d40a1718090690a1d3b986cf593b019b7b7f79ae14843b2e7ccf0fd85218184f7844fbb35e934476841b056b3a75bf20abb6866e19a0614e6a1af0eee4de510535724363b6598cccf08a99066021653177559c57e5aaff4417670a98fe4bd41a137c384f98c0324c20ef8bc851a9b975e9440191ff08deb78c9fa6fc29c76b371a4a1fa08c30fc9d1b3323d897738495086bfd43ef24c650cfa80c42ecbadc0453c4437d1a11b467e93ca95fbae98d38dcb2da953e657fb7ea6c8493d08cf028c5d3eb0fcbcb205493f4658440719e076e02deb07332d093e4d256175ca56f4c785d5e7e26c6090a20429f70b3757daac54153bc16f5828dc6c1c9f5186e2117754be5f1b46b3631980d9e4a9a5c", "2e07737d271b9a0162eb2f4be1be54887118c462317eb6bd9f9baf1e24111848");
|
||||
TestSHA3_256("119a356f8c0790bbd5e9f3b4c5c4a70e97f462364c88cad04d5435645342b35484e94e12df61908fd95546f74859849b817ee92fbd242435c210b7b9bfbffb3f77f965faa1a9073e8feb5a380f673add8fde32208402fa680c8b3e41d187a15131f1028f9d86feaf3fd4b6e0e094d2ba0839c67267c9535173ec51645343ad74fcfaae389aa17cca3137e2588488531c36ba2b8e2f2238d8415c798a0b9a258f1e3cef605fa18977ad3d6707c3ecc5ea5f86ebdaa4b4b0e5bc023d1bc335138ae0de506cb52f2d9efa0ecc546468310cccc88ec08d28c3602e07257f41bb7e4d8a0956c564f3712761d199a931a39e69c5a69aa7b3257931dd92b91e4ed56fbf64e48bd334945cfa2aaf576df04614eb914899f7df54db4012cc8261b12bedcab69876feedbbf7009dcf8d076af89b797ad71217d75cf07514dc07ae34640055c74c9faf560f491f015ac3e167623cfbc67b8e7163e7c1b92debd06e9d28b049e0298f4c38395a40a0778162af2cfe5abe5b946c4d9a54f2a321660ab521068c4957cd3f5be0324cc04f50f209fdea7caaa0ac705c1fb30abfa550e844f509074afde1ee87adda29aa09b7f93e7d064ad2715ee5571ee6e7c9a01672124cc2a22b4354c3844759c1a6ce3fdf17555cac7df73334073ef3730939410fe6cf37463352ad241958b7fafbc66e0d592df48bf55ab2c33428e494c6995826892572d9ab52747b1085fcbef318cfe9cfacd4cd80c164fba584c1344ae7e321c4f77b44db6b322f2f7831f4d4ede7dc407b065c6754cf4424f9903adb4c6b675ded58700bc36da83fd95e84e76c404f7342921ef23d7d07772f5b8ec2f077601cae13448385b04e074f895574be61a831a87efd68a1f6aa67cf291847fa8f74cbe3b4a78ad780895183bc51c30ad2514255d4e013abc097bc8103c0b1933b0b303341836ae167c1e31dfe5f1b791cb06ef29cae398065343eecf06e4ae2048d1547c4bf69ccec5e86c45867c633c62f7d27dc51234b6debb5b9f80a5810716240c64443d0c098c80220d0520a5f5834369b9eb019325e23e88f237c24440bf27959caf7e7e4f1671fda710630255a2962f7e9b3625dc243a0177aacf6a758a68aa85dc3f56181a4a59a406c7fae5575c9e2c64248f520b5a5f904821661e2e43a5a058f445fd0e55b07476c4122d18033053b45112201e0bfdcc9e7cb9931155018ca431a0564930aca8defbca954b2680753a4060bec2cb668d2c15e77cba29589b5c7c07bc7177a8b1adb3a6968732f9213476fd96901514626fa17243af1d156cd037eea81d773f1f71a018d942b524b851794b300c7591ecd783ec8066ccb261bdf9b7a183dbda42b92593b614297dcb0fabcc23ae69797d0251b8ab57a4da2a544615216b01f4dbe2d8c9b5520c7ed9cd9312e9ec6d05a36e7f693d1821d727518169b03976394b9d1e1d7fa2daa25529d391eb5d0cf0f07a8160be2ee043d9345037c655c4f2023689f14d8d2072dd92c1dba056a5b5d4c4fc4196e25caab05b1701ec666ac9a04d90f7d7575a7ac3970252c18fd3bec0cc448e5ff8f3765d546a4a8ad1d41a9640c79375b80534b7b50989976f238654fefea981c9413130beae943a3e9d8f64ce9256d1259d1b2a6b3c02ca5af1a701db8f25a4e9c255dad8785172f323728c3585a45206ae988c283e30a2f9ea9b47f07a7521b0f36e9c504c14bd96027e8d24161e70f196576d8a74a5e9c26acda7cc452a90e550e625a49e50829db70de808c827c67d00c23ee073d4e72aeed891dd73b86acd6756e753e3975a80cdab1d521052caef6a5380f8b03023ba0326a6928aa127ffb33b51dcb05bbdd592d0ad9e8321e6ef2f95c401be6a37e634425689fe7750e2a0fe05ad89001502b309095ca517b2e2ed0388b9f2c59c45feb61222539d6e1ccd397344d23708aebacec10ada96a7711f173f7ff1e4b94fceec6a0a0ea5d814a4581b412063012ff6ac5527b8314d00326b68c2304a276a217fde9fa4034750a2e47e10f816870d12fc4641a27a1c16c35a953f32685f2b92cae0519848045765591c42ddc402dc7c6914d74dd38d2b5e7f35358cb1d91a9f681fde7fd6c7af5840663525ee1d04bf6d3156fed018c44043d95383d92dada3d1cd84af51d9bee814ec8675073e1c48632c5f59e257682542e1f7dc20b56b5c92a9e2cb2be30cb1512fb55fa1de99a3f5864ed3acc19d79e6ffb0da3b08ba0615157747d75c1f308fa0202a4086f34e9eafa3e071dfbacaca731d228aa0304cf390c0a9e6ad7ce22ade758965cfbfc4c9390d24e41a667447fc7b29821464ad98bc5d65dc7f9c42bd4b23e174015592ff92c905660a2722f9fc7973d3cdad848ef88bf02b1b03dea16699b71dc46b35bc4d96069a0753335ae38685d244918e30c5fb0d45283a1281c1659ea591573999d9c2acd2ca9141d55230d41011b70748b518e1cd2fa58ad8dc05fcbdf0bffaf2c7fd6cb2ac67bb13b8f6d31fad64ac113664223599dca411270955c95aec06518894dabc352d2b70984727437040d944da7b42e0ef560ac532de3e4a4891e8509c275b51ed780f8660b0354e12c21b3e11bcc88198980b5f7ff31ad342182d5a933373164dced3cfb2a081720d7eee676cb7378a3e19326a7ee67fd6c00521f9de37c66bcea814b6feb6a061b8cdcf7b4bd8f45d48602c5", "c26d0b064e409df64819cd7c1a3b8076f19815b9823adac4e3ce0b4d3a29de18");
|
||||
TestSHA3_256("72c57c359e10684d0517e46653a02d18d29eff803eb009e4d5eb9e95add9ad1a4ac1f38a70296f3a369a16985ca3c957de2084cdc9bdd8994eb59b8815e0debad4ec1f001feac089820db8becdaf896aaf95721e8674e5d476b43bd2b873a7d135cd685f545b438210f9319e4dcd55986c85303c1ddf18dc746fe63a409df0a998ed376eb683e16c09e6e9018504152b3e7628ef350659fb716e058a5263a18823d2f2f6ee6a8091945a48ae1c5cb1694cf2c1fe76ef9177953afe8899cfa2b7fe0603bfa3180937dadfb66fbbdd119bbf8063338aa4a699075a3bfdbae8db7e5211d0917e9665a702fc9b0a0a901d08bea97654162d82a9f05622b060b634244779c33427eb7a29353a5f48b07cbefa72f3622ac5900bef77b71d6b314296f304c8426f451f32049b1f6af156a9dab702e8907d3cd72bb2c50493f4d593e731b285b70c803b74825b3524cda3205a8897106615260ac93c01c5ec14f5b11127783989d1824527e99e04f6a340e827b559f24db9292fcdd354838f9339a5fa1d7f6b2087f04835828b13463dd40927866f16ae33ed501ec0e6c4e63948768c5aeea3e4f6754985954bea7d61088c44430204ef491b74a64bde1358cecb2cad28ee6a3de5b752ff6a051104d88478653339457ac45ba44cbb65f54d1969d047cda746931d5e6a8b48e211416aefd5729f3d60b56b54e7f85aa2f42de3cb69419240c24e67139a11790a709edef2ac52cf35dd0a08af45926ebe9761f498ff83bfe263d6897ee97943a4b982fe3404ef0b4a45e06113c60340e0664f14799bf59cb4b3934b465fabefd87155905ee5309ba41e9e402973311831ea600b16437f71df39ee77130490c4d0227e5d1757fdc66af3ae6b9953053ed9aafca0160209858a7d4dd38fe10e0cb153672d08633ed6c54977aa0a6e67f9ff2f8c9d22dd7b21de08192960fd0e0da68d77c8d810db11dcaa61c725cd4092cbff76c8e1debd8d0361bb3f2e607911d45716f53067bdc0d89dd4889177765166a424e9fc0cb711201099dda213355e6639ac7eb86eca2ae0ab38b7f674f37ef8a6fcca1a6f52f55d9e1dcd631d2c3c82bba129172feb991d5af51afecd9d61a88b6832e4107480e392aed61a8644f551665ebff6b20953b635737a4f895e429fddcfe801f606fbda74b3bf6f5767d0fac14907fcfd0aa1d4c11b9e91b01d68052399b51a29f1ae6acd965109977c14a555cbcbd21ad8cb9f8853506d4bc21c01e62d61d7b21be1b923be54914e6b0a7ca84dd11f1159193e1184568a6134a6bbadf5b4df986edcf2019390ae841cfaa44435e28ce877d3dae4177992fa5d4e5c005876dbe3d1e63bec7dcc0942762b48b1ecc6c1a918409a8a72812a1e245c0c67be6e729c2b49bc6ee4d24a8f63e78e75db45655c26a9a78aff36fcd67117f26b8f654dca664b9f0e30681874cb749e1a692720078856286c2560b0292cc837933423147569350955c9571bf8941ba128fd339cb4268f46b94bc6ee203eb7026813706ea51c4f24c91866fc23a724bf2501327e6ae89c29f8db315dc28d2c7c719514036367e018f4835f63fdecd71f9bdced7132b6c4f8b13c69a517026fcd3622d67cb632320d5e7308f78f4b7cea11f6291b137851dc6cd6366f2785c71c3f237f81a7658b2a8d512b61e0ad5a4710b7b124151689fcb2116063fbff7e9115fed7b93de834970b838e49f8f8ba5f1f874c354078b5810a55ae289a56da563f1da6cd80a3757d6073fa55e016e45ac6cec1f69d871c92fd0ae9670c74249045e6b464787f9504128736309fed205f8df4d90e332908581298d9c75a3fa36ab0c3c9272e62de53ab290c803d67b696fd615c260a47bffad16746f18ba1a10a061bacbea9369693b3c042eec36bed289d7d12e52bca8aa1c2dff88ca7816498d25626d0f1e106ebb0b4a12138e00f3df5b1c2f49d98b1756e69b641b7c6353d99dbff050f4d76842c6cf1c2a4b062fc8e6336fa689b7c9d5c6b4ab8c15a5c20e514ff070a602d85ae52fa7810c22f8eeffd34a095b93342144f7a98d024216b3d68ed7bea047517bfcd83ec83febd1ba0e5858e2bdc1d8b1f7b0f89e90ccc432a3f930cb8209462e64556c5054c56ca2a85f16b32eb83a10459d13516faa4d23302b7607b9bd38dab2239ac9e9440c314433fdfb3ceadab4b4f87415ed6f240e017221f3b5f7ac196cdf54957bec42fe6893994b46de3d27dc7fb58ca88feb5b9e79cf20053d12530ac524337b22a3629bea52f40b06d3e2128f32060f9105847daed81d35f20e2002817434659baff64494c5b5c7f9216bfda38412a0f70511159dc73bb6bae1f8eaa0ef08d99bcb31f94f6be12c29c83df45926430b366c99fca3270c15fc4056398fdf3135b7779e3066a006961d1ac0ad1c83179ce39e87a96b722ec23aabc065badf3e188347a360772ca6a447abac7e6a44f0d4632d52926332e44a0a86bff5ce699fd063bdda3ffd4c41b53ded49fecec67f40599b934e16e3fd1bc063ad7026f8d71bfd4cbaf56599586774723194b692036f1b6bb242e2ffb9c600b5215b412764599476ce475c9e5b396fbcebd6be323dcf4d0048077400aac7500db41dc95fc7f7edbe7c9c2ec5ea89943fe13b42217eef530bbd023671509e12dfce4e1c1c82955d965e6a68aa66f6967dba48feda572db1f099d9a6dc4bc8edade852b5e824a06890dc48a6a6510ecaf8cf7620d757290e3166d431abecc624fa9ac2234d2eb783308ead45544910c633a94964b2ef5fbc409cb8835ac4147d384e12e0a5e13951f7de0ee13eafcb0ca0c04946d7804040c0a3cd088352424b097adb7aad1ca4495952f3e6c0158c02d2bcec33bfda69301434a84d9027ce02c0b9725dad118", "d894b86261436362e64241e61f6b3e6589daf64dc641f60570c4c0bf3b1f2ca3");
|
||||
}
|
||||
|
||||
static MuHash3072 FromInt(unsigned char i) {
|
||||
unsigned char tmp[32] = {i, 0};
|
||||
return MuHash3072(tmp);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(muhash_tests)
|
||||
{
|
||||
uint256 out;
|
||||
|
||||
for (int iter = 0; iter < 10; ++iter) {
|
||||
uint256 res;
|
||||
int table[4];
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
table[i] = g_insecure_rand_ctx.randbits(3);
|
||||
}
|
||||
for (int order = 0; order < 4; ++order) {
|
||||
MuHash3072 acc;
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
int t = table[i ^ order];
|
||||
if (t & 4) {
|
||||
acc /= FromInt(t & 3);
|
||||
} else {
|
||||
acc *= FromInt(t & 3);
|
||||
}
|
||||
}
|
||||
acc.Finalize(out);
|
||||
if (order == 0) {
|
||||
res = out;
|
||||
} else {
|
||||
BOOST_CHECK(res == out);
|
||||
}
|
||||
}
|
||||
|
||||
MuHash3072 x = FromInt(g_insecure_rand_ctx.randbits(4)); // x=X
|
||||
MuHash3072 y = FromInt(g_insecure_rand_ctx.randbits(4)); // x=X, y=Y
|
||||
MuHash3072 z; // x=X, y=Y, z=1
|
||||
z *= x; // x=X, y=Y, z=X
|
||||
z *= y; // x=X, y=Y, z=X*Y
|
||||
y *= x; // x=X, y=Y*X, z=X*Y
|
||||
z /= y; // x=X, y=Y*X, z=1
|
||||
z.Finalize(out);
|
||||
|
||||
uint256 out2;
|
||||
MuHash3072 a;
|
||||
a.Finalize(out2);
|
||||
|
||||
BOOST_CHECK_EQUAL(out, out2);
|
||||
}
|
||||
|
||||
MuHash3072 acc = FromInt(0);
|
||||
acc *= FromInt(1);
|
||||
acc /= FromInt(2);
|
||||
acc.Finalize(out);
|
||||
BOOST_CHECK_EQUAL(out, uint256S("10d312b100cbd32ada024a6646e40d3482fcff103668d2625f10002a607d5863"));
|
||||
|
||||
MuHash3072 acc2 = FromInt(0);
|
||||
unsigned char tmp[32] = {1, 0};
|
||||
acc2.Insert(tmp);
|
||||
unsigned char tmp2[32] = {2, 0};
|
||||
acc2.Remove(tmp2);
|
||||
acc2.Finalize(out);
|
||||
BOOST_CHECK_EQUAL(out, uint256S("10d312b100cbd32ada024a6646e40d3482fcff103668d2625f10002a607d5863"));
|
||||
|
||||
// Test MuHash3072 serialization
|
||||
MuHash3072 serchk = FromInt(1); serchk *= FromInt(2);
|
||||
std::string ser_exp = "1fa093295ea30a6a3acdc7b3f770fa538eff537528e990e2910e40bbcfd7f6696b1256901929094694b56316de342f593303dd12ac43e06dce1be1ff8301c845beb15468fff0ef002dbf80c29f26e6452bccc91b5cb9437ad410d2a67ea847887fa3c6a6553309946880fe20db2c73fe0641adbd4e86edfee0d9f8cd0ee1230898873dc13ed8ddcaf045c80faa082774279007a2253f8922ee3ef361d378a6af3ddaf180b190ac97e556888c36b3d1fb1c85aab9ccd46e3deaeb7b7cf5db067a7e9ff86b658cf3acd6662bbcce37232daa753c48b794356c020090c831a8304416e2aa7ad633c0ddb2f11be1be316a81be7f7e472071c042cb68faef549c221ebff209273638b741aba5a81675c45a5fa92fea4ca821d7a324cb1e1a2ccd3b76c4228ec8066dad2a5df6e1bd0de45c7dd5de8070bdb46db6c554cf9aefc9b7b2bbf9f75b1864d9f95005314593905c0109b71f703d49944ae94477b51dac10a816bb6d1c700bafabc8bd86fac8df24be519a2f2836b16392e18036cb13e48c5c010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
|
||||
CDataStream ss_chk(SER_DISK, PROTOCOL_VERSION);
|
||||
ss_chk << serchk;
|
||||
BOOST_CHECK_EQUAL(ser_exp, HexStr(ss_chk.str()));
|
||||
|
||||
// Test MuHash3072 deserialization
|
||||
MuHash3072 deserchk;
|
||||
ss_chk >> deserchk;
|
||||
uint256 out3;
|
||||
serchk.Finalize(out);
|
||||
deserchk.Finalize(out3);
|
||||
BOOST_CHECK_EQUAL(HexStr(out), HexStr(out3));
|
||||
|
||||
// Test MuHash3072 overflow, meaning the internal data is larger than the modulus.
|
||||
CDataStream ss_max(ParseHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), SER_DISK, PROTOCOL_VERSION);
|
||||
MuHash3072 overflowchk;
|
||||
ss_max >> overflowchk;
|
||||
|
||||
uint256 out4;
|
||||
overflowchk.Finalize(out4);
|
||||
BOOST_CHECK_EQUAL(HexStr(out4), "3a31e6903aff0de9f62f9a9f7f8b861de76ce2cda09822b90014319ae5dc2271");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
372
src/test/cuckoocache_tests.cpp
Normal file
372
src/test/cuckoocache_tests.cpp
Normal file
|
|
@ -0,0 +1,372 @@
|
|||
// Copyright (c) 2009-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#include <cuckoocache.h>
|
||||
#include <random.h>
|
||||
#include <script/sigcache.h>
|
||||
#include <test/util/setup_common.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <deque>
|
||||
#include <mutex>
|
||||
#include <shared_mutex>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
/** Test Suite for CuckooCache
|
||||
*
|
||||
* 1. All tests should have a deterministic result (using insecure rand
|
||||
* with deterministic seeds)
|
||||
* 2. Some test methods are templated to allow for easier testing
|
||||
* against new versions / comparing
|
||||
* 3. Results should be treated as a regression test, i.e., did the behavior
|
||||
* change significantly from what was expected. This can be OK, depending on
|
||||
* the nature of the change, but requires updating the tests to reflect the new
|
||||
* expected behavior. For example improving the hit rate may cause some tests
|
||||
* using BOOST_CHECK_CLOSE to fail.
|
||||
*
|
||||
*/
|
||||
BOOST_AUTO_TEST_SUITE(cuckoocache_tests);
|
||||
|
||||
/* Test that no values not inserted into the cache are read out of it.
|
||||
*
|
||||
* There are no repeats in the first 200000 insecure_GetRandHash calls
|
||||
*/
|
||||
BOOST_AUTO_TEST_CASE(test_cuckoocache_no_fakes)
|
||||
{
|
||||
SeedInsecureRand(SeedRand::ZEROS);
|
||||
CuckooCache::cache<uint256, SignatureCacheHasher> cc{};
|
||||
size_t megabytes = 4;
|
||||
cc.setup_bytes(megabytes << 20);
|
||||
for (int x = 0; x < 100000; ++x) {
|
||||
cc.insert(InsecureRand256());
|
||||
}
|
||||
for (int x = 0; x < 100000; ++x) {
|
||||
BOOST_CHECK(!cc.contains(InsecureRand256(), false));
|
||||
}
|
||||
};
|
||||
|
||||
/** This helper returns the hit rate when megabytes*load worth of entries are
|
||||
* inserted into a megabytes sized cache
|
||||
*/
|
||||
template <typename Cache>
|
||||
static double test_cache(size_t megabytes, double load)
|
||||
{
|
||||
SeedInsecureRand(SeedRand::ZEROS);
|
||||
std::vector<uint256> hashes;
|
||||
Cache set{};
|
||||
size_t bytes = megabytes * (1 << 20);
|
||||
set.setup_bytes(bytes);
|
||||
uint32_t n_insert = static_cast<uint32_t>(load * (bytes / sizeof(uint256)));
|
||||
hashes.resize(n_insert);
|
||||
for (uint32_t i = 0; i < n_insert; ++i) {
|
||||
uint32_t* ptr = (uint32_t*)hashes[i].begin();
|
||||
for (uint8_t j = 0; j < 8; ++j)
|
||||
*(ptr++) = InsecureRand32();
|
||||
}
|
||||
/** We make a copy of the hashes because future optimizations of the
|
||||
* cuckoocache may overwrite the inserted element, so the test is
|
||||
* "future proofed".
|
||||
*/
|
||||
std::vector<uint256> hashes_insert_copy = hashes;
|
||||
/** Do the insert */
|
||||
for (const uint256& h : hashes_insert_copy)
|
||||
set.insert(h);
|
||||
/** Count the hits */
|
||||
uint32_t count = 0;
|
||||
for (const uint256& h : hashes)
|
||||
count += set.contains(h, false);
|
||||
double hit_rate = ((double)count) / ((double)n_insert);
|
||||
return hit_rate;
|
||||
}
|
||||
|
||||
/** The normalized hit rate for a given load.
|
||||
*
|
||||
* The semantics are a little confusing, so please see the below
|
||||
* explanation.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* 1. at load 0.5, we expect a perfect hit rate, so we multiply by
|
||||
* 1.0
|
||||
* 2. at load 2.0, we expect to see half the entries, so a perfect hit rate
|
||||
* would be 0.5. Therefore, if we see a hit rate of 0.4, 0.4*2.0 = 0.8 is the
|
||||
* normalized hit rate.
|
||||
*
|
||||
* This is basically the right semantics, but has a bit of a glitch depending on
|
||||
* how you measure around load 1.0 as after load 1.0 your normalized hit rate
|
||||
* becomes effectively perfect, ignoring freshness.
|
||||
*/
|
||||
static double normalize_hit_rate(double hits, double load)
|
||||
{
|
||||
return hits * std::max(load, 1.0);
|
||||
}
|
||||
|
||||
/** Check the hit rate on loads ranging from 0.1 to 1.6 */
|
||||
BOOST_AUTO_TEST_CASE(cuckoocache_hit_rate_ok)
|
||||
{
|
||||
/** Arbitrarily selected Hit Rate threshold that happens to work for this test
|
||||
* as a lower bound on performance.
|
||||
*/
|
||||
double HitRateThresh = 0.98;
|
||||
size_t megabytes = 4;
|
||||
for (double load = 0.1; load < 2; load *= 2) {
|
||||
double hits = test_cache<CuckooCache::cache<uint256, SignatureCacheHasher>>(megabytes, load);
|
||||
BOOST_CHECK(normalize_hit_rate(hits, load) > HitRateThresh);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** This helper checks that erased elements are preferentially inserted onto and
|
||||
* that the hit rate of "fresher" keys is reasonable*/
|
||||
template <typename Cache>
|
||||
static void test_cache_erase(size_t megabytes)
|
||||
{
|
||||
double load = 1;
|
||||
SeedInsecureRand(SeedRand::ZEROS);
|
||||
std::vector<uint256> hashes;
|
||||
Cache set{};
|
||||
size_t bytes = megabytes * (1 << 20);
|
||||
set.setup_bytes(bytes);
|
||||
uint32_t n_insert = static_cast<uint32_t>(load * (bytes / sizeof(uint256)));
|
||||
hashes.resize(n_insert);
|
||||
for (uint32_t i = 0; i < n_insert; ++i) {
|
||||
uint32_t* ptr = (uint32_t*)hashes[i].begin();
|
||||
for (uint8_t j = 0; j < 8; ++j)
|
||||
*(ptr++) = InsecureRand32();
|
||||
}
|
||||
/** We make a copy of the hashes because future optimizations of the
|
||||
* cuckoocache may overwrite the inserted element, so the test is
|
||||
* "future proofed".
|
||||
*/
|
||||
std::vector<uint256> hashes_insert_copy = hashes;
|
||||
|
||||
/** Insert the first half */
|
||||
for (uint32_t i = 0; i < (n_insert / 2); ++i)
|
||||
set.insert(hashes_insert_copy[i]);
|
||||
/** Erase the first quarter */
|
||||
for (uint32_t i = 0; i < (n_insert / 4); ++i)
|
||||
BOOST_CHECK(set.contains(hashes[i], true));
|
||||
/** Insert the second half */
|
||||
for (uint32_t i = (n_insert / 2); i < n_insert; ++i)
|
||||
set.insert(hashes_insert_copy[i]);
|
||||
|
||||
/** elements that we marked as erased but are still there */
|
||||
size_t count_erased_but_contained = 0;
|
||||
/** elements that we did not erase but are older */
|
||||
size_t count_stale = 0;
|
||||
/** elements that were most recently inserted */
|
||||
size_t count_fresh = 0;
|
||||
|
||||
for (uint32_t i = 0; i < (n_insert / 4); ++i)
|
||||
count_erased_but_contained += set.contains(hashes[i], false);
|
||||
for (uint32_t i = (n_insert / 4); i < (n_insert / 2); ++i)
|
||||
count_stale += set.contains(hashes[i], false);
|
||||
for (uint32_t i = (n_insert / 2); i < n_insert; ++i)
|
||||
count_fresh += set.contains(hashes[i], false);
|
||||
|
||||
double hit_rate_erased_but_contained = double(count_erased_but_contained) / (double(n_insert) / 4.0);
|
||||
double hit_rate_stale = double(count_stale) / (double(n_insert) / 4.0);
|
||||
double hit_rate_fresh = double(count_fresh) / (double(n_insert) / 2.0);
|
||||
|
||||
// Check that our hit_rate_fresh is perfect
|
||||
BOOST_CHECK_EQUAL(hit_rate_fresh, 1.0);
|
||||
// Check that we have a more than 2x better hit rate on stale elements than
|
||||
// erased elements.
|
||||
BOOST_CHECK(hit_rate_stale > 2 * hit_rate_erased_but_contained);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(cuckoocache_erase_ok)
|
||||
{
|
||||
size_t megabytes = 4;
|
||||
test_cache_erase<CuckooCache::cache<uint256, SignatureCacheHasher>>(megabytes);
|
||||
}
|
||||
|
||||
template <typename Cache>
|
||||
static void test_cache_erase_parallel(size_t megabytes)
|
||||
{
|
||||
double load = 1;
|
||||
SeedInsecureRand(SeedRand::ZEROS);
|
||||
std::vector<uint256> hashes;
|
||||
Cache set{};
|
||||
size_t bytes = megabytes * (1 << 20);
|
||||
set.setup_bytes(bytes);
|
||||
uint32_t n_insert = static_cast<uint32_t>(load * (bytes / sizeof(uint256)));
|
||||
hashes.resize(n_insert);
|
||||
for (uint32_t i = 0; i < n_insert; ++i) {
|
||||
uint32_t* ptr = (uint32_t*)hashes[i].begin();
|
||||
for (uint8_t j = 0; j < 8; ++j)
|
||||
*(ptr++) = InsecureRand32();
|
||||
}
|
||||
/** We make a copy of the hashes because future optimizations of the
|
||||
* cuckoocache may overwrite the inserted element, so the test is
|
||||
* "future proofed".
|
||||
*/
|
||||
std::vector<uint256> hashes_insert_copy = hashes;
|
||||
std::shared_mutex mtx;
|
||||
|
||||
{
|
||||
/** Grab lock to make sure we release inserts */
|
||||
std::unique_lock<std::shared_mutex> l(mtx);
|
||||
/** Insert the first half */
|
||||
for (uint32_t i = 0; i < (n_insert / 2); ++i)
|
||||
set.insert(hashes_insert_copy[i]);
|
||||
}
|
||||
|
||||
/** Spin up 3 threads to run contains with erase.
|
||||
*/
|
||||
std::vector<std::thread> threads;
|
||||
/** Erase the first quarter */
|
||||
for (uint32_t x = 0; x < 3; ++x)
|
||||
/** Each thread is emplaced with x copy-by-value
|
||||
*/
|
||||
threads.emplace_back([&, x] {
|
||||
std::shared_lock<std::shared_mutex> l(mtx);
|
||||
size_t ntodo = (n_insert/4)/3;
|
||||
size_t start = ntodo*x;
|
||||
size_t end = ntodo*(x+1);
|
||||
for (uint32_t i = start; i < end; ++i) {
|
||||
bool contains = set.contains(hashes[i], true);
|
||||
assert(contains);
|
||||
}
|
||||
});
|
||||
|
||||
/** Wait for all threads to finish
|
||||
*/
|
||||
for (std::thread& t : threads)
|
||||
t.join();
|
||||
/** Grab lock to make sure we observe erases */
|
||||
std::unique_lock<std::shared_mutex> l(mtx);
|
||||
/** Insert the second half */
|
||||
for (uint32_t i = (n_insert / 2); i < n_insert; ++i)
|
||||
set.insert(hashes_insert_copy[i]);
|
||||
|
||||
/** elements that we marked erased but that are still there */
|
||||
size_t count_erased_but_contained = 0;
|
||||
/** elements that we did not erase but are older */
|
||||
size_t count_stale = 0;
|
||||
/** elements that were most recently inserted */
|
||||
size_t count_fresh = 0;
|
||||
|
||||
for (uint32_t i = 0; i < (n_insert / 4); ++i)
|
||||
count_erased_but_contained += set.contains(hashes[i], false);
|
||||
for (uint32_t i = (n_insert / 4); i < (n_insert / 2); ++i)
|
||||
count_stale += set.contains(hashes[i], false);
|
||||
for (uint32_t i = (n_insert / 2); i < n_insert; ++i)
|
||||
count_fresh += set.contains(hashes[i], false);
|
||||
|
||||
double hit_rate_erased_but_contained = double(count_erased_but_contained) / (double(n_insert) / 4.0);
|
||||
double hit_rate_stale = double(count_stale) / (double(n_insert) / 4.0);
|
||||
double hit_rate_fresh = double(count_fresh) / (double(n_insert) / 2.0);
|
||||
|
||||
// Check that our hit_rate_fresh is perfect
|
||||
BOOST_CHECK_EQUAL(hit_rate_fresh, 1.0);
|
||||
// Check that we have a more than 2x better hit rate on stale elements than
|
||||
// erased elements.
|
||||
BOOST_CHECK(hit_rate_stale > 2 * hit_rate_erased_but_contained);
|
||||
}
|
||||
BOOST_AUTO_TEST_CASE(cuckoocache_erase_parallel_ok)
|
||||
{
|
||||
size_t megabytes = 4;
|
||||
test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher>>(megabytes);
|
||||
}
|
||||
|
||||
|
||||
template <typename Cache>
|
||||
static void test_cache_generations()
|
||||
{
|
||||
// This test checks that for a simulation of network activity, the fresh hit
|
||||
// rate is never below 99%, and the number of times that it is worse than
|
||||
// 99.9% are less than 1% of the time.
|
||||
double min_hit_rate = 0.99;
|
||||
double tight_hit_rate = 0.999;
|
||||
double max_rate_less_than_tight_hit_rate = 0.01;
|
||||
// A cache that meets this specification is therefore shown to have a hit
|
||||
// rate of at least tight_hit_rate * (1 - max_rate_less_than_tight_hit_rate) +
|
||||
// min_hit_rate*max_rate_less_than_tight_hit_rate = 0.999*99%+0.99*1% == 99.89%
|
||||
// hit rate with low variance.
|
||||
|
||||
// We use deterministic values, but this test has also passed on many
|
||||
// iterations with non-deterministic values, so it isn't "overfit" to the
|
||||
// specific entropy in FastRandomContext(true) and implementation of the
|
||||
// cache.
|
||||
SeedInsecureRand(SeedRand::ZEROS);
|
||||
|
||||
// block_activity models a chunk of network activity. n_insert elements are
|
||||
// added to the cache. The first and last n/4 are stored for removal later
|
||||
// and the middle n/2 are not stored. This models a network which uses half
|
||||
// the signatures of recently (since the last block) added transactions
|
||||
// immediately and never uses the other half.
|
||||
struct block_activity {
|
||||
std::vector<uint256> reads;
|
||||
block_activity(uint32_t n_insert, Cache& c) : reads()
|
||||
{
|
||||
std::vector<uint256> inserts;
|
||||
inserts.resize(n_insert);
|
||||
reads.reserve(n_insert / 2);
|
||||
for (uint32_t i = 0; i < n_insert; ++i) {
|
||||
uint32_t* ptr = (uint32_t*)inserts[i].begin();
|
||||
for (uint8_t j = 0; j < 8; ++j)
|
||||
*(ptr++) = InsecureRand32();
|
||||
}
|
||||
for (uint32_t i = 0; i < n_insert / 4; ++i)
|
||||
reads.push_back(inserts[i]);
|
||||
for (uint32_t i = n_insert - (n_insert / 4); i < n_insert; ++i)
|
||||
reads.push_back(inserts[i]);
|
||||
for (const auto& h : inserts)
|
||||
c.insert(h);
|
||||
}
|
||||
};
|
||||
|
||||
const uint32_t BLOCK_SIZE = 1000;
|
||||
// We expect window size 60 to perform reasonably given that each epoch
|
||||
// stores 45% of the cache size (~472k).
|
||||
const uint32_t WINDOW_SIZE = 60;
|
||||
const uint32_t POP_AMOUNT = (BLOCK_SIZE / WINDOW_SIZE) / 2;
|
||||
const double load = 10;
|
||||
const size_t megabytes = 4;
|
||||
const size_t bytes = megabytes * (1 << 20);
|
||||
const uint32_t n_insert = static_cast<uint32_t>(load * (bytes / sizeof(uint256)));
|
||||
|
||||
std::vector<block_activity> hashes;
|
||||
Cache set{};
|
||||
set.setup_bytes(bytes);
|
||||
hashes.reserve(n_insert / BLOCK_SIZE);
|
||||
std::deque<block_activity> last_few;
|
||||
uint32_t out_of_tight_tolerance = 0;
|
||||
uint32_t total = n_insert / BLOCK_SIZE;
|
||||
// we use the deque last_few to model a sliding window of blocks. at each
|
||||
// step, each of the last WINDOW_SIZE block_activities checks the cache for
|
||||
// POP_AMOUNT of the hashes that they inserted, and marks these erased.
|
||||
for (uint32_t i = 0; i < total; ++i) {
|
||||
if (last_few.size() == WINDOW_SIZE)
|
||||
last_few.pop_front();
|
||||
last_few.emplace_back(BLOCK_SIZE, set);
|
||||
uint32_t count = 0;
|
||||
for (auto& act : last_few)
|
||||
for (uint32_t k = 0; k < POP_AMOUNT; ++k) {
|
||||
count += set.contains(act.reads.back(), true);
|
||||
act.reads.pop_back();
|
||||
}
|
||||
// We use last_few.size() rather than WINDOW_SIZE for the correct
|
||||
// behavior on the first WINDOW_SIZE iterations where the deque is not
|
||||
// full yet.
|
||||
double hit = (double(count)) / (last_few.size() * POP_AMOUNT);
|
||||
// Loose Check that hit rate is above min_hit_rate
|
||||
BOOST_CHECK(hit > min_hit_rate);
|
||||
// Tighter check, count number of times we are less than tight_hit_rate
|
||||
// (and implicitly, greater than min_hit_rate)
|
||||
out_of_tight_tolerance += hit < tight_hit_rate;
|
||||
}
|
||||
// Check that being out of tolerance happens less than
|
||||
// max_rate_less_than_tight_hit_rate of the time
|
||||
BOOST_CHECK(double(out_of_tight_tolerance) / double(total) < max_rate_less_than_tight_hit_rate);
|
||||
}
|
||||
BOOST_AUTO_TEST_CASE(cuckoocache_generations)
|
||||
{
|
||||
test_cache_generations<CuckooCache::cache<uint256, SignatureCacheHasher>>();
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END();
|
||||
12
src/test/data/README.md
Normal file
12
src/test/data/README.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
Description
|
||||
------------
|
||||
|
||||
This directory contains data-driven tests for various aspects of DigiByte.
|
||||
|
||||
License
|
||||
--------
|
||||
|
||||
The data files in this directory are distributed under the MIT software
|
||||
license, see the accompanying file COPYING or
|
||||
http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
BIN
src/test/data/asmap.raw
Normal file
BIN
src/test/data/asmap.raw
Normal file
Binary file not shown.
16
src/test/data/base58_encode_decode.json
Normal file
16
src/test/data/base58_encode_decode.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
[
|
||||
["", ""],
|
||||
["61", "2g"],
|
||||
["626262", "a3gV"],
|
||||
["636363", "aPEr"],
|
||||
["73696d706c792061206c6f6e6720737472696e67", "2cFupjhnEsSn59qHXstmK2ffpLv2"],
|
||||
["00eb15231dfceb60925886b67d065299925915aeb172c06647", "1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L"],
|
||||
["516b6fcd0f", "ABnLTmg"],
|
||||
["bf4f89001e670274dd", "3SEo3LWLoPntC"],
|
||||
["572e4794", "3EFU7m"],
|
||||
["ecac89cad93923c02321", "EJDM8drfXA6uyA"],
|
||||
["10c8511e", "Rt5zm"],
|
||||
["00000000000000000000", "1111111111"],
|
||||
["000111d38e5fc9071ffcd20b4a763cc9ae4f252bb4e48fd66a835e252ada93ff480d6dd43dc62a641155a5", "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],
|
||||
["000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", "1cWB5HCBdLjAuqGGReWE3R3CguuwSjw6RHn39s2yuDRTS5NsBgNiFpWgAnEx6VQi8csexkgYw3mdYrMHr8x9i7aEwP8kZ7vccXWqKDvGv3u1GxFKPuAkn8JCPPGDMf3vMMnbzm6Nh9zh1gcNsMvH3ZNLmP5fSG6DGbbi2tuwMWPthr4boWwCxf7ewSgNQeacyozhKDDQQ1qL5fQFUW52QKUZDZ5fw3KXNQJMcNTcaB723LchjeKun7MuGW5qyCBZYzA1KjofN1gYBV3NqyhQJ3Ns746GNuf9N2pQPmHz4xpnSrrfCvy6TVVz5d4PdrjeshsWQwpZsZGzvbdAdN8MKV5QsBDY"]
|
||||
]
|
||||
13
src/test/data/blockfilters.json
Normal file
13
src/test/data/blockfilters.json
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[
|
||||
["Block Height,Block Hash,Block,[Prev Output Scripts for Block],Previous Basic Header,Basic Filter,Basic Header,Notes"],
|
||||
[0,"000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943","0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4adae5494dffff001d1aa4ae180101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",[],"0000000000000000000000000000000000000000000000000000000000000000","019dfca8","21584579b7eb08997773e5aeff3a7f932700042d0ed2a6129012b7d7ae81b750","Genesis block"],
|
||||
[2,"000000006c02c8ea6e4ff69651f7fcde348fb9d557a06e6957b65552002a7820","0100000006128e87be8b1b4dea47a7247d5528d2702c96826c7a648497e773b800000000e241352e3bec0a95a6217e10c3abb54adfa05abb12c126695595580fb92e222032e7494dffff001d00d235340101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0e0432e7494d010e062f503253482fffffffff0100f2052a010000002321038a7f6ef1c8ca0c588aa53fa860128077c9e6c11e6830f4d7ee4e763a56b7718fac00000000",[],"d7bdac13a59d745b1add0d2ce852f1a0442e8945fc1bf3848d3cbffd88c24fe1","0174a170","186afd11ef2b5e7e3504f2e8cbf8df28a1fd251fe53d60dff8b1467d1b386cf0",""],
|
||||
[3,"000000008b896e272758da5297bcd98fdc6d97c9b765ecec401e286dc1fdbe10","0100000020782a005255b657696ea057d5b98f34defcf75196f64f6eeac8026c0000000041ba5afc532aae03151b8aa87b65e1594f97504a768e010c98c0add79216247186e7494dffff001d058dc2b60101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0e0486e7494d0151062f503253482fffffffff0100f2052a01000000232103f6d9ff4c12959445ca5549c811683bf9c88e637b222dd2e0311154c4c85cf423ac00000000",[],"186afd11ef2b5e7e3504f2e8cbf8df28a1fd251fe53d60dff8b1467d1b386cf0","016cf7a0","8d63aadf5ab7257cb6d2316a57b16f517bff1c6388f124ec4c04af1212729d2a",""],
|
||||
[15007,"0000000038c44c703bae0f98cdd6bf30922326340a5996cc692aaae8bacf47ad","0100000002394092aa378fe35d7e9ac79c869b975c4de4374cd75eb5484b0e1e00000000eb9b8670abd44ad6c55cee18e3020fb0c6519e7004b01a16e9164867531b67afc33bc94fffff001d123f10050101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0e04c33bc94f0115062f503253482fffffffff0100f2052a01000000232103f268e9ae07e0f8cb2f6e901d87c510d650b97230c0365b021df8f467363cafb1ac00000000",[],"18b5c2b0146d2d09d24fb00ff5b52bd0742f36c9e65527abdb9de30c027a4748","013c3710","07384b01311867949e0c046607c66b7a766d338474bb67f66c8ae9dbd454b20e","Tx has non-standard OP_RETURN output followed by opcodes"],
|
||||
[49291,"0000000018b07dca1b28b4b5a119f6d6e71698ce1ed96f143f54179ce177a19c","02000000abfaf47274223ca2fea22797e44498240e482cb4c2f2baea088962f800000000604b5b52c32305b15d7542071d8b04e750a547500005d4010727694b6e72a776e55d0d51ffff001d211806480201000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0d038bc0000102062f503253482fffffffff01a078072a01000000232102971dd6034ed0cf52450b608d196c07d6345184fcb14deb277a6b82d526a6163dac0000000001000000081cefd96060ecb1c4fbe675ad8a4f8bdc61d634c52b3a1c4116dee23749fe80ff000000009300493046022100866859c21f306538152e83f115bcfbf59ab4bb34887a88c03483a5dff9895f96022100a6dfd83caa609bf0516debc2bf65c3df91813a4842650a1858b3f61cfa8af249014730440220296d4b818bb037d0f83f9f7111665f49532dfdcbec1e6b784526e9ac4046eaa602204acf3a5cb2695e8404d80bf49ab04828bcbe6fc31d25a2844ced7a8d24afbdff01ffffffff1cefd96060ecb1c4fbe675ad8a4f8bdc61d634c52b3a1c4116dee23749fe80ff020000009400483045022100e87899175991aa008176cb553c6f2badbb5b741f328c9845fcab89f8b18cae2302200acce689896dc82933015e7230e5230d5cff8a1ffe82d334d60162ac2c5b0c9601493046022100994ad29d1e7b03e41731a4316e5f4992f0d9b6e2efc40a1ccd2c949b461175c502210099b69fdc2db00fbba214f16e286f6a49e2d8a0d5ffc6409d87796add475478d601ffffffff1e4a6d2d280ea06680d6cf8788ac90344a9c67cca9b06005bbd6d3f6945c8272010000009500493046022100a27400ba52fd842ce07398a1de102f710a10c5599545e6c95798934352c2e4df022100f6383b0b14c9f64b6718139f55b6b9494374755b86bae7d63f5d3e583b57255a01493046022100fdf543292f34e1eeb1703b264965339ec4a450ec47585009c606b3edbc5b617b022100a5fbb1c8de8aaaa582988cdb23622838e38de90bebcaab3928d949aa502a65d401ffffffff1e4a6d2d280ea06680d6cf8788ac90344a9c67cca9b06005bbd6d3f6945c8272020000009400493046022100ac626ac3051f875145b4fe4cfe089ea895aac73f65ab837b1ac30f5d875874fa022100bc03e79fa4b7eb707fb735b95ff6613ca33adeaf3a0607cdcead4cfd3b51729801483045022100b720b04a5c5e2f61b7df0fcf334ab6fea167b7aaede5695d3f7c6973496adbf1022043328c4cc1cdc3e5db7bb895ccc37133e960b2fd3ece98350f774596badb387201ffffffff23a8733e349c97d6cd90f520fdd084ba15ce0a395aad03cd51370602bb9e5db3010000004a00483045022100e8556b72c5e9c0da7371913a45861a61c5df434dfd962de7b23848e1a28c86ca02205d41ceda00136267281be0974be132ac4cda1459fe2090ce455619d8b91045e901ffffffff6856d609b881e875a5ee141c235e2a82f6b039f2b9babe82333677a5570285a6000000006a473044022040a1c631554b8b210fbdf2a73f191b2851afb51d5171fb53502a3a040a38d2c0022040d11cf6e7b41fe1b66c3d08f6ada1aee07a047cb77f242b8ecc63812c832c9a012102bcfad931b502761e452962a5976c79158a0f6d307ad31b739611dac6a297c256ffffffff6856d609b881e875a5ee141c235e2a82f6b039f2b9babe82333677a5570285a601000000930048304502205b109df098f7e932fbf71a45869c3f80323974a826ee2770789eae178a21bfc8022100c0e75615e53ee4b6e32b9bb5faa36ac539e9c05fa2ae6b6de5d09c08455c8b9601483045022009fb7d27375c47bea23b24818634df6a54ecf72d52e0c1268fb2a2c84f1885de022100e0ed4f15d62e7f537da0d0f1863498f9c7c0c0a4e00e4679588c8d1a9eb20bb801ffffffffa563c3722b7b39481836d5edfc1461f97335d5d1e9a23ade13680d0e2c1c371f030000006c493046022100ecc38ae2b1565643dc3c0dad5e961a5f0ea09cab28d024f92fa05c922924157e022100ebc166edf6fbe4004c72bfe8cf40130263f98ddff728c8e67b113dbd621906a601210211a4ed241174708c07206601b44a4c1c29e5ad8b1f731c50ca7e1d4b2a06dc1fffffffff02d0223a00000000001976a91445db0b779c0b9fa207f12a8218c94fc77aff504588ac80f0fa02000000000000000000",["5221033423007d8f263819a2e42becaaf5b06f34cb09919e06304349d950668209eaed21021d69e2b68c3960903b702af7829fadcd80bd89b158150c85c4a75b2c8cb9c39452ae","52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821021d69e2b68c3960903b702af7829fadcd80bd89b158150c85c4a75b2c8cb9c39452ae","522102a7ae1e0971fc1689bd66d2a7296da3a1662fd21a53c9e38979e0f090a375c12d21022adb62335f41eb4e27056ac37d462cda5ad783fa8e0e526ed79c752475db285d52ae","52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821022adb62335f41eb4e27056ac37d462cda5ad783fa8e0e526ed79c752475db285d52ae","512103b9d1d0e2b4355ec3cdef7c11a5c0beff9e8b8d8372ab4b4e0aaf30e80173001951ae","76a9149144761ebaccd5b4bbdc2a35453585b5637b2f8588ac","522103f1848b40621c5d48471d9784c8174ca060555891ace6d2b03c58eece946b1a9121020ee5d32b54d429c152fdc7b1db84f2074b0564d35400d89d11870f9273ec140c52ae","76a914f4fa1cc7de742d135ea82c17adf0bb9cf5f4fb8388ac"],"ed47705334f4643892ca46396eb3f4196a5e30880589e4009ef38eae895d4a13","0afbc2920af1b027f31f87b592276eb4c32094bb4d3697021b4c6380","b6d98692cec5145f67585f3434ec3c2b3030182e1cb3ec58b855c5c164dfaaa3","Tx pays to empty output script"],
|
||||
[180480,"00000000fd3ceb2404ff07a785c7fdcc76619edc8ed61bd25134eaa22084366a","020000006058aa080a655aa991a444bd7d1f2defd9a3bbe68aabb69030cf3b4e00000000d2e826bfd7ef0beaa891a7eedbc92cd6a544a6cb61c7bdaa436762eb2123ef9790f5f552ffff001d0002c90f0501000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0e0300c102024608062f503253482fffffffff01c0c6072a01000000232102e769e60137a4df6b0df8ebd387cca44c4c57ae74cc0114a8e8317c8f3bfd85e9ac00000000010000000381a0802911a01ffb025c4dea0bc77963e8c1bb46313b71164c53f72f37fe5248010000000151ffffffffc904b267833d215e2128bd9575242232ac2bc311550c7fc1f0ef6f264b40d14c010000000151ffffffffdf0915666649dba81886519c531649b7b02180b4af67d6885e871299e9d5f775000000000151ffffffff0180817dcb00000000232103bb52138972c48a132fc1f637858c5189607dd0f7fe40c4f20f6ad65f2d389ba4ac0000000001000000018da38b434fba82d66052af74fc5e4e94301b114d9bc03f819dc876398404c8b4010000006c493046022100fe738b7580dc5fb5168e51fc61b5aed211125eb71068031009a22d9bbad752c5022100be5086baa384d40bcab0fa586e4f728397388d86e18b66cc417dc4f7fa4f9878012103f233299455134caa2687bdf15cb0becdfb03bd0ff2ff38e65ec6b7834295c34fffffffff022ebc1400000000001976a9147779b7fba1c1e06b717069b80ca170e8b04458a488ac9879c40f000000001976a9142a0307cd925dbb66b534c4db33003dd18c57015788ac0000000001000000026139a62e3422a602de36c873a225c1d3ca5aeee598539ceecb9f0dc8d1ad0f83010000006b483045022100ad9f32b4a0a2ddc19b5a74eba78123e57616f1b3cfd72ce68c03ea35a3dda1f002200dbd22aa6da17213df5e70dfc3b2611d40f70c98ed9626aa5e2cde9d97461f0a012103ddb295d2f1e8319187738fb4b230fdd9aa29d0e01647f69f6d770b9ab24eea90ffffffff983c82c87cf020040d671956525014d5c2b28c6d948c85e1a522362c0059eeae010000006b4830450221009ca544274c786d30a5d5d25e17759201ea16d3aedddf0b9e9721246f7ef6b32e02202cfa5564b6e87dfd9fd98957820e4d4e6238baeb0f65fe305d91506bb13f5f4f012103c99113deac0d5d044e3ac0346abc02501542af8c8d3759f1382c72ff84e704f7ffffffff02c0c62d00000000001976a914ae19d27efe12f5a886dc79af37ad6805db6f922d88ac70ce2000000000001976a9143b8d051d37a07ea1042067e93efe63dbf73920b988ac000000000100000002be566e8cd9933f0c75c4a82c027f7d0c544d5c101d0607ef6ae5d07b98e7f1dc000000006b483045022036a8cdfd5ea7ebc06c2bfb6e4f942bbf9a1caeded41680d11a3a9f5d8284abad022100cacb92a5be3f39e8bc14db1710910ef7b395fa1e18f45d41c28d914fcdde33be012102bf59abf110b5131fae0a3ce1ec379329b4c896a6ae5d443edb68529cc2bc7816ffffffff96cf67645b76ceb23fe922874847456a15feee1655082ff32d25a6bf2c0dfc90000000006a47304402203471ca2001784a5ac0abab583581f2613523da47ec5f53df833c117b5abd81500220618a2847723d57324f2984678db556dbca1a72230fc7e39df04c2239942ba942012102925c9794fd7bb9f8b29e207d5fc491b1150135a21f505041858889fa4edf436fffffffff026c840f00000000001976a914797fb8777d7991d8284d88bfd421ce520f0f843188ac00ca9a3b000000001976a9146d10f3f592699265d10b106eda37c3ce793f7a8588ac00000000",["","","","76a9142903b138c24be9e070b3e73ec495d77a204615e788ac","76a91433a1941fd9a37b9821d376f5a51bd4b52fa50e2888ac","76a914e4374e8155d0865742ca12b8d4d14d41b57d682f88ac","76a914001fa7459a6cfc64bdc178ba7e7a21603bb2568f88ac","76a914f6039952bc2b307aeec5371bfb96b66078ec17f688ac"],"d34ef98386f413769502808d4bac5f20f8dfd5bffc9eedafaa71de0eb1f01489","0db414c859a07e8205876354a210a75042d0463404913d61a8e068e58a3ae2aa080026","c582d51c0ca365e3fcf36c51cb646d7f83a67e867cb4743fd2128e3e022b700c","Tx spends from empty output script"],
|
||||
[926485,"000000000000015d6077a411a8f5cc95caf775ccf11c54e27df75ce58d187313","0000002060bbab0edbf3ef8a49608ee326f8fd75c473b7e3982095e2d100000000000000c30134f8c9b6d2470488d7a67a888f6fa12f8692e0c3411fbfb92f0f68f67eedae03ca57ef13021acc22dc4105010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff2f0315230e0004ae03ca57043e3d1e1d0c8796bf579aef0c0000000000122f4e696e6a61506f6f6c2f5345475749542fffffffff038427a112000000001976a914876fbb82ec05caa6af7a3b5e5a983aae6c6cc6d688ac0000000000000000266a24aa21a9ed5c748e121c0fe146d973a4ac26fa4a68b0549d46ee22d25f50a5e46fe1b377ee00000000000000002952534b424c4f434b3acd16772ad61a3c5f00287480b720f6035d5e54c9efc71be94bb5e3727f10909001200000000000000000000000000000000000000000000000000000000000000000000000000100000000010145310e878941a1b2bc2d33797ee4d89d95eaaf2e13488063a2aa9a74490f510a0100000023220020b6744de4f6ec63cc92f7c220cdefeeb1b1bed2b66c8e5706d80ec247d37e65a1ffffffff01002d3101000000001976a9143ebc40e411ed3c76f86711507ab952300890397288ac0400473044022001dd489a5d4e2fbd8a3ade27177f6b49296ba7695c40dbbe650ea83f106415fd02200b23a0602d8ff1bdf79dee118205fc7e9b40672bf31563e5741feb53fb86388501483045022100f88f040e90cc5dc6c6189d04718376ac19ed996bf9e4a3c29c3718d90ffd27180220761711f16c9e3a44f71aab55cbc0634907a1fa8bb635d971a9a01d368727bea10169522103b3623117e988b76aaabe3d63f56a4fc88b228a71e64c4cc551d1204822fe85cb2103dd823066e096f72ed617a41d3ca56717db335b1ea47a1b4c5c9dbdd0963acba621033d7c89bd9da29fa8d44db7906a9778b53121f72191184a9fee785c39180e4be153ae00000000010000000120925534261de4dcebb1ed5ab1b62bfe7a3ef968fb111dc2c910adfebc6e3bdf010000006b483045022100f50198f5ae66211a4f485190abe4dc7accdabe3bc214ebc9ea7069b97097d46e0220316a70a03014887086e335fc1b48358d46cd6bdc9af3b57c109c94af76fc915101210316cff587a01a2736d5e12e53551b18d73780b83c3bfb4fcf209c869b11b6415effffffff0220a10700000000001976a91450333046115eaa0ac9e0216565f945070e44573988ac2e7cd01a000000001976a914c01a7ca16b47be50cbdbc60724f701d52d75156688ac00000000010000000203a25f58630d7a1ea52550365fd2156683f56daf6ca73a4b4bbd097e66516322010000006a47304402204efc3d70e4ca3049c2a425025edf22d5ca355f9ec899dbfbbeeb2268533a0f2b02204780d3739653035af4814ea52e1396d021953f948c29754edd0ee537364603dc012103f7a897e4dbecab2264b21917f90664ea8256189ea725d28740cf7ba5d85b5763ffffffff03a25f58630d7a1ea52550365fd2156683f56daf6ca73a4b4bbd097e66516322000000006a47304402202d96defdc5b4af71d6ba28c9a6042c2d5ee7bc6de565d4db84ef517445626e03022022da80320e9e489c8f41b74833dfb6a54a4eb5087cdb46eb663eef0b25caa526012103f7a897e4dbecab2264b21917f90664ea8256189ea725d28740cf7ba5d85b5763ffffffff0200e1f5050000000017a914b7e6f7ff8658b2d1fb107e3d7be7af4742e6b1b3876f88fc00000000001976a914913bcc2be49cb534c20474c4dee1e9c4c317e7eb88ac0000000001000000043ffd60d3818431c495b89be84afac205d5d1ed663009291c560758bbd0a66df5010000006b483045022100f344607de9df42049688dcae8ff1db34c0c7cd25ec05516e30d2bc8f12ac9b2f022060b648f6a21745ea6d9782e17bcc4277b5808326488a1f40d41e125879723d3a012103f7a897e4dbecab2264b21917f90664ea8256189ea725d28740cf7ba5d85b5763ffffffffa5379401cce30f84731ef1ba65ce27edf2cc7ce57704507ebe8714aa16a96b92010000006a473044022020c37a63bf4d7f564c2192528709b6a38ab8271bd96898c6c2e335e5208661580220435c6f1ad4d9305d2c0a818b2feb5e45d443f2f162c0f61953a14d097fd07064012103f7a897e4dbecab2264b21917f90664ea8256189ea725d28740cf7ba5d85b5763ffffffff70e731e193235ff12c3184510895731a099112ffca4b00246c60003c40f843ce000000006a473044022053760f74c29a879e30a17b5f03a5bb057a5751a39f86fa6ecdedc36a1b7db04c022041d41c9b95f00d2d10a0373322a9025dba66c942196bc9d8adeb0e12d3024728012103f7a897e4dbecab2264b21917f90664ea8256189ea725d28740cf7ba5d85b5763ffffffff66b7a71b3e50379c8e85fc18fe3f1a408fc985f257036c34702ba205cef09f6f000000006a4730440220499bf9e2db3db6e930228d0661395f65431acae466634d098612fd80b08459ee022040e069fc9e3c60009f521cef54c38aadbd1251aee37940e6018aadb10f194d6a012103f7a897e4dbecab2264b21917f90664ea8256189ea725d28740cf7ba5d85b5763ffffffff0200e1f5050000000017a9148fc37ad460fdfbd2b44fe446f6e3071a4f64faa6878f447f0b000000001976a914913bcc2be49cb534c20474c4dee1e9c4c317e7eb88ac00000000",["a914feb8a29635c56d9cd913122f90678756bf23887687","76a914c01a7ca16b47be50cbdbc60724f701d52d75156688ac","76a914913bcc2be49cb534c20474c4dee1e9c4c317e7eb88ac","76a914913bcc2be49cb534c20474c4dee1e9c4c317e7eb88ac","76a914913bcc2be49cb534c20474c4dee1e9c4c317e7eb88ac","76a914913bcc2be49cb534c20474c4dee1e9c4c317e7eb88ac","76a914913bcc2be49cb534c20474c4dee1e9c4c317e7eb88ac","76a914913bcc2be49cb534c20474c4dee1e9c4c317e7eb88ac"],"8f13b9a9c85611635b47906c3053ac53cfcec7211455d4cb0d63dc9acc13d472","09027acea61b6cc3fb33f5d52f7d088a6b2f75d234e89ca800","546c574a0472144bcaf9b6aeabf26372ad87c7af7d1ee0dbfae5e099abeae49c","Duplicate pushdata 913bcc2be49cb534c20474c4dee1e9c4c317e7eb"],
|
||||
[987876,"0000000000000c00901f2049055e2a437c819d79a3d54fd63e6af796cd7b8a79","000000202694f74969fdb542090e95a56bc8aa2d646e27033850e32f1c5f000000000000f7e53676b3f12d5beb524ed617f2d25f5a93b5f4f52c1ba2678260d72712f8dd0a6dfe5740257e1a4b1768960101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1603e4120ff9c30a1c216900002f424d4920546573742fffffff0001205fa012000000001e76a914c486de584a735ec2f22da7cd9681614681f92173d83d0aa68688ac00000000",[],"fe4d230dbb0f4fec9bed23a5283e08baf996e3f32b93f52c7de1f641ddfd04ad","010c0b40","0965a544743bbfa36f254446e75630c09404b3d164a261892372977538928ed5","Coinbase tx has unparseable output script"],
|
||||
[1263442,"000000006f27ddfe1dd680044a34548f41bed47eba9e6f0b310da21423bc5f33","000000201c8d1a529c39a396db2db234d5ec152fa651a2872966daccbde028b400000000083f14492679151dbfaa1a825ef4c18518e780c1f91044180280a7d33f4a98ff5f45765aaddc001d38333b9a02010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff230352471300fe5f45765afe94690a000963676d696e6572343208000000000000000000ffffffff024423a804000000001976a914f2c25ac3d59f3d674b1d1d0a25c27339aaac0ba688ac0000000000000000266a24aa21a9edcb26cb3052426b9ebb4d19c819ef87c19677bbf3a7c46ef0855bd1b2abe83491012000000000000000000000000000000000000000000000000000000000000000000000000002000000000101d20978463906ba4ff5e7192494b88dd5eb0de85d900ab253af909106faa22cc5010000000004000000014777ff000000000016001446c29eabe8208a33aa1023c741fa79aa92e881ff0347304402207d7ca96134f2bcfdd6b536536fdd39ad17793632016936f777ebb32c22943fda02206014d2fb8a6aa58279797f861042ba604ebd2f8f61e5bddbd9d3be5a245047b201004b632103eeaeba7ce5dc2470221e9517fb498e8d6bd4e73b85b8be655196972eb9ccd5566754b2752103a40b74d43df244799d041f32ce1ad515a6cd99501701540e38750d883ae21d3a68ac00000000",["002027a5000c7917f785d8fc6e5a55adfca8717ecb973ebb7743849ff956d896a7ed"],"31d66d516a9eda7de865df29f6ef6cb8e4bf9309e5dac899968a9a62a5df61e3","0385acb4f0fe889ef0","4e6d564c2a2452065c205dd7eb2791124e0c4e0dbb064c410c24968572589dec","Includes witness data"],
|
||||
[1414221,"0000000000000027b2b3b3381f114f674f481544ff2be37ae3788d7e078383b1","000000204ea88307a7959d8207968f152bedca5a93aefab253f1fb2cfb032a400000000070cebb14ec6dbc27a9dfd066d9849a4d3bac5f674665f73a5fe1de01a022a0c851fda85bf05f4c19a779d1450102000000010000000000000000000000000000000000000000000000000000000000000000ffffffff18034d94154d696e6572476174653030310d000000f238f401ffffffff01c817a804000000000000000000",[],"5e5e12d90693c8e936f01847859404c67482439681928353ca1296982042864e","00","021e8882ef5a0ed932edeebbecfeda1d7ce528ec7b3daa27641acf1189d7b5dc","Empty data"]
|
||||
]
|
||||
212
src/test/data/key_io_invalid.json
Normal file
212
src/test/data/key_io_invalid.json
Normal file
|
|
@ -0,0 +1,212 @@
|
|||
[
|
||||
[
|
||||
""
|
||||
],
|
||||
[
|
||||
"x"
|
||||
],
|
||||
[
|
||||
"BuTpD3DhWkhqAbTwHsi1HoHMBnEt9FZjXvxoH7rZj69wk7TzaHe2UFNb9kXXn9BXpvsxX1uLe6e"
|
||||
],
|
||||
[
|
||||
"rwC3GPVK4945qFqKpUBgBsx5kcfUbBK45PvbSdwr7GibPenfTpQ69C3NwkCE5tSStcSwESJsEWK"
|
||||
],
|
||||
[
|
||||
"nYxto5SAr9Jg9jkNxY8ydPAAtou7qFSaG6gzhLvoWd3cXmMQAhX3z9rv9ps8iFhsM9ck7ShbQBt"
|
||||
],
|
||||
[
|
||||
"BXhDNzUAgn2BsLwcsosbhrEvWu7xSnxz2bcjL9JrQtoea2nAXGyAm"
|
||||
],
|
||||
[
|
||||
"56MLT7DyYXRDX2r5L81ii3cBJavX1xwojU7TxZPq21R9aWVckdm"
|
||||
],
|
||||
[
|
||||
"tc1qx0swud7273f46typschtse4guacfxv7slv2lzn"
|
||||
],
|
||||
[
|
||||
"dbt1p26sxm5fchngdq25akkqayhchtxycfmenejhh65e34qd5a5hq073qunpltt"
|
||||
],
|
||||
[
|
||||
"DGBT13YGUGUSAM9VR4VR8F08JCNVYK9JC4UPVVS5AV7TK6A5ZE7326PG8QEKZRQ5"
|
||||
],
|
||||
[
|
||||
"dgbrt1r2vz5eqx3"
|
||||
],
|
||||
[
|
||||
"dgb1099q62ngz0j7znrwpx2xe7694qkw5ejd0vp4gcfvg8mwpuahrznwrmjxlmkkm7a3qzqw6guce"
|
||||
],
|
||||
[
|
||||
"dgbt1dyelee"
|
||||
],
|
||||
[
|
||||
"dgbrt1qde05564xdgvxgxcsncn69ll0aq3vtk8vgrgq2f6y9u6sjyef7qcpn9qmhe"
|
||||
],
|
||||
[
|
||||
"dgb1wvzwq4"
|
||||
],
|
||||
[
|
||||
"dgbt1qrka9848gz38f76s943zec0kt53hhq63sxcvcmm8lxmx79j3x097sj8rrr9"
|
||||
],
|
||||
[
|
||||
"dgbrt1qxhsga52h5383es2ug8THED0j0k28r8vh4e53dw"
|
||||
],
|
||||
[
|
||||
"dgb1msjz9h"
|
||||
],
|
||||
[
|
||||
"DGBT1Q5JTCF3U0DWXJGQKM97HA0VV0T8TYCYJ0LE460L6H9XNXDSYYKRJQ6UVW0M"
|
||||
],
|
||||
[
|
||||
"dgbrt1qw7d4ycvmtc2q6sxds4hrk0hjl2p9en5g9cqly6"
|
||||
],
|
||||
[
|
||||
"dgb1p44dfrqf3v9gvu9dneuff0fcqnhwpy7clft9z6kmec20uctsar2wssl50qv"
|
||||
],
|
||||
[
|
||||
"dgbt1zhyn73w8ras4wrn52ejavvrdsxgded8gw"
|
||||
],
|
||||
[
|
||||
"dgbrt1s65aa9xkmtjskrxspnvt2zl3jwp73dmxrv2l90e"
|
||||
],
|
||||
[
|
||||
"2fqV3AG8xhoZrfzkkrVm2bwfCaM153jSXRR"
|
||||
],
|
||||
[
|
||||
"2NhjK4nqqHHVDwMBa8BXxmFxf4NPWYwQAVjRTQP8abX1hMTq5hp3yhyhoGc6P4Kfm1wh6er4ddG2"
|
||||
],
|
||||
[
|
||||
"niRaCRkBpH4wH6fkLa8ihVrZzrxcQhJ2BY6gTwxSs7FCFJ1eJ5xtLBZaqHSdLaoBPaRHJhKWkq7"
|
||||
],
|
||||
[
|
||||
"L4gTB4WAtVMUNJtfV4j7EAXnr78fquJudhwm8VqczBeZtSkLze3n"
|
||||
],
|
||||
[
|
||||
"7tX46qV2VV2ZXCdSnutKfvDgZZK3MuL45NoZgPrmW3T4GNxKXeXHgdbZiTAuNU58LRW1RzUahspTr"
|
||||
],
|
||||
[
|
||||
"4Duob4QkrvvZPEdzSq3ayoDxiL3UC3tMxRvrcedbh1inyqxCUh6Q2rgxDhYtZbH1njtQDvT4bwF29"
|
||||
],
|
||||
[
|
||||
"7tzCmvTsuRhdPMQVFdNzpuadsRzAic2ZDY7vUKE238JqgxAbXsdLE5rQEgzD8oBFU3FLBumFSV23K"
|
||||
],
|
||||
[
|
||||
"tc1qrxxgq0lmpqey6nzcgvuf8ylarjtm4v2hlesn2g"
|
||||
],
|
||||
[
|
||||
"dbt1pz2j7678fkc0qnmfn6024j4wllqsuzgzddrvgellzmu9ck7v2g58s3x8h08"
|
||||
],
|
||||
[
|
||||
"dgbt13zcljpcvgvcfcdnq82sg4yv9n0pwt99zum5rdrrhda65uwmsj24us650ff9"
|
||||
],
|
||||
[
|
||||
"dgbrt1rqqw8zctr"
|
||||
],
|
||||
[
|
||||
"dgb1msjz9h"
|
||||
],
|
||||
[
|
||||
"dgbt1qjhfqjv0krcpssxcnzzkrchtq9g4ek03c"
|
||||
],
|
||||
[
|
||||
"dgbrt1qwyt2gn5r7lymvqe7ue83e9q3rku9pln4ck923m6l4np6pmg85yg3lx5rkw"
|
||||
],
|
||||
[
|
||||
"dgb1q64adegjwk720my5ppwccpygggsqr8d68v"
|
||||
],
|
||||
[
|
||||
"dgbt1qddl2536ekjgzlmzk9x36vdntp9lwqr3uraqd243cuaxtyujcnv4qtqpvcz"
|
||||
],
|
||||
[
|
||||
"dgbrt1q2gc5fejygxz8ND37mymh0rvdvqn7jkga3q8c68"
|
||||
],
|
||||
[
|
||||
"dgb1msjz9h"
|
||||
],
|
||||
[
|
||||
"dgbt1qkp0f0e8za038h4p96nxpr7d5md30gkax7qzwznpjeyj8d6yzcjes4q586g"
|
||||
],
|
||||
[
|
||||
"dgbrt1qha74p52m6vscnm7nc0gv70uwv3yg749qde4emy"
|
||||
],
|
||||
[
|
||||
"dgb1ptpfqmr55jx2nc9h5emg84hqxmwune8gn04qg8t8ft3860ll59zrseq0q36"
|
||||
],
|
||||
[
|
||||
"DGBT1ZDF0D6M4ZZJ2QPMFPMTWL84HGDCRHN4WQ"
|
||||
],
|
||||
[
|
||||
"dgbrt1s58hhcrzwyqx73hfw7rtp0ws7cuk56lrqu53qkg"
|
||||
],
|
||||
[
|
||||
"PbqZ63SPSEVm664GwG3TnhqGTTdPpgoLS9b9oKasKx8fLzCJ3AvaLXPJQytntVzih5S6ZUGbQRn"
|
||||
],
|
||||
[
|
||||
"XXodePRAgBnqgq4JibSPeYSw84f28V1J5ohkJtXZQ12ufheQ15ns"
|
||||
],
|
||||
[
|
||||
"7uXAtffgcLYvQNG7NZg1i8oA8pm6iT2sGZGrdcHvEWVEd4p8Q6u8ykUfJ5giQghD6NbLnYPDHPkDz"
|
||||
],
|
||||
[
|
||||
"tc1q87mwrtzg66lf9duemsrkuaqxwj262mr6y87syd"
|
||||
],
|
||||
[
|
||||
"dbt1pwnacq6jkd68vc7m2w02q39rh98h2cxjr5uvfdg5jj9j6yzu40wzqgj4rhh"
|
||||
],
|
||||
[
|
||||
"DGBT13D37FN4M04G78L5CTLAEJJUM2MA5JW3JS3TT6PM4PP2TNMPJ7WFWQ7KP0US"
|
||||
],
|
||||
[
|
||||
"dgbrt1rac6t35s3"
|
||||
],
|
||||
[
|
||||
"dgb10t4efssru0fmfeyqnvqdvrd7n296y8q50elnnp8nhks6y9pwupea2n8xzwwujqlqt4g7q00yt"
|
||||
],
|
||||
[
|
||||
"dgbt1qv7eyettdmtwexcery8q8kc458ys2nkcg"
|
||||
],
|
||||
[
|
||||
"dgbrt1qydlhgsfu23wszgpdmw0zcxtvg3k4q9whnvzmz72076z7dxt8eetpjtj6e9"
|
||||
],
|
||||
[
|
||||
"dgb1qlaugnz34360w24na9nfdy2v8s5qsln6vg"
|
||||
],
|
||||
[
|
||||
"dgbt1qw2xv2msfun86vjwu9kalg6ek57h7dc2wzcru26scmmfdfdmcnw5sy977py"
|
||||
],
|
||||
[
|
||||
"dgbrt1qfa0eegl7wqmww4l80ha5WET0wxye7y3fregnxy"
|
||||
],
|
||||
[
|
||||
"dgb1q4yfp50zfadv46mcxjmp650q58dmy6n47y53v3f"
|
||||
],
|
||||
[
|
||||
"dgbt1qzemff4ep879kxjphsqc4sws92xw5fdajhzcy436zk0ek04qzcx6qh36dda"
|
||||
],
|
||||
[
|
||||
"DGBRT1QYAX7G65ZJHWTLRRHAN4ETG4TMC7VW5EACXVEG4"
|
||||
],
|
||||
[
|
||||
"dgb1ptntsze62cz75757sz3z7k620xn4gj4k5upzkqgkwlw6jwdw2a8tqu7tm9r"
|
||||
],
|
||||
[
|
||||
"dgbt1zkygxhnqzrvhzpua7jhaazfjzlgl3dfe8"
|
||||
],
|
||||
[
|
||||
"dgbrt1svdqjum35jgtqxxfnktr39j7rtk5pdlk8g23jkw"
|
||||
],
|
||||
[
|
||||
"SQzMBQJg5NkGASJr8TomStmVmTUy8uUjt6s"
|
||||
],
|
||||
[
|
||||
"yUg9YhoD5JbJumLyU7TDr5PipUb4Vr3XZ3s"
|
||||
],
|
||||
[
|
||||
"2WNEhMWCDn4rAcAaXFbyDLNB2wVaZaj4bwXahVbjMVtRuTGCCYPxhGPrJsasoNAxRXzSKGsmRish"
|
||||
],
|
||||
[
|
||||
"rtYieQyuPGvmcApn8DMcxB3GkBce53uDzKHoJJkeEozucpTQzDJikDFxV37bfKQaJ7ekAzjqq3W"
|
||||
],
|
||||
[
|
||||
"3HKSVVBUvJhetEwuq5UtJvPNAHg48ZGXgM"
|
||||
]
|
||||
]
|
||||
610
src/test/data/key_io_valid.json
Normal file
610
src/test/data/key_io_valid.json
Normal file
|
|
@ -0,0 +1,610 @@
|
|||
[
|
||||
[
|
||||
"DSC6tGC2NvN6AHio2p8pU4seTbPKDi7KZb",
|
||||
"76a914e6ec2d60813a79e9f5c3b28f22e155c475ee936c88ac",
|
||||
{
|
||||
"chain": "main",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"SefNWSMmXAxc4N8sxHyg8hHXTTU9GojgzX",
|
||||
"a914be84ccf5093ffeab492adcdef4e8155795897f5187",
|
||||
{
|
||||
"chain": "main",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"sxnDwNPKaPKZd5ZgJfVfom8cX4ZJkYr1zL",
|
||||
"76a914a6a9357cb1257c4539c729ba1b42f5aede3ef63f88ac",
|
||||
{
|
||||
"chain": "test",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"yf4ztby3Z5cFgxjbTpnwzU2TNxn5oiorbW",
|
||||
"a914cdaee5b3842699624d1c7ec1334dda3ff5a882a887",
|
||||
{
|
||||
"chain": "test",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"t3RJSU3BGXUMgtUpbhjNX4w1BNsNJvnrG5",
|
||||
"76a914d98cdc47adb355ee9bd477789bd4cb1fc85ab43788ac",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"yY8GB7pMc18XSfewBPTp7UZEGgXqfMo3WT",
|
||||
"a91481840612c707b3fec67f0ff1f17498e4af29d0f687",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"t4386ZKQfVtDu86BoraHAKmBgMr5RjDUwe",
|
||||
"76a914e05333732ba9c8c4fb5462c11a136d8eeba1939888ac",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"ycVhwoMsNkzV2ax7UPWsNnffTZActQt9cs",
|
||||
"a914b172c62a4b90fb2c3f811c834a1b3ce9ccf90c5187",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"5JSNRmPr8kcjcgpbULaVKCEH397u9sjA4yKYXNpLP23PS8BTkDD",
|
||||
"51eea013023f62337773d1a04a75cff854f47f0fe59ac8f393b41be6fe762266",
|
||||
{
|
||||
"chain": "main",
|
||||
"isCompressed": false,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"KzosC46S8tinpaaMzxDo1CNtAt1uaBBg2B6Q2P5DAZ54wdzZFb2U",
|
||||
"6b153d2a9a94cbec2c59c6582d32625baa2994fbe5cbfef940a9ad9e1005b2a2",
|
||||
{
|
||||
"chain": "main",
|
||||
"isCompressed": true,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"9XmMg96PTrbUbFEqqJK2W3XR2Cnfp8YUkjoS8RGARQ9F8aLz13o",
|
||||
"86967e04c971753f5c17e5dda14ce29f1c398a686f5dcb70a5f63635523de5e5",
|
||||
{
|
||||
"chain": "test",
|
||||
"isCompressed": false,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"edXyTM44iUHoPkAVWcSBoGS4xxNXkcbr3RHVUkkMgTfXKEGeQNu3",
|
||||
"61221ba31293f9e452d3c2eb63d547bb1ba1b01554cb503bd89c9d048af2488b",
|
||||
{
|
||||
"chain": "test",
|
||||
"isCompressed": true,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"9WqEPZTqXxXfhGt1cSVknQAwU5cP8S1rCFNvUkY2gNnoqWBjnuH",
|
||||
"0bb063cbff39bdf6e38d101e2b097a059ab33074c90e0b68e5f6f7ccb26bef8c",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isCompressed": false,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"ed7DBPVtZHvCjLeghVpjigFKanWZuhjRMN8XiJmG45E7BcBLpd8q",
|
||||
"5464de9b6657ec27d9b8f45a40e8163548d032316d73232035d26549a26082d6",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isCompressed": true,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"9XCrPTAT4HeZx9dhWUZv76HWPc1w7VNJ3nnfsSyYwzAZV86BNrS",
|
||||
"3cc807e17eb7b9d84d4db8cb7b6e61c360a67a4383b3f44daeccabd3be5f8da9",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isCompressed": false,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"ehQ9EgPeGfox7a7uGNL6drG7pFMVZfGknPKBpj2DAo6ZDcR4Xq6z",
|
||||
"d4743e5fe9fb14f72eafc0be328aee547b57c84207525999ef2cdd174fec7a30",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isCompressed": true,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgb1qhyz5jznu8rxjz6emktwwkz5m0m4gr9q9rvhegc",
|
||||
"0014b905490a7c38cd216b3bb2dceb0a9b7eea819405",
|
||||
{
|
||||
"chain": "main",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgb1qs6parp27xaccjznw4sruj9nrtuyl3wtraf58ml7nen522da2vxqql3zq6n",
|
||||
"00208683d1855e3771890a6eac07c916635f09f8b963ea687dffd3cce8a537aa6180",
|
||||
{
|
||||
"chain": "main",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgb1pva0l3ng2q0gt2t3rqqpqxk5y57l4u0xyryxdslrt76k5u54rvpssjpmuhq",
|
||||
"5120675ff8cd0a03d0b52e230002035a84a7bf5e3cc4190cd87c6bf6ad4e52a36061",
|
||||
{
|
||||
"chain": "main",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgb1zg9eqzn02yp",
|
||||
"52024172",
|
||||
{
|
||||
"chain": "main",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1qznyt7p9zln65ydpuzfq8ksuz4hkvcwdl9qtcty",
|
||||
"001414c8bf04a2fcf542343c12407b4382adeccc39bf",
|
||||
{
|
||||
"chain": "test",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1qu2au468tx43wqwzkhgruhxzksgt2j785kekzsw0hymg7kyzgumtq02uk88",
|
||||
"0020e2bbcae8eb3562e03856ba07cb98568216a978f4b66c2839f726d1eb1048e6d6",
|
||||
{
|
||||
"chain": "test",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1pykapk8r8wlwrl60zwz8rhfy5x3dc3k545utuea798ye2qk6vay9q3l9vt7",
|
||||
"512025ba1b1c6777dc3fe9e2708e3ba494345b88da95a717ccf7c53932a05b4ce90a",
|
||||
{
|
||||
"chain": "test",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1r3mj8zr2mx0qfnegalvxspmvj3v3srd47",
|
||||
"53108ee4710d5b33c099e51dfb0d00ed928b",
|
||||
{
|
||||
"chain": "test",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1qxg8h2t6kct02fpd2k8j83d3lw90873pp2alg8z",
|
||||
"0014320f752f56c2dea485aab1e478b63f715e7f4421",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1qm7szx0090wtykgkj7yegvzgqwpaj29mpwwy6llv8muv6gv8pg2nsx8jyd8",
|
||||
"0020dfa0233de57b964b22d2f132860900707b2517617389affd87df19a430e142a7",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1ptxsn8ntuvda48zm4egpunyxdpv60eru52q26dzjv97epa828jaesqr6yzv",
|
||||
"512059a133cd7c637b538b75ca03c990cd0b34fc8f945015a68a4c2fb21e9d479773",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1rde95r5zsr99etu06ft8kgyfkjuk0mfgexjffjklk5t8t33hmmsxqjsw59g",
|
||||
"53206e4b41d050194b95f1fa4acf641136972cfda5193492995bf6a2ceb8c6fbdc0c",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbrt1qgmzq7xt3pkclw9d6emultxnhj4lumdldzeyypq",
|
||||
"001446c40f19710db1f715bacef9f59a77957fcdb7ed",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbrt1qdmn2glunkfcmahndk3ukygkwgwsr26842gzlctfz4mnscp2mz6uql5jdft",
|
||||
"00206ee6a47f93b271bede6db4796222ce43a03568f55205fc2d22aee70c055b16b8",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbrt1pwvzf9ga8e7gp5v5eut66fctgkf29uu7efty3aseha3tzzc3sp92qjz3afh",
|
||||
"5120730492a3a7cf901a3299e2f5a4e168b2545e73d94ac91ec337ec562162300954",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbrt1srhpvsx48wjzj2m46hcux78havpds9773fd073ch5h58dtz03h6axzy7d78mpjzgl66fkkm",
|
||||
"60281dc2c81aa77485256ebabe386f1efd605b02fbd14b5fe8e2f4bd0ed589f1beba6113cdf1f619091f",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"DLcJt91uXayS59gHzqWDndxCf3FTFQQg9e",
|
||||
"76a914a9af6bc35597f7f0e6b7764d7796a10e0378692d88ac",
|
||||
{
|
||||
"chain": "main",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"SgoSBq4oN3PQVmRYEiDxNAaZZbyX1GJz4H",
|
||||
"a914d5fb737a737367a00f64eb0502ca1b537ddab92087",
|
||||
{
|
||||
"chain": "main",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"ssWFLqKGQUVxFFT24afLzeRqb5o9jxczwm",
|
||||
"76a9146ccb18dafed952f172add6ca0f34f58122b9b26988ac",
|
||||
{
|
||||
"chain": "test",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"yUn2MDBLqaBUJz28NvMdDy7txNkkQnjtrK",
|
||||
"a9145cc7c928dc55407e652a331f20527ce0a54c2abc87",
|
||||
{
|
||||
"chain": "test",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"sztVkDE2j2yLbjGp6x7TSQeFM7MiJFAdYc",
|
||||
"76a914bdc926dd0b4d9288b8f3d1f80b965e3c7e81b72988ac",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"yYNjdgSG5HuHFQs4CETKJgNjt4cye8X1W7",
|
||||
"a9148440c4986114efcd1eef7a8870ca7fb23756f18587",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"t1bRTBkEHcSVXCDap2bcZgvh4fH76Z8fux",
|
||||
"76a914c5869f46d18f718fbeebf7b167dba6d97086631e88ac",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"yYiinVEswEy72KCsiMqvNtS7SuGj49m1de",
|
||||
"a9148808611202b63ffac05fe97229687f1f5fcf971587",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"5KZWsvWPXuTRNse4ZTdAnqQ2pWNyAgG7kmxzGZ8z34s9vpfQGeQ",
|
||||
"e5da7a2775446b606de05b16580e7858d0a04ccb0e1584f996993c3a6bb2ecd8",
|
||||
{
|
||||
"chain": "main",
|
||||
"isCompressed": false,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"KwhHQReUGQVJjB6aXXPATPuooTkWeDwAVGRHC2SvdzXUNs3ePwCV",
|
||||
"0e2f39961593f6fb6458375e2056f97ec2bf4694817e6e64301752f5031d79da",
|
||||
{
|
||||
"chain": "main",
|
||||
"isCompressed": true,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"9Xn2fbUxJykYN272QphaEaJKn9yqnzy2MMy7YzC1tst6jm9ahah",
|
||||
"881d4220f838b3469cbaa7c1a46a2cfba8dac920d6d607dc85ffdf5cf8f82b7b",
|
||||
{
|
||||
"chain": "test",
|
||||
"isCompressed": false,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"eaZuKCg1dcZZnbnnjJNYa9J2Qc3uiptuqDtHeJzwhhLfSfbjdA5c",
|
||||
"089cfa6d1f182e3702114e8f5b44fb6ac97061a18555bb8f8ad8f084bea5f15d",
|
||||
{
|
||||
"chain": "test",
|
||||
"isCompressed": true,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"9XTFmkm8uHBhM7BxjkE6C7baXqVUq83xCvYo5zs4tPJHuYrEGfu",
|
||||
"5d7c4d6cb288fb69374d884b10c777dbf7d709fa2c9d9b5147fc22db8580a877",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isCompressed": false,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"eeCUCjfJNYiS2UdvGeFkmJTnD6FVGCRREide4dco8n5aMMtxbPr5",
|
||||
"74efd5ed9310530e1448822f56f54be71d1ad0fd49241d830d37cb7f3800ff0f",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isCompressed": true,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"9XCx1PKNUQDitvKbtwibopmWHrAME3czxtp9Af9sLGKQVGB9oj4",
|
||||
"3d0059a6a6513b3b815f6982b5df7af562ba2083112767cb51c2f7af0c226f2d",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isCompressed": false,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"eddr24Y6otdiUiy428utekzZXymxPpjR6BD5keya3zU4CRFwdzv8",
|
||||
"6427667a918962061cc13e83a8fbd23887e0ef89fbe0edf5cf9be66417181327",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isCompressed": true,
|
||||
"isPrivkey": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgb1qrgyfmq9pglmuu6jls8rv4r8n5qwe5kf0xzwjxa",
|
||||
"00141a089d80a147f7ce6a5f81c6ca8cf3a01d9a592f",
|
||||
{
|
||||
"chain": "main",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgb1q6mtxsjp7ftpjqyaxhpz7eu7ar35608n20djpkl5ag75srq9pxslqlmmvkn",
|
||||
"0020d6d668483e4ac32013a6b845ecf3dd1c69a79e6a7b641b7e9d47a90180a1343e",
|
||||
{
|
||||
"chain": "main",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgb1pp9q7k3zg8qcgyk3flpngrspp56jgha4u9tpqkl0c7mldgkmg56cqkymwqf",
|
||||
"51200941eb44483830825a29f86681c021a6a48bf6bc2ac20b7df8f6fed45b68a6b0",
|
||||
{
|
||||
"chain": "main",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgb1z876q950tem",
|
||||
"52023fb4",
|
||||
{
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true,
|
||||
"chain": "main"
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1q67cgvyr0pan5fg8ttu452f3whrppvp7rltkdfa",
|
||||
"0014d7b086106f0f6744a0eb5f2b45262eb8c21607c3",
|
||||
{
|
||||
"chain": "test",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1qg5y9sd834y73hsp90npjevg3zlgps4eshnr9jvdyw49czaep0lpqnc7dhh",
|
||||
"002045085834f1a93d1bc0257cc32cb11117d0185730bcc65931a4754b8177217fc2",
|
||||
{
|
||||
"chain": "test",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1pwfgs89evk3934jrm8grk6mlrutu0jj9z70g5dq37hdshaq6ksj3stvk63v",
|
||||
"5120725103972cb44b1ac87b3a076d6fe3e2f8f948a2f3d146823ebb617e835684a3",
|
||||
{
|
||||
"chain": "test",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1rcfknjh90slujgp2am0mdvw689gtd8m4z",
|
||||
"5310c26d395caf87f924055ddbf6d63b472a",
|
||||
{
|
||||
"chain": "test",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1qpnnmtuggzz368ah9r5n2gxnum8mc30u7mueu7d",
|
||||
"00140ce7b5f10810a3a3f6e51d26a41a7cd9f788bf9e",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1qqh4xkl2x9l7xpm73gvzx7wyx3t8rygyrpc43yadvun9v7us5f8nqgvacdl",
|
||||
"002005ea6b7d462ffc60efd143046f38868ace3220830e2b1275ace4cacf721449e6",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1p7jxjz4cqj2meyen22u8vlmevmdvczmca5syv7098jd7hqhn232ksacjz7a",
|
||||
"5120f48d21570092b792666a570ecfef2cdb59816f1da408cf3ca7937d705e6a8aad",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbt1rqldkkn6dyp6k0kmvmkdpsmlzklwcu440r7jlw5dqvc46xp6c5pvsksvfzx",
|
||||
"532007db6b4f4d207567db6cdd9a186fe2b7dd8e56af1fa5f751a0662ba30758a059",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbrt1q49e9wrhymqnu34369fl9swka7vgd5zdczd8eas",
|
||||
"0014a972570ee4d827c8d63a2a7e583addf310da09b8",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbrt1qpzn7f8f5mg8chjy9fzp3rqc45h3pxnz4g7x000dhp5h3pw0vd66q6eny2y",
|
||||
"002008a7e49d34da0f8bc8854883118315a5e2134c55478cf7bdb70d2f10b9ec6eb4",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbrt1pkx3r6sg663jjmalyv8ctm25lwts2su9wzn5nhmkmcuglqaje3s3qsefzyp",
|
||||
"5120b1a23d411ad4652df7e461f0bdaa9f72e0a870ae14e93beedbc711f076598c22",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"dgbrt1sgazexrz6ufc8agw5md4hwm0xyfw0utsgnux6p7tphh5jeu46w308z7g5jezv295stnr3cj",
|
||||
"60284745930c5ae2707ea1d4db6b776de6225cfe2e089f0da0f961bde92cf2ba745e7179149644c51690",
|
||||
{
|
||||
"chain": "regtest",
|
||||
"isPrivkey": false,
|
||||
"tryCaseFlip": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"DK9tEorcu8C8Z666gQc4jHhnUVSGpYEgYZ",
|
||||
"76a91499b7e8a043c2da1d2b1377b47017e3ae6009429d88ac",
|
||||
{
|
||||
"chain": "main",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"SY7oZueX3D5aDBoDDSiTvxMB8Tt1ngCpLa",
|
||||
"a91476bba76ea06f9977c480fbf393caba44c46ed5f787",
|
||||
{
|
||||
"chain": "main",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"szAFfvC6Zv1wkhz2botSbAD9N76XKjF2Z8",
|
||||
"76a914b5cbeed994785e1b1fcf31854123aa5c1b91b72588ac",
|
||||
{
|
||||
"chain": "test",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"yUG4JK2Z8bccu3E961s98jg2xoxMRWJHtq",
|
||||
"a914571cef498e1e8cfc9a9bc8e3792f150d46be0a0a87",
|
||||
{
|
||||
"chain": "test",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"spGvf1ZQaue6g2hrJ2NCPPmCCGDWVWHo5c",
|
||||
"76a914495db6a4095559bdb7ebd890ced841a49698457e88ac",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isPrivkey": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"yi2eWF1q4CA326y2XqXzZS6qp7NkdpUKdU",
|
||||
"a914ee256cfb2af20ab3de56a38d13d9f289878b9b2a87",
|
||||
{
|
||||
"chain": "signet",
|
||||
"isPrivkey": false
|
||||
}
|
||||
]
|
||||
]
|
||||
2620
src/test/data/script_tests.json
Normal file
2620
src/test/data/script_tests.json
Normal file
File diff suppressed because one or more lines are too long
503
src/test/data/sighash.json
Normal file
503
src/test/data/sighash.json
Normal file
|
|
@ -0,0 +1,503 @@
|
|||
[
|
||||
["raw_transaction, script, input_index, hashType, signature_hash (result)"],
|
||||
["907c2bc503ade11cc3b04eb2918b6f547b0630ab569273824748c87ea14b0696526c66ba740200000004ab65ababfd1f9bdd4ef073c7afc4ae00da8a66f429c917a0081ad1e1dabce28d373eab81d8628de802000000096aab5253ab52000052ad042b5f25efb33beec9f3364e8a9139e8439d9d7e26529c3c30b6c3fd89f8684cfd68ea0200000009ab53526500636a52ab599ac2fe02a526ed040000000008535300516352515164370e010000000003006300ab2ec229", "", 2, 1864164639, "31af167a6cf3f9d5f6875caa4d31704ceb0eba078d132b78dab52c3b8997317e"],
|
||||
["a0aa3126041621a6dea5b800141aa696daf28408959dfb2df96095db9fa425ad3f427f2f6103000000015360290e9c6063fa26912c2e7fb6a0ad80f1c5fea1771d42f12976092e7a85a4229fdb6e890000000001abc109f6e47688ac0e4682988785744602b8c87228fcef0695085edf19088af1a9db126e93000000000665516aac536affffffff8fe53e0806e12dfd05d67ac68f4768fdbe23fc48ace22a5aa8ba04c96d58e2750300000009ac51abac63ab5153650524aa680455ce7b000000000000499e50030000000008636a00ac526563ac5051ee030000000003abacabd2b6fe000000000003516563910fb6b5", "65", 0, -1391424484, "48d6a1bd2cd9eec54eb866fc71209418a950402b5d7e52363bfb75c98e141175"],
|
||||
["6e7e9d4b04ce17afa1e8546b627bb8d89a6a7fefd9d892ec8a192d79c2ceafc01694a6a7e7030000000953ac6a51006353636a33bced1544f797f08ceed02f108da22cd24c9e7809a446c61eb3895914508ac91f07053a01000000055163ab516affffffff11dc54eee8f9e4ff0bcf6b1a1a35b1cd10d63389571375501af7444073bcec3c02000000046aab53514a821f0ce3956e235f71e4c69d91abe1e93fb703bd33039ac567249ed339bf0ba0883ef300000000090063ab65000065ac654bec3cc504bcf499020000000005ab6a52abac64eb060100000000076a6a5351650053bbbc130100000000056a6aab53abd6e1380100000000026a51c4e509b8", "acab655151", 0, 479279909, "2a3d95b09237b72034b23f2d2bb29fa32a58ab5c6aa72f6aafdfa178ab1dd01c"],
|
||||
["73107cbd025c22ebc8c3e0a47b2a760739216a528de8d4dab5d45cbeb3051cebae73b01ca10200000007ab6353656a636affffffffe26816dffc670841e6a6c8c61c586da401df1261a330a6c6b3dd9f9a0789bc9e000000000800ac6552ac6aac51ffffffff0174a8f0010000000004ac52515100000000", "5163ac63635151ac", 1, 1190874345, "06e328de263a87b09beabe222a21627a6ea5c7f560030da31610c4611f4a46bc"],
|
||||
["e93bbf6902be872933cb987fc26ba0f914fcfc2f6ce555258554dd9939d12032a8536c8802030000000453ac5353eabb6451e074e6fef9de211347d6a45900ea5aaf2636ef7967f565dce66fa451805c5cd10000000003525253ffffffff047dc3e6020000000007516565ac656aabec9eea010000000001633e46e600000000000015080a030000000001ab00000000", "5300ac6a53ab6a", 1, -886562767, "f03aa4fc5f97e826323d0daa03343ebf8a34ed67a1ce18631f8b88e5c992e798"],
|
||||
["50818f4c01b464538b1e7e7f5ae4ed96ad23c68c830e78da9a845bc19b5c3b0b20bb82e5e9030000000763526a63655352ffffffff023b3f9c040000000008630051516a6a5163a83caf01000000000553ab65510000000000", "6aac", 0, 946795545, "746306f322de2b4b58ffe7faae83f6a72433c22f88062cdde881d4dd8a5a4e2d"],
|
||||
["a93e93440250f97012d466a6cc24839f572def241c814fe6ae94442cf58ea33eb0fdd9bcc1030000000600636a0065acffffffff5dee3a6e7e5ad6310dea3e5b3ddda1a56bf8de7d3b75889fc024b5e233ec10f80300000007ac53635253ab53ffffffff0160468b04000000000800526a5300ac526a00000000", "ac00636a53", 1, 1773442520, "5c9d3a2ce9365bb72cfabbaa4579c843bb8abf200944612cf8ae4b56a908bcbd"],
|
||||
["ce7d371f0476dda8b811d4bf3b64d5f86204725deeaa3937861869d5b2766ea7d17c57e40b0100000003535265ffffffff7e7e9188f76c34a46d0bbe856bde5cb32f089a07a70ea96e15e92abb37e479a10100000006ab6552ab655225bcab06d1c2896709f364b1e372814d842c9c671356a1aa5ca4e060462c65ae55acc02d0000000006abac0063ac5281b33e332f96beebdbc6a379ebe6aea36af115c067461eb99d22ba1afbf59462b59ae0bd0200000004ab635365be15c23801724a1704000000000965006a65ac00000052ca555572", "53ab530051ab", 1, 2030598449, "c336b2f7d3702fbbdeffc014d106c69e3413c7c71e436ba7562d8a7a2871f181"],
|
||||
["d3b7421e011f4de0f1cea9ba7458bf3486bee722519efab711a963fa8c100970cf7488b7bb0200000003525352dcd61b300148be5d05000000000000000000", "535251536aac536a", 0, -1960128125, "29aa6d2d752d3310eba20442770ad345b7f6a35f96161ede5f07b33e92053e2a"],
|
||||
["04bac8c5033460235919a9c63c42b2db884c7c8f2ed8fcd69ff683a0a2cccd9796346a04050200000003655351fcad3a2c5a7cbadeb4ec7acc9836c3f5c3e776e5c566220f7f965cf194f8ef98efb5e3530200000007526a006552526526a2f55ba5f69699ece76692552b399ba908301907c5763d28a15b08581b23179cb01eac03000000075363ab6a516351073942c2025aa98a05000000000765006aabac65abd7ffa6030000000004516a655200000000", "53ac6365ac526a", 1, 764174870, "bf5fdc314ded2372a0ad078568d76c5064bf2affbde0764c335009e56634481b"],
|
||||
["c363a70c01ab174230bbe4afe0c3efa2d7f2feaf179431359adedccf30d1f69efe0c86ed390200000002ab51558648fe0231318b04000000000151662170000000000008ac5300006a63acac00000000", "", 0, 2146479410, "191ab180b0d753763671717d051f138d4866b7cb0d1d4811472e64de595d2c70"],
|
||||
["8d437a7304d8772210a923fd81187c425fc28c17a5052571501db05c7e89b11448b36618cd02000000026a6340fec14ad2c9298fde1477f1e8325e5747b61b7e2ff2a549f3d132689560ab6c45dd43c3010000000963ac00ac000051516a447ed907a7efffebeb103988bf5f947fc688aab2c6a7914f48238cf92c337fad4a79348102000000085352ac526a5152517436edf2d80e3ef06725227c970a816b25d0b58d2cd3c187a7af2cea66d6b27ba69bf33a0300000007000063ab526553f3f0d6140386815d030000000003ab6300de138f00000000000900525153515265abac1f87040300000000036aac6500000000", "51", 3, -315779667, "b6632ac53578a741ae8c36d8b69e79f39b89913a2c781cdf1bf47a8c29d997a5"],
|
||||
["fd878840031e82fdbe1ad1d745d1185622b0060ac56638290ec4f66b1beef4450817114a2c0000000009516a63ab53650051abffffffff37b7a10322b5418bfd64fb09cd8a27ddf57731aeb1f1f920ffde7cb2dfb6cdb70300000008536a5365ac53515369ecc034f1594690dbe189094dc816d6d57ea75917de764cbf8eccce4632cbabe7e116cd0100000003515352ffffffff035777fc000000000003515200abe9140300000000050063005165bed6d10200000000076300536363ab65195e9110", "635265", 0, 1729787658, "6e3735d37a4b28c45919543aabcb732e7a3e1874db5315abb7cc6b143d62ff10"],
|
||||
["f40a750702af06efff3ea68e5d56e42bc41cdb8b6065c98f1221fe04a325a898cb61f3d7ee030000000363acacffffffffb5788174aef79788716f96af779d7959147a0c2e0e5bfb6c2dba2df5b4b97894030000000965510065535163ac6affffffff0445e6fd0200000000096aac536365526a526aa6546b000000000008acab656a6552535141a0fd010000000000c897ea030000000008526500ab526a6a631b39dba3", "00abab5163ac", 1, -1778064747, "d76d0fc0abfa72d646df888bce08db957e627f72962647016eeae5a8412354cf"],
|
||||
["a63bc673049c75211aa2c09ecc38e360eaa571435fedd2af1116b5c1fa3d0629c269ecccbf0000000008ac65ab516352ac52ffffffffbf1a76fdda7f451a5f0baff0f9ccd0fe9136444c094bb8c544b1af0fa2774b06010000000463535253ffffffff13d6b7c3ddceef255d680d87181e100864eeb11a5bb6a3528cb0d70d7ee2bbbc02000000056a0052abab951241809623313b198bb520645c15ec96bfcc74a2b0f3db7ad61d455cc32db04afc5cc702000000016309c9ae25014d9473020000000004abab6aac3bb1e803", "", 3, -232881718, "6e48f3da3a4ac07eb4043a232df9f84e110485d7c7669dd114f679c27d15b97e"],
|
||||
["4c565efe04e7d32bac03ae358d63140c1cfe95de15e30c5b84f31bb0b65bb542d637f49e0f010000000551abab536348ae32b31c7d3132030a510a1b1aacf7b7c3f19ce8dc49944ef93e5fa5fe2d356b4a73a00100000009abac635163ac00ab514c8bc57b6b844e04555c0a4f4fb426df139475cd2396ae418bc7015820e852f711519bc202000000086a00510000abac52488ff4aec72cbcfcc98759c58e20a8d2d9725aa4a80f83964e69bc4e793a4ff25cd75dc701000000086a52ac6aac5351532ec6b10802463e0200000000000553005265523e08680100000000002f39a6b0", "", 3, 70712784, "c6076b6a45e6fcfba14d3df47a34f6aadbacfba107e95621d8d7c9c0e40518ed"],
|
||||
["1233d5e703403b3b8b4dae84510ddfc126b4838dcb47d3b23df815c0b3a07b55bf3098110e010000000163c5c55528041f480f40cf68a8762d6ed3efe2bd402795d5233e5d94bf5ddee71665144898030000000965525165655151656affffffff6381667e78bb74d0880625993bec0ea3bd41396f2bcccc3cc097b240e5e92d6a01000000096363acac6a63536365ffffffff04610ad60200000000065251ab65ab52e90d680200000000046351516ae30e98010000000008abab52520063656a671856010000000004ac6aac514c84e383", "6aabab636300", 1, -114996813, "aeb8c5a62e8a0b572c28f2029db32854c0b614dbecef0eaa726abebb42eebb8d"],
|
||||
["0c69702103b25ceaed43122cc2672de84a3b9aa49872f2a5bb458e19a52f8cc75973abb9f102000000055365656aacffffffff3ffb1cf0f76d9e3397de0942038c856b0ebbea355dc9d8f2b06036e19044b0450100000000ffffffff4b7793f4169617c54b734f2cd905ed65f1ce3d396ecd15b6c426a677186ca0620200000008655263526551006a181a25b703240cce0100000000046352ab53dee22903000000000865526a6a516a51005e121602000000000852ab52ababac655200000000", "6a516aab63", 1, -2040012771, "a6e6cb69f409ec14e10dd476f39167c29e586e99bfac93a37ed2c230fcc1dbbe"],
|
||||
["fd22692802db8ae6ab095aeae3867305a954278f7c076c542f0344b2591789e7e33e4d29f4020000000151ffffffffb9409129cfed9d3226f3b6bab7a2c83f99f48d039100eeb5796f00903b0e5e5e0100000006656552ac63abd226abac0403e649000000000007abab51ac5100ac8035f10000000000095165006a63526a52510d42db030000000007635365ac6a63ab24ef5901000000000453ab6a0000000000", "536a52516aac6a", 1, 309309168, "7ca0f75e6530ec9f80d031fc3513ca4ecd67f20cb38b4dacc6a1d825c3cdbfdb"],
|
||||
["a43f85f701ffa54a3cc57177510f3ea28ecb6db0d4431fc79171cad708a6054f6e5b4f89170000000008ac6a006a536551652bebeaa2013e779c05000000000665ac5363635100000000", "ac", 0, 2028978692, "58294f0d7f2e68fe1fd30c01764fe1619bcc7961d68968944a0e263af6550437"],
|
||||
["c2b0b99001acfecf7da736de0ffaef8134a9676811602a6299ba5a2563a23bb09e8cbedf9300000000026300ffffffff042997c50300000000045252536a272437030000000007655353ab6363ac663752030000000002ab6a6d5c900000000000066a6a5265abab00000000", "52ac525163515251", 0, -894181723, "8b300032a1915a4ac05cea2f7d44c26f2a08d109a71602636f15866563eaafdc"],
|
||||
["82f9f10304c17a9d954cf3380db817814a8c738d2c811f0412284b2c791ec75515f38c4f8c020000000265ab5729ca7db1b79abee66c8a757221f29280d0681355cb522149525f36da760548dbd7080a0100000001510b477bd9ce9ad5bb81c0306273a3a7d051e053f04ecf3a1dbeda543e20601a5755c0cfae030000000451ac656affffffff71141a04134f6c292c2e0d415e6705dfd8dcee892b0d0807828d5aeb7d11f5ef0300000001520b6c6dc802a6f3dd0000000000056aab515163bfb6800300000000015300000000", "", 3, -635779440, "d55ed1e6c53510f2608716c12132a11fb5e662ec67421a513c074537eeccc34b"],
|
||||
["8edcf5a1014b604e53f0d12fe143cf4284f86dc79a634a9f17d7e9f8725f7beb95e8ffcd2403000000046aabac52ffffffff01c402b5040000000005ab6a63525100000000", "6351525251acabab6a", 0, 1520147826, "2765bbdcd3ebb8b1a316c04656b28d637f80bffbe9b040661481d3dc83eea6d6"],
|
||||
["2074bad5011847f14df5ea7b4afd80cd56b02b99634893c6e3d5aaad41ca7c8ee8e5098df003000000026a6affffffff018ad59700000000000900ac656a526551635300000000", "65635265", 0, -1804671183, "663c999a52288c9999bff36c9da2f8b78d5c61b8347538f76c164ccba9868d0a"],
|
||||
["7100b11302e554d4ef249ee416e7510a485e43b2ba4b8812d8fe5529fe33ea75f36d392c4403000000020000ffffffff3d01a37e075e9a7715a657ae1bdf1e44b46e236ad16fd2f4c74eb9bf370368810000000007636553ac536365ffffffff01db696a0400000000065200ac656aac00000000", "63005151", 0, -1210499507, "b9c3aee8515a4a3b439de1ffc9c156824bda12cb75bfe5bc863164e8fd31bd7a"],
|
||||
["02c1017802091d1cb08fec512db7b012fe4220d57a5f15f9e7676358b012786e1209bcff950100000004acab6352ffffffff799bc282724a970a6fea1828984d0aeb0f16b67776fa213cbdc4838a2f1961a3010000000951516a536552ab6aabffffffff016c7b4b03000000000865abac5253ac5352b70195ad", "65655200516a", 0, -241626954, "be567cb47170b34ff81c66c1142cb9d27f9b6898a384d6dfc4fce16b75b6cb14"],
|
||||
["cb3178520136cd294568b83bb2520f78fecc507898f4a2db2674560d72fd69b9858f75b3b502000000066aac00515100ffffffff03ab005a01000000000563526363006e3836030000000001abfbda3200000000000665ab0065006500000000", "ab516a0063006a5300", 0, 1182109299, "2149e79c3f4513da4e4378608e497dcfdfc7f27c21a826868f728abd2b8a637a"],
|
||||
["18a4b0c004702cf0e39686ac98aab78ad788308f1d484b1ddfe70dc1997148ba0e28515c310300000000ffffffff05275a52a23c59da91129093364e275da5616c4070d8a05b96df5a2080ef259500000000096aac51656a6aac53ab66e64966b3b36a07dd2bb40242dd4a3743d3026e7e1e0d9e9e18f11d068464b989661321030000000265ac383339c4fae63379cafb63b0bab2eca70e1f5fc7d857eb5c88ccd6c0465093924bba8b2a000000000300636ab5e0545402bc2c4c010000000000cd41c002000000000000000000", "abac635253656a00", 3, 2052372230, "32db877b6b1ca556c9e859442329406f0f8246706522369839979a9f7a235a32"],
|
||||
["1d9c5df20139904c582285e1ea63dec934251c0f9cf5c47e86abfb2b394ebc57417a81f67c010000000353515222ba722504800d3402000000000353656a3c0b4a0200000000000fb8d20500000000076300ab005200516462f30400000000015200000000", "ab65", 0, -210854112, "edf73e2396694e58f6b619f68595b0c1cdcb56a9b3147845b6d6afdb5a80b736"],
|
||||
["4504cb1904c7a4acf375ddae431a74de72d5436efc73312cf8e9921f431267ea6852f9714a01000000066a656a656553a2fbd587c098b3a1c5bd1d6480f730a0d6d9b537966e20efc0e352d971576d0f87df0d6d01000000016321aeec3c4dcc819f1290edb463a737118f39ab5765800547522708c425306ebfca3f396603000000055300ac656a1d09281d05bfac57b5eb17eb3fa81ffcedfbcd3a917f1be0985c944d473d2c34d245eb350300000007656a51525152ac263078d9032f470f0500000000066aac00000052e12da60200000000003488410200000000076365006300ab539981e432", "52536a52526a", 1, -31909119, "f0a2deee7fd8a3a9fad6927e763ded11c940ee47e9e6d410f94fda5001f82e0c"],
|
||||
["14bc7c3e03322ec0f1311f4327e93059c996275302554473104f3f7b46ca179bfac9ef753503000000016affffffff9d405eaeffa1ca54d9a05441a296e5cc3a3e32bb8307afaf167f7b57190b07e00300000008abab51ab5263abab45533aa242c61bca90dd15d46079a0ab0841d85df67b29ba87f2393cd764a6997c372b55030000000452005263ffffffff0250f40e02000000000651516a0063630e95ab0000000000046a5151ac00000000", "6a65005151", 0, -1460947095, "aa418d096929394c9147be8818d8c9dafe6d105945ab9cd7ec682df537b5dd79"],
|
||||
["2b3bd0dd04a1832f893bf49a776cd567ec4b43945934f4786b615d6cb850dfc0349b33301a000000000565ac000051cf80c670f6ddafab63411adb4d91a69c11d9ac588898cbfb4cb16061821cc104325c895103000000025163ffffffffa9e2d7506d2d7d53b882bd377bbcc941f7a0f23fd15d2edbef3cd9df8a4c39d10200000009ac63006a52526a5265ffffffff44c099cdf10b10ce87d4b38658d002fd6ea17ae4a970053c05401d86d6e75f99000000000963ab53526a5252ab63ffffffff035af69c01000000000100ba9b8b0400000000004cead10500000000026a520b77d667", "ab52abac526553", 3, -1955078165, "eb9ceecc3b401224cb79a44d23aa8f428e29f1405daf69b4e01910b848ef1523"],
|
||||
["35df11f004a48ba439aba878fe9df20cc935b4a761c262b1b707e6f2b33e2bb7565cd68b130000000000ffffffffb2a2f99abf64163bb57ca900500b863f40c02632dfd9ea2590854c5fb4811da90200000006ac006363636affffffffaf9d89b2a8d2670ca37c8f7c140600b81259f2e037cb4590578ec6e37af8bf200000000005abac6a655270a4751eb551f058a93301ffeda2e252b6614a1fdd0e283e1d9fe53c96c5bbaafaac57b8030000000153ffffffff020d9f3b02000000000100ed7008030000000004abac000000000000", "abac", 3, 593793071, "88fdee1c2d4aeead71d62396e28dc4d00e5a23498eea66844b9f5d26d1f21042"],
|
||||
["a08ff466049fb7619e25502ec22fedfb229eaa1fe275aa0b5a23154b318441bf547989d0510000000005ab5363636affffffff2b0e335cb5383886751cdbd993dc0720817745a6b1c9b8ab3d15547fc9aafd03000000000965656a536a52656a532b53d10584c290d3ac1ab74ab0a19201a4a039cb59dc58719821c024f6bf2eb26322b33f010000000965ac6aac0053ab6353ffffffff048decba6ebbd2db81e416e39dde1f821ba69329725e702bcdea20c5cc0ecc6402000000086363ab5351ac6551466e377b0468c0fa00000000000651ab53ac6a513461c6010000000008636a636365535100eeb3dc010000000006526a52ac516a43f362010000000005000063536500000000", "0063516a", 1, -1158911348, "f6a1ecb50bd7c2594ebecea5a1aa23c905087553e40486dade793c2f127fdfae"],
|
||||
["5ac2f17d03bc902e2bac2469907ec7d01a62b5729340bc58c343b7145b66e6b97d434b30fa000000000163ffffffff44028aa674192caa0d0b4ebfeb969c284cb16b80c312d096efd80c6c6b094cca000000000763acabac516a52ffffffff10c809106e04b10f9b43085855521270fb48ab579266e7474657c6c625062d2d030000000351636595a0a97004a1b69603000000000465ab005352ad68010000000008636a5263acac5100da7105010000000002acab90325200000000000000000000", "6a6aab516a63526353", 2, 1518400956, "f7efb74b1dcc49d316b49c632301bc46f98d333c427e55338be60c7ef0d953be"],
|
||||
["aeb2e11902dc3770c218b97f0b1960d6ee70459ecb6a95eff3f05295dc1ef4a0884f10ba460300000005516352526393e9b1b3e6ae834102d699ddd3845a1e159aa7cf7635edb5c02003f7830fee3788b795f20100000009ab006a526553ac006ad8809c570469290e0400000000050000abab00b10fd5040000000008ab655263abac53ab630b180300000000009d9993040000000002516300000000", "5351ababac6a65", 0, 1084852870, "f2286001af0b0170cbdad92693d0a5ebaa8262a4a9d66e002f6d79a8c94026d1"],
|
||||
["9860ca9a0294ff4812534def8c3a3e3db35b817e1a2ddb7f0bf673f70eab71bb79e90a2f3100000000086a636551acac5165ffffffffed4d6d3cd9ff9b2d490e0c089739121161a1445844c3e204296816ab06e0a83702000000035100ac88d0db5201c3b59a050000000005ac6a0051ab00000000", "535263ab006a526aab", 1, -962088116, "30df2473e1403e2b8e637e576825f785528d998af127d501556e5f7f5ed89a2a"],
|
||||
["4ddaa680026ec4d8060640304b86823f1ac760c260cef81d85bd847952863d629a3002b54b0200000008526365636a656aab65457861fc6c24bdc760c8b2e906b6656edaf9ed22b5f50e1fb29ec076ceadd9e8ebcb6b000000000152ffffffff033ff04f00000000000551526a00657a1d900300000000002153af040000000003006a6300000000", "ab526a53acabab", 0, 1055317633, "7f21b62267ed52462e371a917eb3542569a4049b9dfca2de3c75872b39510b26"],
|
||||
["01e76dcd02ad54cbc8c71d68eaf3fa7c883b65d74217b30ba81f1f5144ef80b706c0dc82ca000000000352ab6a078ec18bcd0514825feced2e8b8ea1ccb34429fae41c70cc0b73a2799e85603613c6870002000000086363ab6365536a53ffffffff043acea90000000000016ad20e1803000000000100fa00830200000000056352515351e864ee00000000000865535253ab6a6551d0c46672", "6a6365abacab", 0, -1420559003, "8af0b4cbdbc011be848edf4dbd2cde96f0578d662cfebc42252495387114224a"],
|
||||
["fa00b26402670b97906203434aa967ce1559d9bd097d56dbe760469e6032e7ab61accb54160100000006635163630052fffffffffe0d3f4f0f808fd9cfb162e9f0c004601acf725cd7ea5683bbdc9a9a433ef15a0200000005ab52536563d09c7bef049040f305000000000153a7c7b9020000000004ac63ab52847a2503000000000553ab00655390ed80010000000005006553ab52860671d4", "536565ab52", 0, 799022412, "40ed8e7bbbd893e15f3cce210ae02c97669818de5946ca37eefc7541116e2c78"],
|
||||
["cb5c06dc01b022ee6105ba410f0eb12b9ce5b5aa185b28532492d839a10cef33d06134b91b010000000153ffffffff02cec0530400000000005e1e4504000000000865656551acacac6a00000000", "ab53", 0, -1514251329, "136beb95459fe6b126cd6cefd54eb5d971524b0e883e41a292a78f78015cb8d5"],
|
||||
["f10a0356031cd569d652dbca8e7a4d36c8da33cdff428d003338602b7764fe2c96c505175b010000000465ac516affffffffbb54563c71136fa944ee20452d78dc87073ac2365ba07e638dce29a5d179da600000000003635152ffffffff9a411d8e2d421b1e6085540ee2809901e590940bbb41532fa38bd7a16b68cc350100000007535251635365636195df1603b61c45010000000002ab65bf6a310400000000026352fcbba10200000000016aa30b7ff0", "5351", 0, 1552495929, "9eb8adf2caecb4bf9ac59d7f46bd20e83258472db2f569ee91aba4cf5ee78e29"],
|
||||
["c3325c9b012f659466626ca8f3c61dfd36f34670abc054476b7516a1839ec43cd0870aa0c0000000000753525265005351e7e3f04b0112650500000000000363ac6300000000", "acac", 0, -68961433, "5ca70e727d91b1a42b78488af2ed551642c32d3de4712a51679f60f1456a8647"],
|
||||
["2333e54c044370a8af16b9750ac949b151522ea6029bacc9a34261599549581c7b4e5ece470000000007510052006563abffffffff80630fc0155c750ce20d0ca4a3d0c8e8d83b014a5b40f0b0be0dd4c63ac28126020000000465000000ffffffff1b5f1433d38cdc494093bb1d62d84b10abbdae57e3d04e82e600857ab3b1dc990300000003515100b76564be13e4890a908ea7508afdad92ec1b200a9a67939fadce6eb7a29eb4550a0a28cb0300000001acffffffff02926c930300000000016373800201000000000153d27ee740", "ab6365ab516a53", 3, 598653797, "2be27a686eb7940dd32c44ff3a97c1b28feb7ab9c5c0b1593b2d762361cfc2db"],
|
||||
["b500ca48011ec57c2e5252e5da6432089130603245ffbafb0e4c5ffe6090feb629207eeb0e010000000652ab6a636aab8302c9d2042b44f40500000000015278c05a050000000004ac5251524be080020000000007636aac63ac5252c93a9a04000000000965ab6553636aab5352d91f9ddb", "52005100", 0, -2024394677, "49c8a6940a461cc7225637f1e512cdd174c99f96ec05935a59637ededc77124c"],
|
||||
["f52ff64b02ee91adb01f3936cc42e41e1672778962b68cf013293d649536b519bc3271dd2c00000000020065afee11313784849a7c15f44a61cd5fd51ccfcdae707e5896d131b082dc9322a19e12858501000000036aac654e8ca882022deb7c020000000006006a515352abd3defc0000000000016300000000", "63520063", 0, 1130989496, "7f208df9a5507e98c62cebc5c1e2445eb632e95527594929b9577b53363e96f6"],
|
||||
["ab7d6f36027a7adc36a5cf7528fe4fb5d94b2c96803a4b38a83a675d7806dda62b380df86a0000000003000000ffffffff5bc00131e29e22057c04be854794b4877dda42e416a7a24706b802ff9da521b20000000007ac6a0065ac52ac957cf45501b9f06501000000000500ac6363ab25f1110b", "00526500536a635253", 0, 911316637, "5fa09d43c8aef6f6fa01c383a69a5a61a609cd06e37dce35a39dc9eae3ddfe6c"],
|
||||
["f940888f023dce6360263c850372eb145b864228fdbbb4c1186174fa83aab890ff38f8c9a90300000000ffffffff01e80ccdb081e7bbae1c776531adcbfb77f2e5a7d0e5d0d0e2e6c8758470e85f00000000020053ffffffff03b49088050000000004656a52ab428bd604000000000951630065ab63ac636a0cbacf0400000000070063ac5265ac53d6e16604", "ac63", 0, 39900215, "713ddeeefcfe04929e7b6593c792a4efbae88d2b5280d1f0835d2214eddcbad6"],
|
||||
["530ecd0b01ec302d97ef6f1b5a6420b9a239714013e20d39aa3789d191ef623fc215aa8b940200000005ac5351ab6a3823ab8202572eaa04000000000752ab6a51526563fd8a270100000000036a006581a798f0", "525153656a0063", 0, 1784562684, "fe42f73a8742676e640698222b1bd6b9c338ff1ccd766d3d88d7d3c6c6ac987e"],
|
||||
["5d781d9303acfcce964f50865ddfddab527ea971aee91234c88e184979985c00b4de15204b0100000003ab6352a009c8ab01f93c8ef2447386c434b4498538f061845862c3f9d5751ad0fce52af442b3a902000000045165ababb909c66b5a3e7c81b3c45396b944be13b8aacfc0204f3f3c105a66fa8fa6402f1b5efddb01000000096a65ac636aacab656ac3c677c402b79fa4050000000004006aab5133e35802000000000751ab635163ab0078c2e025", "6aac51636a6a005265", 0, -882306874, "551ce975d58647f10adefb3e529d9bf9cda34751627ec45e690f135ef0034b95"],
|
||||
["25ee54ef0187387564bb86e0af96baec54289ca8d15e81a507a2ed6668dc92683111dfb7a50100000004005263634cecf17d0429aa4d000000000007636a6aabab5263daa75601000000000251ab4df70a01000000000151980a890400000000065253ac6a006377fd24e3", "65ab", 0, 797877378, "069f38fd5d47abff46f04ee3ae27db03275e9aa4737fa0d2f5394779f9654845"],
|
||||
["a9c57b1a018551bcbc781b256642532bbc09967f1cbe30a227d352a19365d219d3f11649a3030000000451655352b140942203182894030000000006ab00ac6aab654add350400000000003d379505000000000553abacac00e1739d36", "5363", 0, -1069721025, "6da32416deb45a0d720a1dbe6d357886eabc44029dd5db74d50feaffbe763245"],
|
||||
["05c4fb94040f5119dc0b10aa9df054871ed23c98c890f1e931a98ffb0683dac45e98619fdc0200000007acab6a525263513e7495651c9794c4d60da835d303eb4ee6e871f8292f6ad0b32e85ef08c9dc7aa4e03c9c010000000500ab52acacfffffffffee953259cf14ced323fe8d567e4c57ba331021a1ef5ac2fa90f7789340d7c550100000007ac6aacac6a6a53ffffffff08d9dc820d00f18998af247319f9de5c0bbd52a475ea587f16101af3afab7c210100000003535363569bca7c0468e34f00000000000863536353ac51ac6584e319010000000006650052ab6a533debea030000000003ac0053ee7070020000000006ac52005253ac00000000", "6351005253", 2, 1386916157, "76c4013c40bfa1481badd9d342b6d4b8118de5ab497995fafbf73144469e5ff0"],
|
||||
["c95ab19104b63986d7303f4363ca8f5d2fa87c21e3c5d462b99f1ebcb7c402fc012f5034780000000009006aac63ac65655265ffffffffbe91afa68af40a8700fd579c86d4b706c24e47f7379dad6133de389f815ef7f501000000046aac00abffffffff1520db0d81be4c631878494668d258369f30b8f2b7a71e257764e9a27f24b48701000000076a515100535300b0a989e1164db9499845bac01d07a3a7d6d2c2a76e4c04abe68f808b6e2ef5068ce6540e0100000009ac53636a63ab65656affffffff0309aac6050000000005ab6563656a6067e8020000000003ac536aec91c8030000000009655251ab65ac6a53acc7a45bc5", "63526a65abac", 1, 512079270, "fb7eca81d816354b6aedec8cafc721d5b107336657acafd0d246049556f9e04b"],
|
||||
["ca66ae10049533c2b39f1449791bd6d3f039efe0a121ab7339d39ef05d6dcb200ec3fb2b3b020000000465006a53ffffffff534b8f97f15cc7fb4f4cea9bf798472dc93135cd5b809e4ca7fe4617a61895980100000000ddd83c1dc96f640929dd5e6f1151dab1aa669128591f153310d3993e562cc7725b6ae3d903000000046a52536582f8ccddb8086d8550f09128029e1782c3f2624419abdeaf74ecb24889cc45ac1a64492a0100000002516a4867b41502ee6ccf03000000000752acacab52ab6a4b7ba80000000000075151ab0052536300000000", "6553", 2, -62969257, "8085e904164ab9a8c20f58f0d387f6adb3df85532e11662c03b53c3df8c943cb"],
|
||||
["ba646d0b0453999f0c70cb0430d4cab0e2120457bb9128ed002b6e9500e9c7f8d7baa20abe0200000001652a4e42935b21db02b56bf6f08ef4be5adb13c38bc6a0c3187ed7f6197607ba6a2c47bc8a03000000040052516affffffffa55c3cbfc19b1667594ac8681ba5d159514b623d08ed4697f56ce8fcd9ca5b0b00000000096a6a5263ac655263ab66728c2720fdeabdfdf8d9fb2bfe88b295d3b87590e26a1e456bad5991964165f888c03a0200000006630051ac00acffffffff0176fafe0100000000070063acac65515200000000", "63", 1, 2002322280, "9db4e320208185ee70edb4764ee195deca00ba46412d5527d9700c1cf1c3d057"],
|
||||
["2ddb8f84039f983b45f64a7a79b74ff939e3b598b38f436def7edd57282d0803c7ef34968d02000000026a537eb00c4187de96e6e397c05f11915270bcc383959877868ba93bac417d9f6ed9f627a7930300000004516551abffffffffacc12f1bb67be3ae9f1d43e55fda8b885340a0df1175392a8bbd9f959ad3605003000000025163ffffffff02ff0f4700000000000070bd99040000000003ac53abf8440b42", "", 2, -393923011, "0133f1a161363b71dfb3a90065c7128c56bd0028b558b610142df79e055ab5c7"],
|
||||
["b21fc15403b4bdaa994204444b59323a7b8714dd471bd7f975a4e4b7b48787e720cbd1f5f00000000000ffffffff311533001cb85c98c1d58de0a5fbf27684a69af850d52e22197b0dc941bc6ca9030000000765ab6363ab5351a8ae2c2c7141ece9a4ff75c43b7ea9d94ec79b7e28f63e015ac584d984a526a73fe1e04e0100000007526352536a5365ffffffff02a0a9ea030000000002ab52cfc4f300000000000465525253e8e0f342", "000000", 1, 1305253970, "d1df1f4bba2484cff8a816012bb6ec91c693e8ca69fe85255e0031711081c46a"],
|
||||
["d1704d6601acf710b19fa753e307cfcee2735eada0d982b5df768573df690f460281aad12d0000000007656300005100acffffffff0232205505000000000351ab632ca1bc0300000000016300000000", "ac65ab65ab51", 0, 165179664, "40b4f03c68288bdc996011b0f0ddb4b48dc3be6762db7388bdc826113266cd6c"],
|
||||
["d2f6c096025cc909952c2400bd83ac3d532bfa8a1f8f3e73c69b1fd7b8913379793f3ce92202000000076a00ab6a53516ade5332d81d58b22ed47b2a249ab3a2cb3a6ce9a6b5a6810e18e3e1283c1a1b3bd73e3ab00300000002acabffffffff01a9b2d40500000000056352abab00dc4b7f69", "ab0065", 0, -78019184, "2ef025e907f0fa454a2b48a4f3b81346ba2b252769b5c35d742d0c8985e0bf5e"],
|
||||
["3e6db1a1019444dba461247224ad5933c997256d15c5d37ade3d700506a0ba0a57824930d7010000000852ab6500ab00ac00ffffffff03389242020000000001aba8465a0200000000086a6a636a5100ab52394e6003000000000953ac51526351000053d21d9800", "abababacab53ab65", 0, 1643661850, "1f8a3aca573a609f4aea0c69522a82fcb4e15835449da24a05886ddc601f4f6a"],
|
||||
["f821a042036ad43634d29913b77c0fc87b4af593ac86e9a816a9d83fd18dfcfc84e1e1d57102000000076a63ac52006351ffffffffbcdaf490fc75086109e2f832c8985716b3a624a422cf9412fe6227c10585d21203000000095252abab5352ac526affffffff2efed01a4b73ad46c7f7bc7fa3bc480f8e32d741252f389eaca889a2e9d2007e000000000353ac53ffffffff032ac8b3020000000009636300000063516300d3d9f2040000000006510065ac656aafa5de0000000000066352ab5300ac9042b57d", "525365", 1, 667065611, "0d17a92c8d5041ba09b506ddf9fd48993be389d000aad54f9cc2a44fcc70426b"],
|
||||
["58e3f0f704a186ef55d3919061459910df5406a9121f375e7502f3be872a449c3f2bb058380100000000f0e858da3ac57b6c973f889ad879ffb2bd645e91b774006dfa366c74e2794aafc8bbc871010000000751ac65516a515131a68f120fd88ca08687ceb4800e1e3fbfea7533d34c84fef70cc5a96b648d580369526d000000000600ac00515363f6191d5b3e460fa541a30a6e83345dedfa3ed31ad8574d46d7bbecd3c9074e6ba5287c24020000000151e3e19d6604162602010000000004005100ac71e17101000000000065b5e90300000000040053ab53f6b7d101000000000200ac00000000", "6563ab", 1, -669018604, "8221d5dfb75fc301a80e919e158e0b1d1e86ffb08870a326c89408d9bc17346b"],
|
||||
["efec1cce044a676c1a3d973f810edb5a9706eb4cf888a240f2b5fb08636bd2db482327cf500000000005ab51656a52ffffffff46ef019d7c03d9456e5134eb0a7b5408d274bd8e33e83df44fab94101f7c5b650200000009ac5100006353630051407aadf6f5aaffbd318fdbbc9cae4bd883e67d524df06bb006ce2f7c7e2725744afb76960100000005536aab53acec0d64eae09e2fa1a7c4960354230d51146cf6dc45ee8a51f489e20508a785cbe6ca86fc000000000651536a516300ffffffff014ef598020000000006636aac655265a6ae1b75", "53516a5363526563ab", 2, -1823982010, "13e8b5ab4e5b2ceeff0045c625e19898bda2d39fd7af682e2d1521303cfe1154"],
|
||||
["3c436c2501442a5b700cbc0622ee5143b34b1b8021ea7bbc29e4154ab1f5bdfb3dff9d640501000000086aab5251ac5252acffffffff0170b9a20300000000066aab6351525114b13791", "63acabab52ab51ac65", 0, -2140612788, "87ddf1f9acb6640448e955bd1968f738b4b3e073983af7b83394ab7557f5cd61"],
|
||||
["d62f183e037e0d52dcf73f9b31f70554bce4f693d36d17552d0e217041e01f15ad3840c838000000000963acac6a6a6a63ab63ffffffffabdfb395b6b4e63e02a763830f536fc09a35ff8a0cf604021c3c751fe4c88f4d0300000006ab63ab65ac53aa4d30de95a2327bccf9039fb1ad976f84e0b4a0936d82e67eafebc108993f1e57d8ae39000000000165ffffffff04364ad30500000000036a005179fd84010000000007ab636aac6363519b9023030000000008510065006563ac6acd2a4a02000000000000000000", "52", 1, 595020383, "da8405db28726dc4e0f82b61b2bfd82b1baa436b4e59300305cc3b090b157504"],
|
||||
["44c200a5021238de8de7d80e7cce905606001524e21c8d8627e279335554ca886454d692e6000000000500acac52abbb8d1dc876abb1f514e96b21c6e83f429c66accd961860dc3aed5071e153e556e6cf076d02000000056553526a51870a928d0360a580040000000004516a535290e1e302000000000851ab6a00510065acdd7fc5040000000007515363ab65636abb1ec182", "6363", 0, -785766894, "ed53cc766cf7cb8071cec9752460763b504b2183442328c5a9761eb005c69501"],
|
||||
["d682d52d034e9b062544e5f8c60f860c18f029df8b47716cabb6c1b4a4b310a0705e754556020000000400656a0016eeb88eef6924fed207fba7ddd321ff3d84f09902ff958c815a2bf2bb692eb52032c4d803000000076365ac516a520099788831f8c8eb2552389839cfb81a9dc55ecd25367acad4e03cfbb06530f8cccf82802701000000085253655300656a53ffffffff02d543200500000000056a510052ac03978b05000000000700ac51525363acfdc4f784", "", 2, -696035135, "e1a256854099907050cfee7778f2018082e735a1f1a3d91437584850a74c87bb"],
|
||||
["e8c0dec5026575ddf31343c20aeeca8770afb33d4e562aa8ee52eeda6b88806fdfd4fe0a97030000000953acabab65ab516552ffffffffdde122c2c3e9708874286465f8105f43019e837746686f442666629088a970e0010000000153ffffffff01f98eee0100000000025251fe87379a", "63", 1, 633826334, "abe441209165d25bc6d8368f2e7e7dc21019056719fef1ace45542aa2ef282e2"],
|
||||
["b288c331011c17569293c1e6448e33a64205fc9dc6e35bc756a1ac8b97d18e912ea88dc0770200000007635300ac6aacabfc3c890903a3ccf8040000000004656500ac9c65c9040000000009ab6a6aabab65abac63ac5f7702000000000365005200000000", "526a63", 0, 1574937329, "0dd1bd5c25533bf5f268aa316ce40f97452cca2061f0b126a59094ca5b65f7a0"],
|
||||
["fc0a092003cb275fa9a25a72cf85d69c19e4590bfde36c2b91cd2c9c56385f51cc545530210000000004ab530063ffffffff729b006eb6d14d6e5e32b1c376acf1c62830a5d9246da38dbdb4db9f51fd1c74020000000463636500ffffffff0ae695c6d12ab7dcb8d3d4b547b03f178c7268765d1de9af8523d244e3836b12030000000151ffffffff0115c1e20100000000066a6aabac6a6a1ff59aec", "ab0053ac", 0, 931831026, "73fe22099c826c34a74edf45591f5d7b3a888c8178cd08facdfd96a9a681261c"],
|
||||
["0fcae7e004a71a4a7c8f66e9450c0c1785268679f5f1a2ee0fb3e72413d70a9049ecff75de020000000452005251ffffffff99c8363c4b95e7ec13b8c017d7bb6e80f7c04b1187d6072961e1c2479b1dc0320200000000ffffffff7cf03b3d66ab53ed740a70c5c392b84f780fff5472aee82971ac3bfeeb09b2df0200000006ab5265636a0058e4fe9257d7c7c7e82ff187757c6eadc14cceb6664dba2de03a018095fd3006682a5b9600000000056353536a636de26b2303ff76de010000000001acdc0a2e020000000001ab0a53ed020000000007530063ab51510088417307", "ac6aacab5165535253", 2, -902160694, "eea96a48ee572aea33d75d0587ce954fcfb425531a7da39df26ef9a6635201be"],
|
||||
["612701500414271138e30a46b7a5d95c70c78cc45bf8e40491dac23a6a1b65a51af04e6b94020000000451655153ffffffffeb72dc0e49b2fad3075c19e1e6e4b387f1365dca43d510f6a02136318ddecb7f0200000003536352e115ffc4f9bae25ef5baf534a890d18106fb07055c4d7ec9553ba89ed1ac2101724e507303000000080063006563acabac2ff07f69a080cf61a9d19f868239e6a4817c0eeb6a4f33fe254045d8af2bca289a8695de0300000000430736c404d317840500000000086a00abac5351ab65306e0503000000000963ab0051536aabab6a6c8aca01000000000565516351ab5dcf960100000000016a00000000", "ab", 2, -604581431, "5ec805e74ee934aa815ca5f763425785ae390282d46b5f6ea076b6ad6255a842"],
|
||||
["6b68ba00023bb4f446365ea04d68d48539aae66f5b04e31e6b38b594d2723ab82d44512460000000000200acffffffff5dfc6febb484fff69c9eeb7c7eb972e91b6d949295571b8235b1da8955f3137b020000000851ac6352516a535325828c8a03365da801000000000800636aabac6551ab0f594d03000000000963ac536365ac63636a45329e010000000005abac53526a00000000", "005151", 0, 1317038910, "42f5ba6f5fe1e00e652a08c46715871dc4b40d89d9799fd7c0ea758f86eab6a7"],
|
||||
["aff5850c0168a67296cc790c1b04a9ed9ad1ba0469263a9432fcb53676d1bb4e0eea8ea1410100000005ac65526a537d5fcb1d01d9c26d0200000000065265ab5153acc0617ca1", "51ab650063", 0, 1712981774, "8449d5247071325e5f8edcc93cb9666c0fecabb130ce0e5bef050575488477eb"],
|
||||
["e6d6b9d8042c27aec99af8c12b6c1f7a80453e2252c02515e1f391da185df0874e133696b50300000006ac5165650065ffffffff6a4b60a5bfe7af72b198eaa3cde2e02aa5fa36bdf5f24ebce79f6ecb51f3b554000000000652656aababac2ec4c5a6cebf86866b1fcc4c5bd5f4b19785a8eea2cdfe58851febf87feacf6f355324a80100000001537100145149ac1e287cef62f6f5343579189fad849dd33f25c25bfca841cb696f10c5a34503000000046a636a63df9d7c4c018d96e20100000000015100000000", "53ab", 1, -1924777542, "f98f95d0c5ec3ac3e699d81f6c440d2e7843eab15393eb023bc5a62835d6dcea"],
|
||||
["046ac25e030a344116489cc48025659a363da60bc36b3a8784df137a93b9afeab91a04c1ed020000000951ab0000526a65ac51ffffffff6c094a03869fde55b9a8c4942a9906683f0a96e2d3e5a03c73614ea3223b2c29020000000500ab636a6affffffff3da7aa5ecef9071600866267674b54af1740c5aeb88a290c459caa257a2683cb0000000004ab6565ab7e2a1b900301b916030000000005abac63656308f4ed03000000000852ab53ac63ac51ac73d620020000000003ab00008deb1285", "6a", 2, 1299505108, "f79e6b776e2592bad45ca328c54abf14050c241d8f822d982c36ea890fd45757"],
|
||||
["bd515acd0130b0ac47c2d87f8d65953ec7d657af8d96af584fc13323d0c182a2e5f9a96573000000000652ac51acac65ffffffff0467aade000000000003655363dc577d050000000006515252ab5300137f60030000000007535163530065004cdc860500000000036a5265241bf53e", "acab", 0, 621090621, "771d4d87f1591a13d77e51858c16d78f1956712fe09a46ff1abcabbc1e7af711"],
|
||||
["ff1ae37103397245ac0fa1c115b079fa20930757f5b6623db3579cb7663313c2dc4a3ffdb300000000076353656a000053ffffffff83c59e38e5ad91216ee1a312d15b4267bae2dd2e57d1a3fd5c2f0f809eeb5d46010000000800abab6a6a53ab51ffffffff9d5e706c032c1e0ca75915f8c6686f64ec995ebcd2539508b7dd8abc3e4d7d2a01000000006b2bdcda02a8fe070500000000045253000019e31d04000000000700ab63acab526a00000000", "53656aab6a525251", 0, 881938872, "726bb88cdf3af2f7603a31f33d2612562306d08972a4412a55dbbc0e3363721c"],
|
||||
["ff5400dd02fec5beb9a396e1cbedc82bedae09ed44bae60ba9bef2ff375a6858212478844b03000000025253ffffffff01e46c203577a79d1172db715e9cc6316b9cfc59b5e5e4d9199fef201c6f9f0f000000000900ab6552656a5165acffffffff02e8ce62040000000002515312ce3e00000000000251513f119316", "", 0, 1541581667, "1e0da47eedbbb381b0e0debbb76e128d042e02e65b11125e17fd127305fc65cd"],
|
||||
["28e3daa603c03626ad91ffd0ff927a126e28d29db5012588b829a06a652ea4a8a5732407030200000004ab6552acffffffff8e643146d3d0568fc2ad854fd7864d43f6f16b84e395db82b739f6f5c84d97b40000000004515165526b01c2dc1469db0198bd884e95d8f29056c48d7e74ff9fd37a9dec53e44b8769a6c99c030200000009ab006a516a53630065eea8738901002398000000000007ac5363516a51abeaef12f5", "52ab52515253ab", 2, 1687390463, "55591346aec652980885a558cc5fc2e3f8d21cbd09f314a798e5a7ead5113ea6"],
|
||||
["b54bf5ac043b62e97817abb892892269231b9b220ba08bc8dbc570937cd1ea7cdc13d9676c010000000451ab5365a10adb7b35189e1e8c00b86250f769319668189b7993d6bdac012800f1749150415b2deb0200000003655300ffffffff60b9f4fb9a7e17069fd00416d421f804e2ef2f2c67de4ca04e0241b9f9c1cc5d0200000003ab6aacfffffffff048168461cce1d40601b42fbc5c4f904ace0d35654b7cc1937ccf53fe78505a0100000008526563525265abacffffffff01dbf4e6040000000007acac656553636500000000", "63", 2, 882302077, "f5b38b0f06e246e47ce622e5ee27d5512c509f8ac0e39651b3389815eff2ab93"],
|
||||
["ebf628b30360bab3fa4f47ce9e0dcbe9ceaf6675350e638baff0c2c197b2419f8e4fb17e16000000000452516365ac4d909a79be207c6e5fb44fbe348acc42fc7fe7ef1d0baa0e4771a3c4a6efdd7e2c118b0100000003acacacffffffffa6166e9101f03975721a3067f1636cc390d72617be72e5c3c4f73057004ee0ee010000000863636a6a516a5252c1b1e82102d8d54500000000000153324c900400000000015308384913", "0063516a51", 1, -1658428367, "eb2d8dea38e9175d4d33df41f4087c6fea038a71572e3bad1ea166353bf22184"],
|
||||
["d6a8500303f1507b1221a91adb6462fb62d741b3052e5e7684ea7cd061a5fc0b0e93549fa50100000004acab65acfffffffffdec79bf7e139c428c7cfd4b35435ae94336367c7b5e1f8e9826fcb0ebaaaea30300000000ffffffffd115fdc00713d52c35ea92805414bd57d1e59d0e6d3b79a77ee18a3228278ada020000000453005151ffffffff040231510300000000085100ac6a6a000063c6041c0400000000080000536a6563acac138a0b04000000000263abd25fbe03000000000900656a00656aac510000000000", "ac526aac6a00", 1, -2007972591, "13d12a51598b34851e7066cd93ab8c5212d60c6ed2dae09d91672c10ccd7f87c"],
|
||||
["658cb1c1049564e728291a56fa79987a4ed3146775fce078bd2e875d1a5ca83baf6166a82302000000056a656351ab2170e7d0826cbdb45fda0457ca7689745fd70541e2137bb4f52e7b432dcfe2112807bd720300000007006a0052536351ffffffff8715ca2977696abf86d433d5c920ef26974f50e9f4a20c584fecbb68e530af5101000000009e49d864155bf1d3c757186d29f3388fd89c7f55cc4d9158b4cf74ca27a35a1dd93f945502000000096a535353ac656351510d29fa870230b809040000000006ab6a6a526a633b41da050000000004ab6a6a65ed63bf62", "52acabac", 2, -1774073281, "53ab197fa7e27b8a3f99ff48305e67081eb90e95d89d7e92d80cee25a03a6689"],
|
||||
["e92492cc01aec4e62df67ea3bc645e2e3f603645b3c5b353e4ae967b562d23d6e043badecd0100000003acab65ffffffff02c7e5ea040000000002ab52e1e584010000000005536365515195d16047", "6551", 0, -424930556, "93c34627f526d73f4bea044392d1a99776b4409f7d3d835f23b03c358f5a61c2"],
|
||||
["02e242db04be2d8ced9179957e98cee395d4767966f71448dd084426844cbc6d15f2182e85030000000200650c8ffce3db9de9c3f9cdb9104c7cb26647a7531ad1ebf7591c259a9c9985503be50f8de30000000007ac6a51636a6353ffffffffa2e33e7ff06fd6469987ddf8a626853dbf30c01719efb259ae768f051f803cd30300000000fffffffffd69d8aead941683ca0b1ee235d09eade960e0b1df3cd99f850afc0af1b73e070300000001ab60bb602a011659670100000000076363526300acac00000000", "6353ab515251", 3, 1451100552, "bbc9069b8615f3a52ac8a77359098dcc6c1ba88c8372d5d5fe080b99eb781e55"],
|
||||
["b28d5f5e015a7f24d5f9e7b04a83cd07277d452e898f78b50aae45393dfb87f94a26ef57720200000008ababac630053ac52ffffffff046475ed040000000008ab5100526363ac65c9834a04000000000251abae26b30100000000040000ac65ceefb900000000000000000000", "ac6551ac6a536553", 0, -1756558188, "5848d93491044d7f21884eef7a244fe7d38886f8ae60df49ce0dfb2a342cd51a"],
|
||||
["efb8b09801f647553b91922a5874f8e4bb2ed8ddb3536ed2d2ed0698fac5e0e3a298012391030000000952ac005263ac52006affffffff04cdfa0f050000000007ac53ab51abac65b68d1b02000000000553ab65ac00d057d50000000000016a9e1fda010000000007ac63ac536552ac00000000", "6aac", 0, 1947322973, "603a9b61cd30fcea43ef0a5c18b88ca372690b971b379ee9e01909c336280511"],
|
||||
["68a59fb901c21946797e7d07a4a3ea86978ce43df0479860d7116ac514ba955460bae78fff0000000001abffffffff03979be80100000000036553639300bc040000000008006552006a656565cfa78d0000000000076552acab63ab5100000000", "ab65ab", 0, 995583673, "3b320dd47f2702452a49a1288bdc74a19a4b849b132b6cad9a1d945d87dfbb23"],
|
||||
["67761f2a014a16f3940dcb14a22ba5dc057fcffdcd2cf6150b01d516be00ef55ef7eb07a830100000004636a6a51ffffffff01af67bd050000000008526553526300510000000000", "6a00", 0, 1570943676, "079fa62e9d9d7654da8b74b065da3154f3e63c315f25751b4d896733a1d67807"],
|
||||
["e20fe96302496eb436eee98cd5a32e1c49f2a379ceb71ada8a48c5382df7c8cd88bdc47ced03000000016556aa0e180660925a841b457aed0aae47fca2a92fa1d7afeda647abf67198a3902a7c80dd00000000085152ac636a535265bd18335e01803c810100000000046500ac52f371025e", "6363ab", 1, -651254218, "2921a0e5e3ba83c57ba57c25569380c17986bf34c366ec216d4188d5ba8b0b47"],
|
||||
["4e1bd9fa011fe7aa14eee8e78f27c9fde5127f99f53d86bc67bdab23ca8901054ee8a8b6eb0300000009ac535153006a6a0063ffffffff044233670500000000000a667205000000000652ab636a51abe5bf35030000000003535351d579e505000000000700630065ab51ac3419ac30", "52abac52", 0, -1807563680, "4aae6648f856994bed252d319932d78db55da50d32b9008216d5366b44bfdf8a"],
|
||||
["ec02fbee03120d02fde12574649660c441b40d330439183430c6feb404064d4f507e704f3c0100000000ffffffffe108d99c7a4e5f75cc35c05debb615d52fac6e3240a6964a29c1704d98017fb60200000002ab63fffffffff726ec890038977adfc9dadbeaf5e486d5fcb65dc23acff0dd90b61b8e2773410000000002ac65e9dace55010f881b010000000005ac00ab650000000000", "51ac525152ac6552", 2, -1564046020, "3f988922d8cd11c7adff1a83ce9499019e5ab5f424752d8d361cf1762e04269b"],
|
||||
["23dbdcc1039c99bf11938d8e3ccec53b60c6c1d10c8eb6c31197d62c6c4e2af17f52115c3a0300000008636352000063ababffffffff17823880e1df93e63ad98c29bfac12e36efd60254346cac9d3f8ada020afc0620300000003ab63631c26f002ac66e86cd22a25e3ed3cb39d982f47c5118f03253054842daadc88a6c41a2e1500000000096a00ab636a53635163195314de015570fd0100000000096a5263acab5200005300000000", "ababac6a6553", 1, 11586329, "bd36a50e0e0a4ecbf2709e68daef41eddc1c0c9769efaee57910e99c0a1d1343"],
|
||||
["33b03bf00222c7ca35c2f8870bbdef2a543b70677e413ce50494ac9b22ea673287b6aa55c50000000005ab00006a52ee4d97b527eb0b427e4514ea4a76c81e68c34900a23838d3e57d0edb5410e62eeb8c92b6000000000553ac6aacac42e59e170326245c000000000009656553536aab516aabb1a10603000000000852ab52ab6a516500cc89c802000000000763ac6a63ac516300000000", "", 0, 557416556, "41bead1b073e1e9fee065dd612a617ca0689e8f9d3fed9d0acfa97398ebb404c"],
|
||||
["813eda1103ac8159850b4524ef65e4644e0fc30efe57a5db0c0365a30446d518d9b9aa8fdd0000000003656565c2f1e89448b374b8f12055557927d5b33339c52228f7108228149920e0b77ef0bcd69da60000000006abac00ab63ab82cdb7978d28630c5e1dc630f332c4245581f787936f0b1e84d38d33892141974c75b4750300000004ac53ab65ffffffff0137edfb02000000000000000000", "0063", 1, -1948560575, "71dfcd2eb7f2e6473aed47b16a6d5fcbd0af22813d892e9765023151e07771ec"],
|
||||
["9e45d9aa0248c16dbd7f435e8c54ae1ad086de50c7b25795a704f3d8e45e1886386c653fbf01000000025352fb4a1acefdd27747b60d1fb79b96d14fb88770c75e0da941b7803a513e6d4c908c6445c7010000000163ffffffff014069a8010000000001520a794fb3", "51ac005363", 1, -719113284, "0d31a221c69bd322ef7193dd7359ddfefec9e0a1521d4a8740326d46e44a5d6a"],
|
||||
["36e42018044652286b19a90e5dd4f8d9f361d0760d080c5c5add1970296ff0f1de630233c8010000000200ac39260c7606017d2246ee14ddb7611586178067e6a4be38e788e33f39a3a95a55a13a6775010000000352ac638bea784f7c2354ed02ea0b93f0240cdfb91796fa77649beee6f7027caa70778b091deee700000000066a65ac656363ffffffff4d9d77ab676d711267ef65363f2d192e1bd55d3cd37f2280a34c72e8b4c559d700000000056a006aab00001764e1020d30220100000000085252516aacab0053472097040000000009635353ab6a636a5100a56407a1", "006a536551ab53ab", 0, 827296034, "daec2af5622bbe220c762da77bab14dc75e7d28aa1ade9b7f100798f7f0fd97a"],
|
||||
["5e06159a02762b5f3a5edcdfc91fd88c3bff08b202e69eb5ba74743e9f4291c4059ab008200000000001ac348f5446bb069ef977f89dbe925795d59fb5d98562679bafd61f5f5f3150c3559582992d0000000008ab5165515353abac762fc67703847ec6010000000000e200cf040000000002abaca64b86010000000008520000515363acabb82b491b", "ab53525352ab6a", 0, -61819505, "75a7db0df41485a28bf6a77a37ca15fa8eccc95b5d6014a731fd8adb9ada0f12"],
|
||||
["a1948872013b543d6d902ccdeead231c585195214ccf5d39f136023855958436a43266911501000000086aac006a6a6a51514951c9b2038a538a04000000000452526563c0f345050000000007526a5252ac526af9be8e03000000000752acac51ab006306198db2", "ab6353", 0, -326384076, "ced7ef84aad4097e1eb96310e0d1c8e512cfcb392a01d9010713459b23bc0cf4"],
|
||||
["c3efabba03cb656f154d1e159aa4a1a4bf9423a50454ebcef07bc3c42a35fb8ad84014864d0000000000d1cc73d260980775650caa272e9103dc6408bdacaddada6b9c67c88ceba6abaa9caa2f7d020000000553536a5265ffffffff9f946e8176d9b11ff854b76efcca0a4c236d29b69fb645ba29d406480427438e01000000066a0065005300ffffffff040419c0010000000003ab6a63cdb5b6010000000009006300ab5352656a63f9fe5e050000000004acac5352611b980100000000086a00acac00006a512d7f0c40", "0053", 0, -59089911, "c503001c16fbff82a99a18d88fe18720af63656fccd8511bca1c3d0d69bd7fc0"],
|
||||
["efb55c2e04b21a0c25e0e29f6586be9ef09f2008389e5257ebf2f5251051cdc6a79fce2dac020000000351006affffffffaba73e5b6e6c62048ba5676d18c33ccbcb59866470bb7911ccafb2238cfd493802000000026563ffffffffe62d7cb8658a6eca8a8babeb0f1f4fa535b62f5fc0ec70eb0111174e72bbec5e0300000009abababac516365526affffffffbf568789e681032d3e3be761642f25e46c20322fa80346c1146cb47ac999cf1b0300000000b3dbd55902528828010000000001ab0aac7b0100000000015300000000", "acac52", 3, 1638140535, "e84444d91580da41c8a7dcf6d32229bb106f1be0c811b2292967ead5a96ce9d4"],
|
||||
["91d3b21903629209b877b3e1aef09cd59aca6a5a0db9b83e6b3472aceec3bc2109e64ab85a0200000003530065ffffffffca5f92de2f1b7d8478b8261eaf32e5656b9eabbc58dcb2345912e9079a33c4cd010000000700ab65ab00536ad530611da41bbd51a389788c46678a265fe85737b8d317a83a8ff7a839debd18892ae5c80300000007ab6aac65ab51008b86c501038b8a9a05000000000263525b3f7a040000000007ab535353ab00abd4e3ff04000000000665ac51ab65630b7b656f", "6551525151516a00", 2, 499657927, "ef4bd7622eb7b2bbbbdc48663c1bc90e01d5bde90ff4cb946596f781eb420a0c"],
|
||||
["5d5c41ad0317aa7e40a513f5141ad5fc6e17d3916eebee4ddb400ddab596175b41a111ead20100000005536a5265acffffffff900ecb5e355c5c9f278c2c6ea15ac1558b041738e4bffe5ae06a9346d66d5b2b00000000080000ab636a65ab6affffffff99f4e08305fa5bd8e38fb9ca18b73f7a33c61ff7b3c68e696b30a04fea87f3ca000000000163d3d1760d019fc13a00000000000000000000", "ab53acabab6aac6a52", 2, 1007461922, "4012f5ff2f1238a0eb84854074670b4703238ebc15bfcdcd47ffa8498105fcd9"],
|
||||
["ceecfa6c02b7e3345445b82226b15b7a097563fa7d15f3b0c979232b138124b62c0be007890200000009abac51536a63525253ffffffffbae481ccb4f15d94db5ec0d8854c24c1cc8642bd0c6300ede98a91ca13a4539a0200000001ac50b0813d023110f5020000000006acabac526563e2b0d0040000000009656aac0063516a536300000000", "0063526500", 0, -1862053821, "e1600e6df8a6160a79ac32aa40bb4644daa88b5f76c0d7d13bf003327223f70c"],
|
||||
["ae62d5fd0380c4083a26642159f51af24bf55dc69008e6b7769442b6a69a603edd980a33000000000005ab5100ab53ffffffff49d048324d899d4b8ed5e739d604f5806a1104fede4cb9f92cc825a7fa7b4bfe0200000005536a000053ffffffff42e5cea5673c650881d0b4005fa4550fd86de5f21509c4564a379a0b7252ac0e0000000007530000526a53525f26a68a03bfacc3010000000000e2496f000000000009ab5253acac52636563b11cc600000000000700510065526a6a00000000", "abab", 1, -1600104856, "05cf0ec9c61f1a15f651a0b3c5c221aa543553ce6c804593f43bb5c50bb91ffb"],
|
||||
["f06f64af04fdcb830464b5efdb3d5ee25869b0744005375481d7b9d7136a0eb8828ad1f0240200000003516563fffffffffd3ba192dabe9c4eb634a1e3079fca4f072ee5ceb4b57deb6ade5527053a92c5000000000165ffffffff39f43401a36ba13a5c6dd7f1190e793933ae32ee3bf3e7bfb967be51e681af760300000009650000536552636a528e34f50b21183952cad945a83d4d56294b55258183e1627d6e8fb3beb8457ec36cadb0630000000005abab530052334a7128014bbfd10100000000085352ab006a63656afc424a7c", "53650051635253ac00", 2, 313255000, "d309da5afd91b7afa257cfd62df3ca9df036b6a9f4b38f5697d1daa1f587312b"],
|
||||
["6dfd2f98046b08e7e2ef5fff153e00545faf7076699012993c7a30cb1a50ec528281a9022f030000000152ffffffff1f535e4851920b968e6c437d84d6ecf586984ebddb7d5db6ae035bd02ba222a8010000000651006a53ab51605072acb3e17939fa0737bc3ee43bc393b4acd58451fc4ffeeedc06df9fc649828822d5010000000253525a4955221715f27788d302382112cf60719be9ae159c51f394519bd5f7e70a4f9816c7020200000009526a6a51636aab656a36d3a5ff0445548e0100000000086a6a00516a52655167030b050000000004ac6a63525cfda8030000000000e158200000000000010000000000", "535263ac6a65515153", 3, 585774166, "72b7da10704c3ca7d1deb60c31b718ee12c70dc9dfb9ae3461edce50789fe2ba"],
|
||||
["187eafed01389a45e75e9dda526d3acbbd41e6414936b3356473d1f9793d161603efdb45670100000002ab00ffffffff04371c8202000000000563630063523b3bde02000000000753516563006300e9e765010000000005516aac656a373f9805000000000665525352acab08d46763", "ab", 0, 122457992, "393aa6c758e0eed15fa4af6d9e2d7c63f49057246dbb92b4268ec24fc87301ca"],
|
||||
["7d50b977035d50411d814d296da9f7965ddc56f3250961ca5ba805cadd0454e7c521e31b0300000000003d0416c2cf115a397bacf615339f0e54f6c35ffec95aa009284d38390bdde1595cc7aa7c0100000005ab52ac5365ffffffff4232c6e796544d5ac848c9dc8d25cfa74e32e847a5fc74c74d8f38ca51188562030000000653ac51006a51ffffffff016bd8bb00000000000465ab5253163526f3", "51ab526a00005353", 1, -1311316785, "60b7544319b42e4159976c35c32c2644f0adf42eff13be1dc2f726fc0b6bb492"],
|
||||
["2a45cd1001bf642a2315d4a427eddcc1e2b0209b1c6abd2db81a800c5f1af32812de42032702000000050051525200ffffffff032177db050000000005530051abac49186f000000000004ab6aab00645c0000000000000765655263acabac00000000", "6a65", 0, -1774715722, "6a9ac3f7da4c7735fbc91f728b52ecbd602233208f96ac5592656074a5db118a"],
|
||||
["479358c202427f3c8d19e2ea3def6d6d3ef2281b4a93cd76214f0c7d8f040aa042fe19f71f0300000001abffffffffa2709be556cf6ecaa5ef530df9e4d056d0ed57ce96de55a5b1f369fa40d4e74a020000000700006a51635365c426be3f02af578505000000000363ab63fd8f590500000000065153abac53632dfb14b3", "520063ab51", 1, -763226778, "cfe147982afacde044ce66008cbc5b1e9f0fd9b8ed52b59fc7c0fecf95a39b0e"],
|
||||
["76179a8e03bec40747ad65ab0f8a21bc0d125b5c3c17ad5565556d5cb03ade7c83b4f32d98030000000151ffffffff99b900504e0c02b97a65e24f3ad8435dfa54e3c368f4e654803b756d011d24150200000003ac5353617a04ac61bb6cf697cfa4726657ba35ed0031432da8c0ffb252a190278830f9bd54f0320100000006656551005153c8e8fc8803677c77020000000007ac6553535253ac70f442030000000001535be0f20200000000026300bf46cb3a", "6aab52", 1, -58495673, "35e94b3776a6729d20aa2f3ddeeb06d3aad1c14cc4cde52fd21a4efc212ea16c"],
|
||||
["75ae53c2042f7546223ce5d5f9e00a968ddc68d52e8932ef2013fa40ce4e8c6ed0b6195cde01000000056563ac630079da0452c20697382e3dba6f4fc300da5f52e95a9dca379bb792907db872ba751b8024ee0300000009655151536500005163ffffffffe091b6d43f51ff00eff0ccfbc99b72d3aff208e0f44b44dfa5e1c7322cfc0c5f01000000075200005363ab63ffffffff7e96c3b83443260ac5cfd18258574fbc4225c630d3950df812bf51dceaeb0f9103000000065365655165639a6bf70b01b3e14305000000000563530063ac00000000", "6300ab00ac", 2, 982422189, "ee4ea49d2aae0dbba05f0b9785172da54408eb1ec67d36759ff7ed25bfc28766"],
|
||||
["1cdfa01e01e1b8078e9c2b0ca5082249bd18fdb8b629ead659adedf9a0dd5a04031871ba120200000008525351536565ab6affffffff011e28430200000000076a5363636aac52b2febd4a", "abacac63656300", 0, 387396350, "299dcaac2bdaa627eba0dfd74767ee6c6f27c9200b49da8ff6270b1041669e7e"],
|
||||
["cc28c1810113dfa6f0fcd9c7d9c9a30fb6f1d774356abeb527a8651f24f4e6b25cf763c4e00300000003ab636affffffff02dfc6050000000000080053636351ab0052afd56903000000000453ab5265f6c90d99", "006551abacacac", 0, 1299280838, "a4c0773204ab418a939e23f493bd4b3e817375d133d307609e9782f2cc38dbcf"],
|
||||
["ca816e7802cd43d66b9374cd9bf99a8da09402d69c688d8dcc5283ace8f147e1672b757e020200000005516aabab5240fb06c95c922342279fcd88ba6cd915933e320d7becac03192e0941e0345b79223e89570300000004005151ac353ecb5d0264dfbd010000000005ac6aacababd5d70001000000000752ac53ac6a5151ec257f71", "63ac", 1, 774695685, "cc180c4f797c16a639962e7aec58ec4b209853d842010e4d090895b22e7a7863"],
|
||||
["b42b955303942fedd7dc77bbd9040aa0de858afa100f399d63c7f167b7986d6c2377f66a7403000000066aac00525100ffffffff0577d04b64880425a3174055f94191031ad6b4ca6f34f6da9be7c3411d8b51fc000000000300526a6391e1cf0f22e45ef1c44298523b516b3e1249df153590f592fcb5c5fc432dc66f3b57cb03000000046a6aac65ffffffff0393a6c9000000000004516a65aca674ac0400000000046a525352c82c370000000000030053538e577f89", "", 1, -1237094944, "566953eb806d40a9fb684d46c1bf8c69dea86273424d562bd407b9461c8509af"],
|
||||
["92c9fe210201e781b72554a0ed5e22507fb02434ddbaa69aff6e74ea8bad656071f1923f3f02000000056a63ac6a514470cef985ba83dcb8eee2044807bedbf0d983ae21286421506ae276142359c8c6a34d68020000000863ac63525265006aa796dd0102ca3f9d05000000000800abab52ab535353cd5c83010000000007ac00525252005322ac75ee", "5165", 0, 97879971, "6e6307cef4f3a9b386f751a6f40acebab12a0e7e17171d2989293cbec7fd45c2"],
|
||||
["ccca1d5b01e40fe2c6b3ee24c660252134601dab785b8f55bd6201ffaf2fddc7b3e2192325030000000365535100496d4703b4b66603000000000665535253ac633013240000000000015212d2a502000000000951abac636353636a5337b82426", "0052", 0, -1691630172, "577bf2b3520b40aef44899a20d37833f1cded6b167e4d648fc5abe203e43b649"],
|
||||
["bc1a7a3c01691e2d0c4266136f12e391422f93655c71831d90935fbda7e840e50770c61da20000000008635253abac516353ffffffff031f32aa020000000003636563786dbc0200000000003e950f00000000000563516a655184b8a1de", "51536a", 0, -1627072905, "730bc25699b46703d7718fd5f5c34c4b5f00f594a9968ddc247fa7d5175124ed"],
|
||||
["076d209e02d904a6c40713c7225d23e7c25d4133c3c3477828f98c7d6dbd68744023dbb66b030000000753ab00536565acffffffff10975f1b8db8861ca94c8cc7c7cff086ddcd83e10b5fffd4fc8f2bdb03f9463c0100000000ffffffff029dff76010000000006526365530051a3be6004000000000000000000", "515253ac65acacac", 1, -1207502445, "66c488603b2bc53f0d22994a1f0f66fb2958203102eba30fe1d37b27a55de7a5"],
|
||||
["690fd1f80476db1f9eebe91317f2f130a60cbc1f4feadd9d6474d438e9cb7f91e4994600af0300000004ab536a63a15ce9fa6622d0c4171d895b42bff884dc6e8a7452f827fdc68a29c3c88e6fdee364eaf50000000002ab52ffffffff022dc39d3c0956b24d7f410b1e387859e7a72955f45d6ffb1e884d77888d18fe0300000005ac6a63656afffffffff10b06bce1800f5c49153d24748fdefb0bf514c12863247d1042d56018c3e25c03000000086a63ac6365536a52ffffffff031f162f0500000000060000655265abffbcd40500000000045151ac001a9c8c05000000000652ac53656a6300000000", "ac51ab63acac", 0, -67986012, "051c0df7ac688c2c930808dabde1f50300aea115f2bb3334f4753d5169b51e46"],
|
||||
["49ac2af00216c0307a29e83aa5de19770e6b20845de329290bd69cf0e0db7aed61ae41b39002000000035163ac8b2558ef84635bfc59635150e90b61fc753d34acfd10d97531043053e229cd720133cd95000000000463516a51ffffffff02458471040000000008abab636a51ac0065545aa80000000000096a6553516a5263ac6a00000000", "51526300ab5363", 1, 1449668540, "ddfd902bba312a06197810da96a0ddccb595f96670b28ded7dba88d8cd0469b8"],
|
||||
["fa4d868b024b010bd5dce46576c2fb489aa60bb797dac3c72a4836f49812c5c564c258414f03000000007a9b3a585e05027bdd89edbadf3c85ac61f8c3a04c773fa746517ae600ff1a9d6b6c02fb0200000004515163abffffffff01b17d020500000000046a65520000000000", "536565ab65635363", 0, -1718953372, "96c2b32f0a00a5925db7ba72d0b5d39922f30ea0f7443b22bc1b734808513c47"],
|
||||
["cac6382d0462375e83b67c7a86c922b569a7473bfced67f17afd96c3cd2d896cf113febf9e0300000003006a53ffffffffaa4913b7eae6821487dd3ca43a514e94dcbbf350f8cc4cafff9c1a88720711b800000000096a6a525300acac6353ffffffff184fc4109c34ea27014cc2c1536ef7ed1821951797a7141ddacdd6e429fae6ff01000000055251655200ffffffff9e7b79b4e6836e290d7b489ead931cba65d1030ccc06f20bd4ca46a40195b33c030000000008f6bc8304a09a2704000000000563655353511dbc73050000000000cf34c500000000000091f76e0000000000085200ab00005100abd07208cb", "0063656a", 2, -1488731031, "bf078519fa87b79f40abc38f1831731422722c59f88d86775535f209cb41b9b1"],
|
||||
["1711146502c1a0b82eaa7893976fefe0fb758c3f0e560447cef6e1bde11e42de91a125f71c030000000015bd8c04703b4030496c7461482481f290c623be3e76ad23d57a955807c9e851aaaa20270300000000d04abaf20326dcb7030000000001632225350400000000075263ac00520063dddad9020000000000af23d148", "52520053510063", 0, 1852122830, "e33d5ee08c0f3c130a44d7ce29606450271b676f4a80c52ab9ffab00cecf67f8"],
|
||||
["8d5b124d0231fbfc640c706ddb1d57bb49a18ba8ca0e1101e32c7e6e65a0d4c7971d93ea360100000008acabac0000abac65ffffffff8fe0fd7696597b845c079c3e7b87d4a44110c445a330d70342a5501955e17dd70100000004ab525363ef22e8a90346629f030000000009516a00ac63acac51657bd57b05000000000200acfd4288050000000009acab5352ab00ab636300000000", "53ac526553ab65", 0, 1253152975, "8b57a7c3170c6c02dd14ae1d392ce3d828197b20e9145c89c1cfd5de050e1562"],
|
||||
["38146dc502c7430e92b6708e9e107b61cd38e5e773d9395e5c8ad8986e7e4c03ee1c1e1e760100000000c8962ce2ac1bb3b1285c0b9ba07f4d2e5ce87c738c42ac0548cd8cec1100e6928cd6b0b6010000000763ab636aab52527cccefbd04e5f6f8020000000006006aabacac65ab2c4a00000000000351635209a6f40100000000026aacce57dc040000000008ab5353ab516a516a00000000", "ab", 0, -1205978252, "3cb5b030e7da0b60ccce5b4a7f3793e6ca56f03e3799fe2d6c3cc22d6d841dcb"],
|
||||
["22d81c740469695a6a83a9a4824f77ecff8804d020df23713990afce2b72591ed7de98500502000000065352526a6a6affffffff90dc85e118379b1005d7bbc7d2b8b0bab104dad7eaa49ff5bead892f17d8c3ba010000000665656300ab51ffffffff965193879e1d5628b52005d8560a35a2ba57a7f19201a4045b7cbab85133311d0200000003ac005348af21a13f9b4e0ad90ed20bf84e4740c8a9d7129632590349afc03799414b76fd6e826200000000025353ffffffff04a0d40d04000000000060702700000000000652655151516ad31f1502000000000365ac0069a1ac0500000000095100655300ab53525100000000", "51636a52ac", 0, -1644680765, "add7f5da27262f13da6a1e2cc2feafdc809bd66a67fb8ae2a6f5e6be95373b6f"],
|
||||
["a27dcbc801e3475174a183586082e0914c314bc9d79d1570f29b54591e5e0dff07fbb45a7f0000000004ac53ab51ffffffff027347f5020000000005535351ab63d0e5c9030000000009ac65ab6a63515200ab7cd632ed", "ac63636553", 0, -686435306, "883a6ea3b2cc53fe8a803c229106366ca14d25ffbab9fef8367340f65b201da6"],
|
||||
["b123ed2204410d4e8aaaa8cdb95234ca86dad9ff77fb4ae0fd4c06ebed36794f0215ede0040100000002ac63ffffffff3b58b81b19b90d8f402701389b238c3a84ff9ba9aeea298bbf15b41a6766d27a01000000056a6553ab00151824d401786153b819831fb15926ff1944ea7b03d884935a8bde01ed069d5fd80220310200000000ffffffffa9c9d246f1eb8b7b382a9032b55567e9a93f86c77f4e32c092aa1738f7f756c30100000002ab65ffffffff011a2b48000000000000ed44d1fb", "630051ab63", 2, -1118263883, "b5dab912bcabedff5f63f6dd395fc2cf030d83eb4dd28214baba68a45b4bfff0"],
|
||||
["1339051503e196f730955c5a39acd6ed28dec89b4dadc3f7c79b203b344511270e5747fa9900000000045151636affffffff378c6090e08a3895cedf1d25453bbe955a274657172491fd2887ed5c9aceca7b0100000000ffffffffcf7cc3c36ddf9d4749edfa9cefed496d2f86e870deb814bfcd3b5637a5496461030000000451006300ffffffff04dcf3fa010000000008526a63005263acabb41d84040000000004abac5153800eff020000000005656a535365106c5e00000000000000000000", "abac5300", 2, 2013719928, "7fc74de39ce6ca46ca25d760d3cec7bb21fd14f7efe1c443b5aa294f2cb5f546"],
|
||||
["0728c606014c1fd6005ccf878196ba71a54e86cc8c53d6db500c3cc0ac369a26fac6fcbc210000000005ab53ac5365ba9668290182d7870100000000066a000053655100000000", "65", 0, 1789961588, "ab6baa6da3b2bc853868d166f8996ad31d63ef981179f9104f49968fd61c8427"],
|
||||
["a1134397034bf4067b6c81c581e2b73fb63835a08819ba24e4e92df73074bf773c94577df7000000000465525251ffffffff8b6608feaa3c1f35f49c6330a769716fa01c5c6f6e0cdc2eb10dfc99bbc21e77010000000952656aac005352655180a0bda4bc72002c2ea8262e26e03391536ec36867258cab968a6fd6ec7523b64fa1d8c001000000056a53ac6353ffffffff04dbeeed05000000000553650052abcd5d0e01000000000463abab51104b2e0500000000066aac53ac5165283ca7010000000004535252ab00000000", "ab515151516552ab", 1, -324598676, "91178482112f94d1c8e929de443e4b9c893e18682998d393ca9ca77950412586"],
|
||||
["bcdafbae04aa18eb75855aeb1f5124f30044741351b33794254a80070940cb10552fa4fa8e0300000001acd0423fe6e3f3f88ae606f2e8cfab7a5ef87caa2a8f0401765ff9a47d718afcfb40c0099b0000000008ac6565ab53ac6aac645308009d680202d600e492b31ee0ab77c7c5883ebad5065f1ce87e4dfe6453e54023a0010000000151ffffffffb9d818b14245899e1d440152827c95268a676f14c3389fc47f5a11a7b38b1bde03000000026300ffffffff03cda22102000000000751ac535263005100a4d20400000000045200536ac8bef405000000000700ab51ab6563ac00000000", "6553516a526aab", 1, -2111409753, "5e1849e7368cf4f042718586d9bd831d61479b775bab97aba9f450042bd9876a"],
|
||||
["ed3bb93802ddbd08cb030ef60a2247f715a0226de390c9c1a81d52e83f8674879065b5f87d0300000003ab6552ffffffff04d2c5e60a21fb6da8de20bf206db43b720e2a24ce26779bca25584c3f765d1e0200000008ab656a6aacab00ab6e946ded025a811d04000000000951abac6352ac00ab5143cfa3030000000005635200636a00000000", "5352ac650065535300", 1, -668727133, "e9995065e1fddef72a796eef5274de62012249660dc9d233a4f24e02a2979c87"],
|
||||
["59f4629d030fa5d115c33e8d55a79ea3cba8c209821f979ed0e285299a9c72a73c5bba00150200000002636affffffffd8aca2176df3f7a96d0dc4ee3d24e6cecde1582323eec2ebef9a11f8162f17ac0000000007ab6565acab6553ffffffffeebc10af4f99c7a21cbc1d1074bd9f0ee032482a71800f44f26ee67491208e0403000000065352ac656351ffffffff0434e955040000000004ab515152caf2b305000000000365ac007b1473030000000003ab530033da970500000000060051536a5253bb08ab51", "", 2, 396340944, "0e9c47973ef2c292b2252c623f465bbb92046fe0b893eebf4e1c9e02cb01c397"],
|
||||
["286e3eb7043902bae5173ac3b39b44c5950bc363f474386a50b98c7bdab26f98dc83449c4a020000000752ac6a00510051ffffffff4339cd6a07f5a5a2cb5815e5845da70300f5c7833788363bf7fe67595d3225520100000000fffffffff9c2dd8b06ad910365ffdee1a966f124378a2b8021065c8764f6138bb1e951380200000005ab5153ac6affffffff0370202aba7a68df85436ea7c945139513384ef391fa33d16020420b8ad40e9a000000000900ab5165526353abacffffffff020c1907000000000004abac526a1b490b040000000000df1528f7", "5353ab", 3, -1407529517, "32154c09174a9906183abf26538c39e78468344ca0848bbd0785e24a3565d932"],
|
||||
["2e245cf80179e2e95cd1b34995c2aff49fe4519cd7cee93ad7587f7f7e8105fc2dff206cd30200000009006a63516a6553ab52350435a201d5ed2d02000000000352ab6558552c89", "00ab53", 0, -233917810, "4605ae5fd3d50f9c45d37db7118a81a9ef6eb475d2333f59df5d3e216f150d49"],
|
||||
["33a98004029d262f951881b20a8d746c8c707ea802cd2c8b02a33b7e907c58699f97e42be80100000007ac53536552abacdee04cc01d205fd8a3687fdf265b064d42ab38046d76c736aad8865ca210824b7c622ecf02000000070065006a536a6affffffff01431c5d010000000000270d48ee", "", 1, 921554116, "ff9d7394002f3f196ea25472ea6c46f753bd879a7244795157bb7235c9322902"],
|
||||
["aac18f2b02b144ed481557c53f2146ae523f24fcde40f3445ab0193b6b276c315dc2894d2300000000075165650000636a233526947dbffc76aec7db1e1baa6868ad4799c76e14794dcbaaec9e713a83967f6a65170200000005abac6551ab27d518be01b652a30000000000015300000000", "52ac5353", 1, 1559377136, "59fc2959bb7bb24576cc8a237961ed95bbb900679d94da6567734c4390cb6ef5"],
|
||||
["5ab79881033555b65fe58c928883f70ce7057426fbdd5c67d7260da0fe8b1b9e6a2674cb850300000009ac516aac6aac006a6affffffffa5be9223b43c2b1a4d120b5c5b6ec0484f637952a3252181d0f8e813e76e11580200000000e4b5ceb8118cb77215bbeedc9a076a4d087bb9cd1473ea32368b71daeeeacc451ec209010000000005acac5153aced7dc34e02bc5d11030000000005ac5363006a54185803000000000552ab00636a00000000", "5100", 1, 1927062711, "e9f53d531c12cce1c50abed4ac521a372b4449b6a12f9327c80020df6bff66c0"],
|
||||
["6c2c8fac0124b0b7d4b610c3c5b91dee32b7c927ac71abdf2d008990ca1ac40de0dfd530660300000006ababac5253656bd7eada01d847ec000000000004ac52006af4232ec8", "6a6a6a0051", 0, -340809707, "fb51eb9d7e47d32ff2086205214f90c7c139e08c257a64829ae4d2b301071c6a"],
|
||||
["6e3880af031735a0059c0bb5180574a7dcc88e522c8b56746d130f8d45a52184045f96793e0100000008acabac6a526a6553fffffffffe05f14cdef7d12a9169ec0fd37524b5fcd3295f73f48ca35a36e671da4a2f560000000008006a526a6351ab63ffffffffdfbd869ac9e472640a84caf28bdd82e8c6797f42d03b99817a705a24fde2736600000000010090a090a503db956b04000000000952ac53ab6a536a63ab358390010000000009656a5200525153ac65353ee204000000000763530052526aaba6ad83fb", "535151ab6300", 2, 222014018, "57a34ddeb1bf36d28c7294dda0432e9228a9c9e5cc5c692db98b6ed2e218d825"],
|
||||
["8df1cd19027db4240718dcaf70cdee33b26ea3dece49ae6917331a028c85c5a1fb7ee3e475020000000865ab6a00510063636157988bc84d8d55a8ba93cdea001b9bf9d0fa65b5db42be6084b5b1e1556f3602f65d4d0100000005ac00ab0052206c852902b2fb54030000000008ac5252536aacac5378c4a5050000000007acabac535163532784439e", "acab6a", 0, 1105620132, "edb7c74223d1f10f9b3b9c1db8064bc487321ff7bb346f287c6bc2fad83682de"],
|
||||
["0e803682024f79337b25c98f276d412bc27e56a300aa422c42994004790cee213008ff1b8303000000080051ac65ac655165f421a331892b19a44c9f88413d057fea03c3c4a6c7de4911fe6fe79cf2e9b3b10184b1910200000005525163630096cb1c670398277204000000000253acf7d5d502000000000963536a6a636a5363ab381092020000000002ac6a911ccf32", "6565", 1, -1492094009, "f0672638a0e568a919e9d8a9cbd7c0189a3e132940beeb52f111a89dcc2daa2c"],
|
||||
["7d71669d03022f9dd90edac323cde9e56354c6804c6b8e687e9ae699f46805aafb8bcaa636000000000253abffffffff698a5fdd3d7f2b8b000c68333e4dd58fa8045b3e2f689b889beeb3156cecdb490300000009525353abab0051acabc53f0aa821cdd69b473ec6e6cf45cf9b38996e1c8f52c27878a01ec8bb02e8cb31ad24e500000000055353ab0052ffffffff0447a23401000000000565ab53ab5133aaa0030000000006515163656563057d110300000000056a6aacac52cf13b5000000000003526a5100000000", "6a6a51", 1, -1349253507, "722efdd69a7d51d3d77bed0ac5544502da67e475ea5857cd5af6bdf640a69945"],
|
||||
["9ff618e60136f8e6bb7eabaaac7d6e2535f5fba95854be6d2726f986eaa9537cb283c701ff02000000026a65ffffffff012d1c0905000000000865ab00ac6a516a652f9ad240", "51515253635351ac", 0, 1571304387, "659cd3203095d4a8672646add7d77831a1926fc5b66128801979939383695a79"],
|
||||
["9fbd43ac025e1462ecd10b1a9182a8e0c542f6d1089322a41822ab94361e214ed7e1dfdd8a020000000263519d0437581538e8e0b6aea765beff5b4f3a4a202fca6e5d19b34c141078c6688f71ba5b8e0100000003ac6552ffffffff02077774050000000009655153655263acab6a0ae4e10100000000035152524c97136b", "635152ab", 0, 1969622955, "d82d4ccd9b67810f26a378ad9592eb7a30935cbbd27e859b00981aefd0a72e08"],
|
||||
["0117c92004314b84ed228fc11e2999e657f953b6de3b233331b5f0d0cf40d5cc149b93c7b30300000005515263516a083e8af1bd540e54bf5b309d36ba80ed361d77bbf4a1805c7aa73667ad9df4f97e2da410020000000600ab6351ab524d04f2179455e794b2fcb3d214670001c885f0802e4b5e015ed13a917514a7618f5f332203000000086a536aab51000063ecf029e65a4a009a5d67796c9f1eb358b0d4bd2620c8ad7330fb98f5a802ab92d0038b1002000000036a6551a184a88804b04490000000000009ab6a5152535165526a33d1ab020000000001518e92320000000000002913df04000000000952abac6353525353ac8b19bfdf", "000051ab0000", 0, 489433059, "8eebac87e60da524bbccaf285a44043e2c9232868dda6c6271a53c153e7f3a55"],
|
||||
["e7f5482903f98f0299e0984b361efb2fddcd9979869102281e705d3001a9d283fe9f3f3a1e02000000025365ffffffffcc5c7fe82feebad32a22715fc30bc584efc9cd9cadd57e5bc4b6a265547e676e0000000001ab579d21235bc2281e08bf5e7f8f64d3afb552839b9aa5c77cf762ba2366fffd7ebb74e49400000000055263ab63633df82cf40100982e05000000000453ac535300000000", "acacab", 2, -1362931214, "046de666545330e50d53083eb78c9336416902f9b96c77cc8d8e543da6dfc7e4"],
|
||||
["09adb2e90175ca0e816326ae2dce7750c1b27941b16f6278023dbc294632ab97977852a09d030000000465ab006affffffff027739cf0100000000075151ab63ac65ab8a5bb601000000000653ac5151520011313cdc", "ac", 0, -76831756, "478ee06501b4965b40bdba6cbaad9b779b38555a970912bb791b86b7191c54bc"],
|
||||
["f973867602e30f857855cd0364b5bbb894c049f44abbfd661d7ae5dbfeaafca89fac8959c20100000005ab52536a51ffffffffbeceb68a4715f99ba50e131884d8d20f4a179313691150adf0ebf29d05f8770303000000066352ab00ac63ffffffff021fddb90000000000036a656322a177000000000008526500ac5100acac84839083", "52acab53ac", 0, 1407879325, "db0329439490efc64b7104d6d009b03fbc6fac597cf54fd786fbbb5fd73b92b4"],
|
||||
["fd22ebaa03bd588ad16795bea7d4aa7f7d48df163d75ea3afebe7017ce2f350f6a0c1cb0bb00000000086aabac5153526363ffffffff488e0bb22e26a565d77ba07178d17d8f85702630ee665ec35d152fa05af3bda10200000004515163abffffffffeb21035849e85ad84b2805e1069a91bb36c425dc9c212d9bae50a95b6bfde1200300000001ab5df262fd02b69848040000000008ab6363636a6363ace23bf2010000000007655263635253534348c1da", "006353526563516a00", 0, -1491036196, "92364ba3c7a85d4e88885b8cb9b520dd81fc29e9d2b750d0790690e9c1246673"],
|
||||
["130b462d01dd49fac019dc4442d0fb54eaa6b1c2d1ad0197590b7df26969a67abd7f3fbb4f0100000008ac65abac53ab6563ffffffff0345f825000000000004ac53acac9d5816020000000002ababeff8e90500000000086aab006552ac6a53a892dc55", "ab0065ac530052", 0, 944483412, "1f4209fd4ce7f13d175fdd522474ae9b34776fe11a5f17a27d0796c77a2a7a9d"],
|
||||
["f8e50c2604609be2a95f6d0f31553081f4e1a49a0a30777fe51eb1c596c1a9a92c053cf28c0300000009656a51ac5252630052fffffffff792ed0132ae2bd2f11d4a2aab9d0c4fbdf9a66d9ae2dc4108afccdc14d2b1700100000007ab6a6563ac636a7bfb2fa116122b539dd6a2ab089f88f3bc5923e5050c8262c112ff9ce0a3cd51c6e3e84f02000000066551ac5352650d5e687ddf4cc9a497087cabecf74d236aa4fc3081c3f67b6d323cba795e10e7a171b725000000000852635351ab635100ffffffff02df5409020000000008ac6a53acab5151004156990200000000045163655200000000", "ac53abac65005300", 0, -173065000, "b596f206d7eba22b7e2d1b7a4f4cf69c7c541b6c84dcc943f84e19a99a923310"],
|
||||
["18020dd1017f149eec65b2ec23300d8df0a7dd64fc8558b36907723c03cd1ba672bbb0f51d0300000005ab65ab6a63ffffffff037cd7ae000000000009ab516a65005352ac65f1e4360400000000056353530053f118f0040000000009536363ab006500abac00000000", "63ab51acab52ac", 0, -550412404, "e19b796c14a0373674968e342f2741d8b51092a5f8409e9bff7dcd52e56fcbcb"],
|
||||
["b04154610363fdade55ceb6942d5e5a723323863b48a0cb04fdcf56210717955763f56b08d0300000009ac526a525151635151ffffffff93a176e76151a9eabdd7af00ef2af72f9e7af5ecb0aa4d45d00618f394cdd03c030000000074d818b332ebe05dc24c44d776cf9d275c61f471cc01efce12fd5a16464157f1842c65cb00000000066a0000ac6352d3c4134f01d8a1c0030000000005520000005200000000", "5200656a656351", 2, -9757957, "6e3e5ba77f760b6b5b5557b13043f1262418f3dd2ce7f0298b012811fc8ad5bc"],
|
||||
["9794b3ce033df7b1e32db62d2f0906b589eacdacf5743963dc2255b6b9a6cba211fadd0d41020000000600ab00650065ffffffffaae00687a6a4131152bbcaafedfaed461c86754b0bde39e2bef720e6d1860a0302000000070065516aac6552ffffffff50e4ef784d6230df7486e972e8918d919f005025bc2d9aacba130f58bed7056703000000075265ab52656a52ffffffff02c6f1a9000000000006005251006363cf450c040000000008abab63510053abac00000000", "ac0063ababab515353", 1, 2063905082, "fad092fc98f17c2c20e10ba9a8eb44cc2bcc964b006f4da45cb9ceb249c69698"],
|
||||
["94533db7015e70e8df715066efa69dbb9c3a42ff733367c18c22ff070392f988f3b93920820000000006535363636300ce4dac3e03169af80300000000080065ac6a53ac65ac39c050020000000006abacab6aacac708a02050000000005ac5251520000000000", "6553", 0, -360458507, "5418cf059b5f15774836edd93571e0eed3855ba67b2b08c99dccab69dc87d3e9"],
|
||||
["c8597ada04f59836f06c224a2640b79f3a8a7b41ef3efa2602592ddda38e7597da6c639fee0300000009005251635351acabacffffffff4c518f347ee694884b9d4072c9e916b1a1f0a7fc74a1c90c63fdf8e5a185b6ae02000000007113af55afb41af7518ea6146786c7c726641c68c8829a52925e8d4afd07d8945f68e7230300000008ab00ab65ab650063ffffffffc28e46d7598312c420e11dfaae12add68b4d85adb182ae5b28f8340185394b63000000000165ffffffff04dbabb7010000000000ee2f6000000000000852ab6500ab6a51acb62a27000000000009ac53515300ac006a6345fb7505000000000752516a0051636a00000000", "", 3, 15199787, "0d66003aff5bf78cf492ecbc8fd40c92891acd58d0a271be9062e035897f317e"],
|
||||
["1a28c4f702c8efaad96d879b38ec65c5283b5c084b819ad7db1c086e85e32446c7818dc7a90300000008656351536a525165fa78cef86c982f1aac9c5eb8b707aee8366f74574c8f42ef240599c955ef4401cf578be30200000002ab518893292204c430eb0100000000016503138a0300000000040053abac60e0eb010000000005525200ab63567c2d030000000004abab52006cf81e85", "ab51525152", 1, 2118315905, "4e4c9a781f626b59b1d3ad8f2c488eb6dee8bb19b9bc138bf0dc33e7799210d4"],
|
||||
["c6c7a87003f772bcae9f3a0ac5e499000b68703e1804b9ddc3e73099663564d53ddc4e1c6e01000000076a536a6aac63636e3102122f4c30056ef8711a6bf11f641ddfa6984c25ac38c3b3e286e74e839198a80a34010000000165867195cd425821dfa2f279cb1390029834c06f018b1e6af73823c867bf3a0524d1d6923b0300000005acab53ab65ffffffff02fa4c49010000000008ab656a0052650053e001100400000000008836d972", "ac526351acab", 1, 978122815, "a869c18a0edf563d6e5eddd5d5ae8686f41d07f394f95c9feb8b7e52761531ca"],
|
||||
["0ea580ac04c9495ab6af3b8d59108bb4194fcb9af90b3511c83f7bb046d87aedbf8423218e02000000085152acac006363ab9063d7dc25704e0caa5edde1c6f2dd137ded379ff597e055b2977b9c559b07a7134fcef2000000000200aca89e50181f86e9854ae3b453f239e2847cf67300fff802707c8e3867ae421df69274449402000000056365abababffffffff47a4760c881a4d7e51c69b69977707bd2fb3bcdc300f0efc61f5840e1ac72cee0000000000ffffffff0460179a020000000004ab53ab52a5250c0500000000096565acac6365ab52ab6c281e02000000000952635100ac006563654e55070400000000046552526500000000", "ab526563acac53ab", 2, 1426964167, "b1c50d58b753e8f6c7513752158e9802cf0a729ebe432b99acc0fe5d9b4e9980"],
|
||||
["c33028b301d5093e1e8397270d75a0b009b2a6509a01861061ab022ca122a6ba935b8513320200000000ffffffff013bcf5a0500000000015200000000", "", 0, -513413204, "6b1459536f51482f5dbf42d7e561896557461e1e3b6bf67871e2b51faae2832c"],
|
||||
["43b2727901a7dd06dd2abf690a1ccedc0b0739cb551200796669d9a25f24f71d8d101379f50300000000ffffffff0418e031040000000000863d770000000000085352ac526563ac5174929e040000000004ac65ac00ec31ac0100000000066a51ababab5300000000", "65", 0, -492874289, "154ff7a9f0875edcfb9f8657a0b98dd9600fabee3c43eb88af37cf99286d516c"],
|
||||
["4763ed4401c3e6ab204bed280528e84d5288f9cac5fb8a2e7bd699c7b98d4df4ac0c40e55303000000066a6aacab5165ffffffff015b57f80400000000046a63535100000000", "ac51abab53", 0, -592611747, "849033a2321b5755e56ef4527ae6f51e30e3bca50149d5707368479723d744f8"],
|
||||
["d24f647b02f71708a880e6819a1dc929c1a50b16447e158f8ff62f9ccd644e0ca3c592593702000000050053536a00ffffffff67868cd5414b6ca792030b18d649de5450a456407242b296d936bcf3db79e07b02000000005af6319c016022f50100000000036a516300000000", "6aab526353516a6a", 0, 1350782301, "8556fe52d1d0782361dc28baaf8774b13f3ce5ed486ae0f124b665111e08e3e3"],
|
||||
["fe6ddf3a02657e42a7496ef170b4a8caf245b925b91c7840fd28e4a22c03cb459cb498b8d603000000065263656a650071ce6bf8d905106f9f1faf6488164f3decac65bf3c5afe1dcee20e6bc3cb6d052561985a030000000163295b117601343dbb0000000000026563dba521df", "", 1, -1696179931, "d9684685c99ce48f398fb467a91a1a59629a850c429046fb3071f1fa9a5fe816"],
|
||||
["c61523ef0129bb3952533cbf22ed797fa2088f307837dd0be1849f20decf709cf98c6f032f03000000026563c0f1d378044338310400000000066363516a5165a14fcb0400000000095163536a6a00ab53657271d60200000000001d953f0500000000010000000000", "53516353005153", 0, 1141615707, "7e975a72db5adaa3c48d525d9c28ac11cf116d0f8b16ce08f735ad75a80aec66"],
|
||||
["ba3dac6c0182562b0a26d475fe1e36315f0913b6869bdad0ecf21f1339a5fcbccd32056c840200000000ffffffff04300351050000000000220ed405000000000851abac636565ac53dbbd19020000000007636363ac6a52acbb005a0500000000016abd0c78a8", "63006a635151005352", 0, 1359658828, "47bc8ab070273e1f4a0789c37b45569a6e16f3f3092d1ce94dddc3c34a28f9f4"],
|
||||
["ac27e7f5025fc877d1d99f7fc18dd4cadbafa50e34e1676748cc89c202f93abf36ed46362101000000036300abffffffff958cd5381962b765e14d87fc9524d751e4752dd66471f973ed38b9d562e525620100000003006500ffffffff02b67120050000000004ac51516adc330c0300000000015200000000", "656352", 1, 15049991, "f3374253d64ac264055bdbcc32e27426416bd595b7c7915936c70f839e504010"],
|
||||
["edb30140029182b80c8c3255b888f7c7f061c4174d1db45879dca98c9aab8c8fed647a6ffc03000000086a53510052ab6300ffffffff82f65f261db62d517362c886c429c8fbbea250bcaad93356be6f86ba573e9d930100000000ffffffff04daaf150400000000016a86d1300100000000096a6353535252ac5165d4ddaf000000000002abab5f1c6201000000000000000000", "ab6a6a00ac", 0, -2058017816, "8d7794703dad18e2e40d83f3e65269834bb293e2d2b8525932d6921884b8f368"],
|
||||
["7e50207303146d1f7ad62843ae8017737a698498d4b9118c7a89bb02e8370307fa4fada41d000000000753006300005152b7afefc85674b1104ba33ef2bf37c6ed26316badbc0b4aa6cb8b00722da4f82ff3555a6c020000000900ac656363ac51ac52ffffffff93fab89973bd322c5d7ad7e2b929315453e5f7ada3072a36d8e33ca8bebee6e0020000000300acab930da52b04384b04000000000004650052ac435e380200000000076a6a515263ab6aa9494705000000000600ab6a525252af8ba90100000000096565acab526353536a279b17ad", "acac005263536aac63", 1, -34754133, "4e6357da0057fb7ff79da2cc0f20c5df27ff8b2f8af4c1709e6530459f7972b0"],
|
||||
["c05764f40244fb4ebe4c54f2c5298c7c798aa90e62c29709acca0b4c2c6ec08430b26167440100000008acab6a6565005253ffffffffc02c2418f398318e7f34a3cf669d034eef2111ea95b9f0978b01493293293a870100000000e563e2e00238ee8d040000000002acab03fb060200000000076500ac656a516aa37f5534", "52ab6a0065", 1, -2033176648, "83deef4a698b62a79d4877dd9afebc3011a5275dbe06e89567e9ef84e8a4ee19"],
|
||||
["5a59e0b9040654a3596d6dab8146462363cd6549898c26e2476b1f6ae42915f73fd9aedfda00000000036363abffffffff9ac9e9ca90be0187be2214251ff08ba118e6bf5e2fd1ba55229d24e50a510d53010000000165ffffffff41d42d799ac4104644969937522873c0834cc2fcdab7cdbecd84d213c0e96fd60000000000ffffffffd838db2c1a4f30e2eaa7876ef778470f8729fcf258ad228b388df2488709f8410300000000fdf2ace002ceb6d903000000000265654c1310040000000003ac00657e91c0ec", "536a63ac", 0, 82144555, "98ccde2dc14d14f5d8b1eeea5364bd18fc84560fec2fcea8de4d88b49c00695e"],
|
||||
["156ebc8202065d0b114984ee98c097600c75c859bfee13af75dc93f57c313a877efb09f230010000000463536a51ffffffff81114e8a697be3ead948b43b5005770dd87ffb1d5ccd4089fa6c8b33d3029e9c03000000066a5251656351ffffffff01a87f140000000000050000ac51ac00000000", "00", 0, -362221092, "a903c84d8c5e71134d1ab6dc1e21ac307c4c1a32c90c90f556f257b8a0ec1bf5"],
|
||||
["15e37793023c7cbf46e073428908fce0331e49550f2a42b92468827852693f0532a01c29f70200000007005353636351acffffffff38426d9cec036f00eb56ec1dcd193647e56a7577278417b8a86a78ac53199bc403000000056353006a53ffffffff04a25ce103000000000900ab5365656a526a63c8eff7030000000004526353537ab6db0200000000016a11a3fa02000000000651acacab526500000000", "53ac6aab6a6551", 0, 1117532791, "83c68b3c5a89260ce16ce8b4dbf02e1f573c532d9a72f5ea57ab419fa2630214"],
|
||||
["f7a09f10027250fc1b70398fb5c6bffd2be9718d3da727e841a73596fdd63810c9e4520a6a010000000963ac516a636a65acac1d2e2c57ab28d311edc4f858c1663972eebc3bbc93ed774801227fda65020a7ec1965f780200000005ac5252516a8299fddc01dcbf7200000000000463ac6551960fda03", "65acab51", 1, 2017321737, "9c5fa02abfd34d0f9dec32bf3edb1089fca70016debdb41f4f54affcb13a2a2a"],
|
||||
["6d97a9a5029220e04f4ccc342d8394c751282c328bf1c132167fc05551d4ca4da4795f6d4e02000000076a0052ab525165ffffffff9516a205e555fa2a16b73e6db6c223a9e759a7e09c9a149a8f376c0a7233fa1b0100000007acab51ab63ac6affffffff04868aed04000000000652ac65ac536a396edf01000000000044386c0000000000076aab5363655200894d48010000000001ab8ebefc23", "6351526aac51", 1, 1943666485, "f0bd4ca8e97203b9b4e86bc24bdc8a1a726db5e99b91000a14519dc83fc55c29"],
|
||||
["8e3fddfb028d9e566dfdda251cd874cd3ce72e9dde837f95343e90bd2a93fe21c5daeb5eed01000000045151525140517dc818181f1e7564b8b1013fd68a2f9a56bd89469686367a0e72c06be435cf99db750000000003635251ffffffff01c051780300000000096552ababac6a65acab099766eb", "5163ab6a52ababab51", 1, 1296295812, "5509eba029cc11d7dd2808b8c9eb47a19022b8d8b7778893459bbc19ab7ea820"],
|
||||
["a603f37b02a35e5f25aae73d0adc0b4b479e68a734cf722723fd4e0267a26644c36faefdab0200000000ffffffff43374ad26838bf733f8302585b0f9c22e5b8179888030de9bdda180160d770650200000001004c7309ce01379099040000000005526552536500000000", "abababab005153", 0, 1409936559, "4ca73da4fcd5f1b10da07998706ffe16408aa5dff7cec40b52081a6514e3827e"],
|
||||
["9eeedaa8034471a3a0e3165620d1743237986f060c4434f095c226114dcb4b4ec78274729f03000000086a5365510052ac6afb505af3736e347e3f299a58b1b968fce0d78f7457f4eab69240cbc40872fd61b5bf8b120200000002ac52df8247cf979b95a4c97ecb8edf26b3833f967020cd2fb25146a70e60f82c9ee4b14e88b103000000008459e2fa0125cbcd05000000000000000000", "52ab5352006353516a", 0, -1832576682, "fb018ae54206fdd20c83ae5873ec82b8e320a27ed0d0662db09cda8a071f9852"],
|
||||
["05921d7c048cf26f76c1219d0237c226454c2a713c18bf152acc83c8b0647a94b13477c07f0300000003ac526afffffffff2f494453afa0cabffd1ba0a626c56f90681087a5c1bd81d6adeb89184b27b7402000000036a6352ffffffff0ad10e2d3ce355481d1b215030820da411d3f571c3f15e8daf22fe15342fed04000000000095f29f7b93ff814a9836f54dc6852ec414e9c4e16a506636715f569151559100ccfec1d100000000055263656a53ffffffff04f4ffef010000000008ac6a6aabacabab6a0e6689040000000006ab536a5352abe364d005000000000965536363655251ab53807e00010000000004526aab63f18003e3", "6363ac51", 3, -375891099, "001b0b176f0451dfe2d9787b42097ceb62c70d324e925ead4c58b09eebdf7f67"],
|
||||
["b9b44d9f04b9f15e787d7704e6797d51bc46382190c36d8845ec68dfd63ee64cf7a467b21e00000000096aac00530052ab636aba1bcb110a80c5cbe073f12c739e3b20836aa217a4507648d133a8eedd3f02cb55c132b203000000076a000063526352b1c288e3a9ff1f2da603f230b32ef7c0d402bdcf652545e2322ac01d725d75f5024048ad0100000000ffffffffffd882d963be559569c94febc0ef241801d09dc69527c9490210f098ed8203c700000000056a006300ab9109298d01719d9a0300000000066a52ab006365d7894c5b", "ac6351650063636a", 3, -622355349, "ac87b1b93a6baab6b2c6624f10e8ebf6849b0378ef9660a3329073e8f5553c8d"],
|
||||
["ff60473b02574f46d3e49814c484081d1adb9b15367ba8487291fc6714fd6e3383d5b335f001000000026a6ae0b82da3dc77e5030db23d77b58c3c20fa0b70aa7d341a0f95f3f72912165d751afd57230300000008ac536563516a6363ffffffff04f86c0200000000000553acab636ab13111000000000003510065f0d3f305000000000951ab516a65516aabab730a3a010000000002515200000000", "ac6a", 1, 1895032314, "0767e09bba8cd66d55915677a1c781acd5054f530d5cf6de2d34320d6c467d80"],
|
||||
["f218026204f4f4fc3d3bd0eada07c57b88570d544a0436ae9f8b753792c0c239810bb30fbc0200000002536affffffff8a468928d6ec4cc10aa0f73047697970e99fa64ae8a3b4dca7551deb0b639149010000000851ab520052650051ffffffffa98dc5df357289c9f6873d0f5afcb5b030d629e8f23aa082cf06ec9a95f3b0cf0000000000ffffffffea2c2850c5107705fd380d6f29b03f533482fd036db88739122aac9eff04e0aa010000000365536a03bd37db034ac4c4020000000007515152655200ac33b27705000000000151efb71e0000000000007b65425b", "515151", 3, -1772252043, "de35c84a58f2458c33f564b9e58bc57c3e028d629f961ad1b3c10ee020166e5a"],
|
||||
["48e7d42103b260b27577b70530d1ac2fed2551e9dd607cbcf66dca34bb8c03862cf8f5fd5401000000075151526aacab00ffffffff1e3d3b841552f7c6a83ee379d9d66636836673ce0b0eda95af8f2d2523c91813030000000665acac006365ffffffff388b3c386cd8c9ef67c83f3eaddc79f1ff910342602c9152ffe8003bce51b28b0100000008636363006a636a52ffffffff04b8f67703000000000852005353ac6552520cef720200000000085151ab6352ab00ab5096d6030000000005516a005100662582020000000001ac6c137280", "6a65", 1, 1513618429, "e2fa3e1976aed82c0987ab30d4542da2cb1cffc2f73be13480132da8c8558d5c"],
|
||||
["91ebc4cf01bc1e068d958d72ee6e954b196f1d85b3faf75a521b88a78021c543a06e056279000000000265ab7c12df0503832121030000000000cc41a6010000000005ab5263516540a951050000000006ab63ab65acac00000000", "526a0065636a6a6aac", 0, -614046478, "7de4ba875b2e584a7b658818c112e51ee5e86226f5a80e5f6b15528c86400573"],
|
||||
["3cd4474201be7a6c25403bf00ca62e2aa8f8f4f700154e1bb4d18c66f7bb7f9b975649f0dc0100000006535151535153ffffffff01febbeb000000000006005151006aac00000000", "", 0, -1674687131, "6b77ca70cc452cc89acb83b69857cda98efbfc221688fe816ef4cb4faf152f86"],
|
||||
["92fc95f00307a6b3e2572e228011b9c9ed41e58ddbaefe3b139343dbfb3b34182e9fcdc3f50200000002acab847bf1935fde8bcfe41c7dd99683289292770e7f163ad09deff0e0665ed473cd2b56b0f40300000006516551ab6351294dab312dd87b9327ce2e95eb44b712cfae0e50fda15b07816c8282e8365b643390eaab01000000026aacffffffff016e0b6b040000000001ac00000000", "650065acac005300", 2, -1885164012, "bd7d26bb3a98fc8c90c972500618bf894cb1b4fe37bf5481ff60eef439d3b970"],
|
||||
["4db591ab018adcef5f4f3f2060e41f7829ce3a07ea41d681e8cb70a0e37685561e4767ac3b0000000005000052acabd280e63601ae6ef20000000000036a636326c908f7", "ac6a51526300630052", 0, 862877446, "355ccaf30697c9c5b966e619a554d3323d7494c3ea280a9b0dfb73f953f5c1cb"],
|
||||
["503fd5ef029e1beb7b242d10032ac2768f9a1aca0b0faffe51cec24770664ec707ef7ede4f01000000045253ac53375e350cc77741b8e96eb1ce2d3ca91858c052e5f5830a0193200ae2a45b413dda31541f0000000003516553ffffffff0175a5ba0500000000015200000000", "6aab65510053ab65", 1, 1603081205, "353ca9619ccb0210ae18b24d0e57efa7abf8e58fa6f7102738e51e8e72c9f0c4"],
|
||||
["c80abebd042cfec3f5c1958ee6970d2b4586e0abec8305e1d99eb9ee69ecc6c2cbd76374380000000007ac53006300ac510acee933b44817db79320df8094af039fd82111c7726da3b33269d3820123694d849ee5001000000056a65ab526562699bea8530dc916f5d61f0babea709dac578774e8a4dcd9c640ec3aceb6cb2443f24f302000000020063ea780e9e57d1e4245c1e5df19b4582f1bf704049c5654f426d783069bcc039f2d8fa659f030000000851ab53635200006a8d00de0b03654e8500000000000463ab635178ebbb0400000000055100636aab239f1d030000000006ab006300536500000000", "6565ac515100", 3, 1460851377, "b35bb1b72d02fab866ed6bbbea9726ab32d968d33a776686df3ac16aa445871e"],
|
||||
["0337b2d5043eb6949a76d6632b8bb393efc7fe26130d7409ef248576708e2d7f9d0ced9d3102000000075352636a5163007034384dfa200f52160690fea6ce6c82a475c0ef1caf5c9e5a39f8f9ddc1c8297a5aa0eb02000000026a51ffffffff38e536298799631550f793357795d432fb2d4231f4effa183c4e2f61a816bcf0030000000463ac5300706f1cd3454344e521fde05b59b96e875c8295294da5d81d6cc7efcfe8128f150aa54d6503000000008f4a98c704c1561600000000000072cfa6000000000000e43def01000000000100cf31cc0500000000066365526a6500cbaa8e2e", "", 3, 2029506437, "7615b4a7b3be865633a31e346bc3db0bcc410502c8358a65b8127089d81b01f8"],
|
||||
["59f6cffd034733f4616a20fe19ea6aaf6abddb30b408a3a6bd86cd343ab6fe90dc58300cc90200000000ffffffffc835430a04c3882066abe7deeb0fa1fdaef035d3233460c67d9eabdb05e95e5a02000000080065ac535353ab00ffffffff4b9a043e89ad1b4a129c8777b0e8d87a014a0ab6a3d03e131c27337bbdcb43b402000000066a5100abac6ad9e9bf62014bb118010000000001526cbe484f", "ab526352ab65", 0, 2103515652, "4f2ccf981598639bec57f885b4c3d8ea8db445ea6e61cfd45789c69374862e5e"],
|
||||
["cbc79b10020b15d605680a24ee11d8098ad94ae5203cb6b0589e432832e20c27b72a926af20300000006ab65516a53acbb854f3146e55c508ece25fa3d99dbfde641a58ed88c051a8a51f3dacdffb1afb827814b02000000026352c43e6ef30302410a020000000000ff4bd90100000000065100ab63000008aa8e0400000000095265526565ac5365abc52c8a77", "53526aac0051", 0, 202662340, "984efe0d8d12e43827b9e4b27e97b3777ece930fd1f589d616c6f9b71dab710e"],
|
||||
["7c07419202fa756d29288c57b5c2b83f3c847a807f4a9a651a3f6cd6c46034ae0aa3a7446b0200000004ab6a6365ffffffff9da83cf4219bb96c76f2d77d5df31c1411a421171d9b59ec02e5c1218f29935403000000008c13879002f8b1ac0400000000086a63536a636553653c584f02000000000000000000", "abac53ab656363", 1, -1038419525, "4a74f365a161bc6c9bddd249cbd70f5dadbe3de70ef4bd745dcb6ee1cd299fbd"],
|
||||
["351cbb57021346e076d2a2889d491e9bfa28c54388c91b46ee8695874ad9aa576f1241874d0200000008ab6563525300516affffffffe13e61b8880b8cd52be4a59e00f9723a4722ea58013ec579f5b3693b9e115b1100000000096363abac5252635351ffffffff027fee02040000000008ab6a5200ab006a65b85f130200000000086a52630053ab52ab00000000", "ab6aab65", 1, 586415826, "08bbb746a596991ab7f53a76e19acad087f19cf3e1db54054aab403c43682d09"],
|
||||
["a8252ea903f1e8ff953adb16c1d1455a5036222c6ea98207fc21818f0ece2e1fac310f9a0100000000095163ac635363ac0000be6619e9fffcde50a0413078821283ce3340b3993ad00b59950bae7a9f931a9b0a3a035f010000000463005300b8b0583fbd6049a1715e7adacf770162811989f2be20af33f5f60f26eba653dc26b024a00000000006525351636552ffffffff046d2acc030000000002636a9a2d430500000000080065005165ab53abecf63204000000000052b9ed050000000008acacac53ab65656500000000", "65ab53635253636a51", 2, 1442639059, "8ca11838775822f9a5beee57bdb352f4ee548f122de4a5ca61c21b01a1d50325"],
|
||||
["2f1a425c0471a5239068c4f38f9df135b1d24bf52d730d4461144b97ea637504495aec360801000000055300515365c71801dd1f49f376dd134a9f523e0b4ae611a4bb122d8b26de66d95203f181d09037974300000000025152ffffffff9bdcea7bc72b6e5262e242c94851e3a5bf8f314b3e5de0e389fc9e5b3eadac030000000009525265655151005153ffffffffdbb53ce99b5a2320a4e6e2d13b01e88ed885a0957d222e508e9ec8e4f83496cb0200000007635200abac63ac04c96237020cc5490100000000080000516a51ac6553074a360200000000025152225520ca", "6551ab65ac65516a", 1, -489869549, "9bc5bb772c553831fb40abe466074e59a469154679c7dee042b8ea3001c20393"],
|
||||
["ef3acfd4024defb48def411b8f8ba2dc408dc9ee97a4e8bde4d6cb8e10280f29c98a6e8e9103000000035100513d5389e3d67e075469dfd9f204a7d16175653a149bd7851619610d7ca6eece85a516b2df0300000005516aac6552ca678bdf02f477f003000000000057e45b0300000000055252525252af35c20a", "5165ac53ab", 1, -1900839569, "78eb6b24365ac1edc386aa4ffd15772f601059581c8776c34f92f8a7763c9ccf"],
|
||||
["ff4468dc0108475fc8d4959a9562879ce4ab4867a419664bf6e065f17ae25043e6016c70480100000000ffffffff02133c6f0400000000000bd0a8020000000004006a520035afa4f6", "51ac65ab", 0, -537664660, "f6da59b9deac63e83728850ac791de61f5dfcaeed384ebcbb20e44afcd8c8910"],
|
||||
["4e8594d803b1d0a26911a2bcdd46d7cbc987b7095a763885b1a97ca9cbb747d32c5ab9aa91030000000353ac53a0cc4b215e07f1d648b6eeb5cdbe9fa32b07400aa773b9696f582cebfd9930ade067b2b200000000060065abab6500fc99833216b8e27a02defd9be47fafae4e4a97f52a9d2a210d08148d2a4e5d02730bcd460100000004516351ac37ce3ae1033baa55040000000006006a636a63acc63c990400000000025265eb1919030000000005656a6a516a00000000", "", 1, -75217178, "04c5ee48514cd033b82a28e336c4d051074f477ef2675ce0ce4bafe565ee9049"],
|
||||
["a88830a7023f13ed19ab14fd757358eb6af10d6520f9a54923a6d613ac4f2c11e249cda8aa030000000851630065abababacffffffff8f5fe0bc04a33504c4b47e3991d25118947a0261a9fa520356731eeabd561dd3020000000363ababffffffff038404bd010000000008ab5153516aab6a63d33a5601000000000263004642dc020000000009655152acac636352004be6f3af", "5253536565006aab6a", 0, 1174417836, "2e42ead953c9f4f81b72c27557e6dc7d48c37ff2f5c46c1dbe9778fb0d79f5b2"],
|
||||
["44e1a2b4010762af23d2027864c784e34ef322b6e24c70308a28c8f2157d90d17b99cd94a401000000085163656565006300ffffffff0198233d020000000002000000000000", "52525153656365", 0, 1119696980, "d9096de94d70c6337da6202e6e588166f31bff5d51bb5adc9468594559d65695"],
|
||||
["44ca65b901259245abd50a745037b17eb51d9ce1f41aa7056b4888285f48c6f26cb97b7a25020000000552636363abffffffff047820350400000000040053acab14f3e603000000000652635100ab630ce66c03000000000001bdc704000000000765650065ac51ac3e886381", "51", 0, -263340864, "ed5622ac642d11f90e68c0feea6a2fe36d880ecae6b8c0d89c4ea4b3d162bd90"],
|
||||
["cfa147d2017fe84122122b4dda2f0d6318e59e60a7207a2d00737b5d89694d480a2c26324b0000000006006351526552ffffffff0456b5b804000000000800516aab525363ab166633000000000004655363ab254c0e02000000000952ab6a6a00ab525151097c1b020000000009656a52ac6300530065ad0d6e50", "6a535165ac6a536500", 0, -574683184, "f926d4036eac7f019a2b0b65356c4ee2fe50e089dd7a70f1843a9f7bc6997b35"],
|
||||
["91c5d5f6022fea6f230cc4ae446ce040d8313071c5ac1749c82982cc1988c94cb1738aa48503000000016a19e204f30cb45dd29e68ff4ae160da037e5fc93538e21a11b92d9dd51cf0b5efacba4dd70000000005656a6aac51ffffffff03db126905000000000953006a53ab6563636a36a273030000000006656a52656552b03ede00000000000352516500000000", "530052526a00", 1, 1437328441, "255c125b60ee85f4718b2972174c83588ee214958c3627f51f13b5fb56c8c317"],
|
||||
["03f20dc202c886907b607e278731ebc5d7373c348c8c66cac167560f19b341b782dfb634cb03000000076a51ac6aab63abea3e8de7adb9f599c9caba95aa3fa852e947fc88ed97ee50e0a0ec0d14d164f44c0115c10100000004ab5153516fdd679e0414edbd000000000005ac636a53512021f2040000000007006a0051536a52c73db2050000000005525265ac5369046e000000000003ab006a1ef7bd1e", "52656a", 0, 1360223035, "5a0a05e32ce4cd0558aabd5d79cd5fcbffa95c07137506e875a9afcba4bef5a2"],
|
||||
["d9611140036881b61e01627078512bc3378386e1d4761f959d480fdb9d9710bebddba2079d020000000763536aab5153ab819271b41e228f5b04daa1d4e72c8e1955230accd790640b81783cfc165116a9f535a74c000000000163ffffffffa2e7bb9a28e810624c251ff5ba6b0f07a356ac082048cf9f39ec036bba3d431a02000000076a000000ac65acffffffff01678a820000000000085363515153ac635100000000", "535353", 2, -82213851, "52b9e0778206af68998cbc4ebdaad5a9469e04d0a0a6cef251abfdbb74e2f031"],
|
||||
["98b3a0bf034233afdcf0df9d46ac65be84ef839e58ee9fa59f32daaa7d684b6bdac30081c60200000007636351acabababffffffffc71cf82ded4d1593e5825618dc1d5752ae30560ecfaa07f192731d68ea768d0f0100000006650052636563f3a2888deb5ddd161430177ce298242c1a86844619bc60ca2590d98243b5385bc52a5b8f00000000095365acacab520052ac50d4722801c3b8a60300000000035165517e563b65", "51", 1, -168940690, "b6b684e2d2ecec8a8dce4ed3fc1147f8b2e45732444222aa8f52d860c2a27a9d"],
|
||||
["97be4f7702dc20b087a1fdd533c7de762a3f2867a8f439bddf0dcec9a374dfd0276f9c55cc0300000000cdfb1dbe6582499569127bda6ca4aaff02c132dc73e15dcd91d73da77e92a32a13d1a0ba0200000002ab51ffffffff048cfbe202000000000900516351515363ac535128ce0100000000076aac5365ab6aabc84e8302000000000863536a53ab6a6552f051230500000000066aac535153510848d813", "ac51", 0, 229541474, "e5da9a416ea883be1f8b8b2d178463633f19de3fa82ae25d44ffb531e35bdbc8"],
|
||||
["085b6e04040b5bff81e29b646f0ed4a45e05890a8d32780c49d09643e69cdccb5bd81357670100000001abffffffffa5c981fe758307648e783217e3b4349e31a557602225e237f62b636ec26df1a80300000004650052ab4792e1da2930cc90822a8d2a0a91ea343317bce5356b6aa8aae6c3956076aa33a5351a9c0300000004abac5265e27ddbcd472a2f13325cc6be40049d53f3e266ac082172f17f6df817db1936d9ff48c02b000000000152ffffffff021aa7670500000000085353635163ab51ac14d584000000000001aca4d136cc", "6a525300536352536a", 0, -1398925877, "41ecca1e8152ec55074f4c39f8f2a7204dda48e9ec1e7f99d5e7e4044d159d43"],
|
||||
["eec32fff03c6a18b12cd7b60b7bdc2dd74a08977e53fdd756000af221228fe736bd9c42d870100000007005353ac515265ffffffff037929791a188e9980e8b9cc154ad1b0d05fb322932501698195ab5b219488fc02000000070063510065ab6a0bfc176aa7e84f771ea3d45a6b9c24887ceea715a0ff10ede63db8f089e97d927075b4f1000000000551abab63abffffffff02eb933c000000000000262c420000000000036563632549c2b6", "6352", 2, 1480445874, "ff8a4016dfdd918f53a45d3a1f62b12c407cd147d68ca5c92b7520e12c353ff5"],
|
||||
["98ea7eac0313d9fb03573fb2b8e718180c70ce647bebcf49b97a8403837a2556cb8c9377f30000000004ac53ac65ffffffff8caac77a5e52f0d8213ef6ce998bedbb50cfdf108954771031c0e0cd2a78423900000000010066e99a44937ebb37015be3693761078ad5c73aa73ec623ac7300b45375cc8eef36087eb80000000007515352acac5100ffffffff0114a51b02000000000000000000", "6aacab", 0, 243527074, "bad77967f98941af4dd52a8517d5ad1e32307c0d511e15461e86465e1b8b5273"],
|
||||
["3ab70f4604e8fc7f9de395ec3e4c3de0d560212e84a63f8d75333b604237aa52a10da17196000000000763526a6553ac63a25de6fd66563d71471716fe59087be0dde98e969e2b359282cf11f82f14b00f1c0ac70f02000000050052516aacdffed6bb6889a13e46956f4b8af20752f10185838fd4654e3191bf49579c961f5597c36c0100000005ac636363abc3a1785bae5b8a1b4be5d0cbfadc240b4f7acaa7dfed6a66e852835df5eb9ac3c553766801000000036a65630733b7530218569602000000000952006a6a6a51acab52777f06030000000007ac0063530052abc08267c9", "000000536aac0000", 1, 1919096509, "df1c87cf3ba70e754d19618a39fdbd2970def0c1bfc4576260cba5f025b87532"],
|
||||
["bdb6b4d704af0b7234ced671c04ba57421aba7ead0a117d925d7ebd6ca078ec6e7b93eea6600000000026565ffffffff3270f5ad8f46495d69b9d71d4ab0238cbf86cc4908927fbb70a71fa3043108e6010000000700516a65655152ffffffff6085a0fdc03ae8567d0562c584e8bfe13a1bd1094c518690ebcb2b7c6ce5f04502000000095251530052536a53aba576a37f2c516aad9911f687fe83d0ae7983686b6269b4dd54701cb5ce9ec91f0e6828390300000000ffffffff04cc76cc020000000002656a01ffb702000000000253ab534610040000000009acab006565516a00521f55f5040000000000389dfee9", "6a525165", 0, 1336204763, "71c294523c48fd7747eebefbf3ca06e25db7b36bff6d95b41c522fecb264a919"],
|
||||
["54258edd017d22b274fbf0317555aaf11318affef5a5f0ae45a43d9ca4aa652c6e85f8a040010000000953ac65ab5251656500ffffffff03321d450000000000085265526a51526a529ede8b030000000003635151ce6065020000000001534c56ec1b", "acac", 0, 2094130012, "110d90fea9470dfe6c5048f45c3af5e8cc0cb77dd58fd13d338268e1c24b1ccc"],
|
||||
["ce0d322e04f0ffc7774218b251530a7b64ebefca55c90db3d0624c0ff4b3f03f918e8cf6f60300000003656500ffffffff9cce943872da8d8af29022d0b6321af5fefc004a281d07b598b95f6dcc07b1830200000007abab515351acab8d926410e69d76b7e584aad1470a97b14b9c879c8b43f9a9238e52a2c2fefc2001c56af8010000000400ab5253cd2cd1fe192ce3a93b5478af82fa250c27064df82ba416dfb0debf4f0eb307a746b6928901000000096500abacac6a0063514214524502947efc0200000000035251652c40340100000000096a6aab52000052656a5231c54c", "51", 2, -2090320538, "0322ca570446869ec7ec6ad66d9838cff95405002d474c0d3c17708c7ee039c6"],
|
||||
["47ac54940313430712ebb32004679d3a512242c2b33d549bf5bbc8420ec1fd0850ed50eb6d0300000009536aac6a65acacab51ffffffffb843e44266ce2462f92e6bff54316661048c8c17ecb092cb493b39bfca9117850000000001519ab348c05e74ebc3f67423724a3371dd99e3bceb4f098f8860148f48ad70000313c4c223000000000653006565656512c2d8dc033f3c97010000000002636aa993aa010000000006526365ab526ab7cf560300000000076a0065ac6a526500000000", "005352535300ab6a", 2, 59531991, "8b5b3d00d9c658f062fe6c5298e54b1fe4ed3a3eab2a87af4f3119edc47b1691"],
|
||||
["233cd90b043916fc41eb870c64543f0111fb31f3c486dc72457689dea58f75c16ae59e9eb2000000000500536a6a6affffffff9ae30de76be7cd57fb81220fce78d74a13b2dbcad4d023f3cadb3c9a0e45a3ce000000000965ac6353ac5165515130834512dfb293f87cb1879d8d1b20ebad9d7d3d5c3e399a291ce86a3b4d30e4e32368a9020000000453005165ffffffff26d84ae93eb58c81158c9b3c3cbc24a84614d731094f38d0eea8686dec02824d0300000005636a65abacf02c784001a0bd5d03000000000900655351ab65ac516a416ef503", "", 1, -295106477, "b79f31c289e95d9dadec48ebf88e27c1d920661e50d090e422957f90ff94cb6e"],
|
||||
["9200e26b03ff36bc4bf908143de5f97d4d02358db642bd5a8541e6ff709c420d1482d471b70000000008abab65536a636553ffffffff61ba6d15f5453b5079fb494af4c48de713a0c3e7f6454d7450074a2a80cb6d880300000007ac6a00ab5165515dfb7574fbce822892c2acb5d978188b1d65f969e4fe874b08db4c791d176113272a5cc10100000000ffffffff0420958d000000000009ac63516a0063516353dd885505000000000465ac00007b79e901000000000066d8bf010000000005525252006a00000000", "ac5152", 0, 2089531339, "89ec7fab7cfe7d8d7d96956613c49dc48bf295269cfb4ea44f7333d88c170e62"],
|
||||
["45f335ba01ce2073a8b0273884eb5b48f56df474fc3dff310d9706a8ac7202cf5ac188272103000000025363ffffffff049d859502000000000365ab6a8e98b1030000000002ac51f3a80603000000000752535151ac00000306e30300000000020051b58b2b3a", "", 0, 1899564574, "78e01310a228f645c23a2ad0acbb8d91cedff4ecdf7ca997662c6031eb702b11"],
|
||||
["d8f652a6043b4faeada05e14b81756cd6920cfcf332e97f4086961d49232ad6ffb6bc6c097000000000453526563ffffffff1ea4d60e5e91193fbbc1a476c8785a79a4c11ec5e5d6c9950c668ceacfe07a15020000000352ab51fffffffffe029a374595c4edd382875a8dd3f20b9820abb3e93f877b622598d11d0b09e503000000095351000052ac515152ffffffff9d65fea491b979699ceb13caf2479cd42a354bd674ded3925e760758e85a756803000000046365acabffffffff0169001d00000000000651636a65656300000000", "ab0063630000ac", 3, 1050965951, "4cc85cbc2863ee7dbce15490d8ca2c5ded61998257b9eeaff968fe38e9f009ae"],
|
||||
["718662be026e1dcf672869ac658fd0c87d6835cfbb34bd854c44e577d5708a7faecda96e260300000004526a636a489493073353b678549adc7640281b9cbcb225037f84007c57e55b874366bb7b0fa03bdc00000000095165ababac65ac00008ab7f2a802eaa53d000000000007acac516aac526ae92f380100000000056aac00536500000000", "ab00", 1, 43296088, "2d642ceee910abff0af2116af75b2e117ffb7469b2f19ad8fef08f558416d8f7"],
|
||||
["94083c840288d40a6983faca876d452f7c52a07de9268ad892e70a81e150d602a773c175ad03000000007ec3637d7e1103e2e7e0c61896cbbf8d7e205b2ecc93dd0d6d7527d39cdbf6d335789f660300000000ffffffff019e1f7b03000000000800ac0051acac0053539cb363", "", 1, -183614058, "a17b66d6bb427f42653d08207a22b02353dd19ccf2c7de6a9a3a2bdb7c49c9e7"],
|
||||
["30e0d4d20493d0cd0e640b757c9c47a823120e012b3b64c9c1890f9a087ae4f2001ca22a61010000000152f8f05468303b8fcfaad1fb60534a08fe90daa79bff51675472528ebe1438b6f60e7f60c10100000009526aab6551ac510053ffffffffaaab73957ea2133e32329795221ed44548a0d3a54d1cf9c96827e7cffd1706df0200000009ab00526a005265526affffffffd19a6fe54352015bf170119742821696f64083b5f14fb5c7d1b5a721a3d7786801000000085265abababac53abffffffff020f39bd030000000004ab6aac52049f6c050000000004ab52516aba5b4c60", "6a6365516a6a655253", 0, -624256405, "8e221a6c4bf81ca0d8a0464562674dcd14a76a32a4b7baf99450dd9195d411e6"],
|
||||
["f9c69d940276ec00f65f9fe08120fc89385d7350388508fd80f4a6ba2b5d4597a9e21c884f010000000663ab63ababab15473ae6d82c744c07fc876ecd53bd0f3018b2dbedad77d757d5bdf3811b23d294e8c0170000000001abafababe00157ede2050000000006ac6a5263635300000000", "ab53", 1, 606547088, "714d8b14699835b26b2f94c58b6ea4c53da3f7adf0c62ea9966b1e1758272c47"],
|
||||
["5c0ac112032d6885b7a9071d3c5f493aa16c610a4a57228b2491258c38de8302014276e8be030000000300ab6a17468315215262ad5c7393bb5e0c5a6429fd1911f78f6f72dafbbbb78f3149a5073e24740300000003ac5100ffffffff33c7a14a062bdea1be3c9c8e973f54ade53fe4a69dcb5ab019df5f3345050be00100000008ac63655163526aab428defc0033ec36203000000000765516365536a00ae55b2000000000002ab53f4c0080400000000095265516a536563536a00000000", "6a005151006a", 2, 272749594, "91082410630337a5d89ff19145097090f25d4a20bdd657b4b953927b2f62c73b"],
|
||||
["e3683329026720010b08d4bec0faa244f159ae10aa582252dd0f3f80046a4e145207d54d31000000000852acac52656aacac3aaf2a5017438ad6adfa3f9d05f53ebed9ceb1b10d809d507bcf75e0604254a8259fc29c020000000653526552ab51f926e52c04b44918030000000000f7679c0100000000090000525152005365539e3f48050000000009516500ab635363ab008396c905000000000253650591024f", "6a6365", 0, 908746924, "458aec3b5089a585b6bad9f99fd37a2b443dc5a2eefac2b7e8c5b06705efc9db"],
|
||||
["48c4afb204204209e1df6805f0697edaa42c0450bbbd767941fe125b9bc40614d63d757e2203000000066a5363005152dc8b6a605a6d1088e631af3c94b8164e36e61445e2c60130292d81dabd30d15f54b355a802000000036a6353ffffffff1d05dcec4f3dedcfd02c042ce5d230587ee92cb22b52b1e59863f3717df2362f0300000005536552ac52ffffffffd4d71c4f0a7d53ba47bb0289ca79b1e33d4c569c1e951dd611fc9c9c1ca8bc6c030000000865536a65ab51abacffffffff042f9aa905000000000753655153656351ab93d8010000000002655337440e0300000000005d4c690000000000015278587acb", "ab006565526a51", 0, 1502064227, "bbed77ff0f808aa8abd946ba9e7ec1ddb003a969fa223dee0af779643cb841a9"],
|
||||
["00b20fd104dd59705b84d67441019fa26c4c3dec5fd3b50eca1aa549e750ef9ddb774dcabe000000000651ac656aac65ffffffff52d4246f2db568fc9eea143e4d260c698a319f0d0670f84c9c83341204fde48b0200000000ffffffffb8aeabb85d3bcbc67b132f1fd815b451ea12dcf7fc169c1bc2e2cf433eb6777a03000000086a51ac6aab6563acd510d209f413da2cf036a31b0def1e4dcd8115abf2e511afbcccb5ddf41d9702f28c52900100000006ac52ab6a0065ffffffff039c8276000000000008ab53655200656a52401561010000000003acab0082b7160100000000035100ab00000000", "535265", 1, -947367579, "3212c6d6dd8d9d3b2ac959dec11f4638ccde9be6ed5d36955769294e23343da0"],
|
||||
["455131860220abbaa72015519090a666faf137a0febce7edd49da1eada41feab1505a0028b02000000036365ab453ead4225724eb69beb590f2ec56a7693a608871e0ab0c34f5e96157f90e0a96148f3c502000000085251ab51535163acffffffff022d1249040000000009abac00acac6565630088b310040000000000e3920e59", "5152ab6a52ac5152", 0, 294375737, "c40fd7dfa72321ac79516502500478d09a35cc22cc264d652c7d18b14400b739"],
|
||||
["624d28cb02c8747915e9af2b13c79b417eb34d2fa2a73547897770ace08c6dd9de528848d3030000000651ab63abab533c69d3f9b75b6ef8ed2df50c2210fd0bf4e889c42477d58682f711cbaece1a626194bb85030000000765acab53ac5353ffffffff018cc280040000000009abacabac52636352ac6859409e", "ac51ac", 1, 1005144875, "919144aada50db8675b7f9a6849c9d263b86450570293a03c245bd1e3095e292"],
|
||||
["8f28471d02f7d41b2e70e9b4c804f2d90d23fb24d53426fa746bcdcfffea864925bdeabe3e0200000001acffffffff76d1d35d04db0e64d65810c808fe40168f8d1f2143902a1cc551034fd193be0e0000000001acffffffff048a5565000000000005005151516afafb610400000000045263ac53648bb30500000000086363516a6a5165513245de01000000000000000000", "6a0053510053", 1, -1525137460, "305fc8ff5dc04ebd9b6448b03c9a3d945a11567206c8d5214666b30ec6d0d6cc"],
|
||||
["10ec50d7046b8b40e4222a3c6449490ebe41513aad2eca7848284a08f3069f3352c2a9954f0000000009526aac656352acac53ffffffff0d979f236155aa972472d43ee6f8ce22a2d052c740f10b59211454ff22cb7fd00200000007acacacab63ab53ffffffffbbf97ebde8969b35725b2e240092a986a2cbfd58de48c4475fe077bdd493a20c010000000663ab5365ababffffffff4600722d33b8dba300d3ad037bcfc6038b1db8abfe8008a15a1de2da2264007302000000035351ac6dbdafaf020d0ccf04000000000663ab6a51ab6ae06e5e0200000000036aabab00000000", "", 0, -1658960232, "2420dd722e229eccafae8508e7b8d75c6920bfdb3b5bac7cb8e23419480637c2"],
|
||||
["fef98b7101bf99277b08a6eff17d08f3fcb862e20e13138a77d66fba55d54f26304143e5360100000006515365abab00ffffffff04265965030000000004655252ace2c775010000000001002b23b4040000000007516a5153ab53ac456a7a00000000000753ab525251acacba521291", "526aacacab00abab53", 0, -1614097109, "4370d05c07e231d6515c7e454a4e401000b99329d22ed7def323976fa1d2eeb5"],
|
||||
["34a2b8830253661b373b519546552a2c3bff7414ea0060df183b1052683d78d8f54e842442000000000152ffffffffd961a8e34cf374151058dfcddc86509b33832bc57267c63489f69ff01199697c0300000002abacba856cfb01b17c2f050000000008515365ac53ab000000000000", "5263ab656a", 1, -2104480987, "2f9993e0a84a6ca560d6d1cc2b63ffe7fd71236d9cfe7d809491cef62bbfad84"],
|
||||
["43559290038f32fda86580dd8a4bc4422db88dd22a626b8bd4f10f1c9dd325c8dc49bf479f01000000026351ffffffff401339530e1ed3ffe996578a17c3ec9d6fccb0723dd63e7b3f39e2c44b976b7b0300000006ab6a65656a51ffffffff6fb9ba041c96b886482009f56c09c22e7b0d33091f2ac5418d05708951816ce7000000000551ac525100ffffffff020921e40500000000035365533986f40500000000016a00000000", "52ac51", 0, 1769771809, "02040283ef2291d8e1f79bb71bdabe7c1546c40d7ed615c375643000a8b9600d"],
|
||||
["6878a6bd02e7e1c8082d5e3ee1b746cfebfac9e8b97e61caa9e0759d8a8ecb3743e36a30de0100000002ab532a911b0f12b73e0071f5d50b6bdaf783f4b9a6ce90ec0cad9eecca27d5abae188241ddec0200000001651c7758d803f7457b0500000000036551515f4e90000000000001007022080200000000035365acc86b6946", "6351ab", 0, -1929374995, "f24be499c58295f3a07f5f1c6e5084496ae160450bd61fdb2934e615289448f1"],
|
||||
["35b6fc06047ebad04783a5167ab5fc9878a00c4eb5e7d70ef297c33d5abd5137a2dea9912402000000036aacacffffffff21dc291763419a584bdb3ed4f6f8c60b218aaa5b99784e4ba8acfec04993e50c03000000046a00ac6affffffff69e04d77e4b662a82db71a68dd72ef0af48ca5bebdcb40f5edf0caf591bb41020200000000b5db78a16d93f5f24d7d932f93a29bb4b784febd0cbb1943f90216dc80bba15a0567684b000000000853ab52ab5100006a1be2208a02f6bdc103000000000265ab8550ea04000000000365636a00000000", "", 0, -1114114836, "1c8655969b241e717b841526f87e6bd68b2329905ba3fc9e9f72526c0b3ea20c"],
|
||||
["bebb90c302bf91fd4501d33555a5fc5f2e1be281d9b7743680979b65c3c919108cc2f517510100000003abab00ffffffff969c30053f1276550532d0aa33cfe80ca63758cd215b740448a9c08a84826f3303000000056565ab5153ffffffff04bf6f2a04000000000565ab5265ab903e760100000000026a6a7103fa020000000006526553525365b05b2c000000000006ab000000535300000000", "51510053ab63635153", 1, 1081291172, "94338cd47a4639be30a71e21a7103cee4c99ef7297e0edd56aaf57a068b004de"],
|
||||
["af48319f031b4eeb4319714a285f44244f283cbff30dcb9275b06f2348ccd0d7f015b54f8500000000066363ac65ac6affffffff2560a9817ebbc738ad01d0c9b9cf657b8f9179b1a7f073eb0b67517409d108180200000005ac6365ab52ffffffff0bdd67cd4ecae96249a2e2a96db1490ee645f042fd9d5579de945e22b799f4d003000000086552ab515153ab00cf187c8202e51abf0300000000066552006a00abadf37d000000000004ac6a535100000000", "63ab65", 1, -1855554446, "60caf46a7625f303c04706cec515a44b68ec319ee92273acb566cca4f66861c1"],
|
||||
["f35befbc03faf8c25cc4bc0b92f6239f477e663b44b83065c9cb7cf231243032cf367ce3130000000005ab65526a517c4c334149a9c9edc39e29276a4b3ffbbab337de7908ea6f88af331228bd90086a6900ba020000000151279d19950d2fe81979b72ce3a33c6d82ebb92f9a2e164b6471ac857f3bbd3c0ea213b542010000000953ab51635363520065052657c20300a9ba04000000000452636a6a0516ea020000000008535253656365ababcfdd3f01000000000865ac516aac00530000000000", "", 2, -99793521, "c834a5485e68dc13edb6c79948784712122440d7fa5bbaa5cd2fc3d4dac8185d"],
|
||||
["d3da18520216601acf885414538ce2fb4d910997eeb91582cac42eb6982c9381589587794f0300000000fffffffff1b1c9880356852e10cf41c02e928748dd8fae2e988be4e1c4cb32d0bfaea6f7000000000465ab6aabffffffff02fb0d69050000000002ababeda8580500000000085163526565ac52522b913c95", "ac", 1, -1247973017, "99b32b5679d91e0f9cdd6737afeb07459806e5acd7630c6a3b9ab5d550d0c003"],
|
||||
["8218eb740229c695c252e3630fc6257c42624f974bc856b7af8208df643a6c520ef681bfd00000000002510066f30f270a09b2b420e274c14d07430008e7886ec621ba45665057120afce58befca96010300000004525153ab84c380a9015d96100000000000076a5300acac526500000000", "ac005263", 0, -1855679695, "5071f8acf96aea41c7518bd1b5b6bbe16258b529df0c03f9e374b83c66b742c6"],
|
||||
["1123e7010240310013c74e5def60d8e14dd67aedff5a57d07a24abc84d933483431b8cf8ea0300000003530051fc6775ff1a23c627a2e605dd2560e84e27f4208300071e90f4589e762ad9c9fe8d0da95e020000000465655200ffffffff04251598030000000004ab65ab639d28d90400000000096563636aacac525153474df801000000000851525165ac51006a75e23b040000000000e5bd3a4a", "6363636565", 0, -467124448, "9cb0dd04e9fe287b112e94a1647590d27e8b164ca13c4fe70c610fd13f82c2fd"],
|
||||
["fd92fe1003083c5179f97e77bf7d71975788138147adbdb283306802e261c0aee080fa22630200000000860c643ba9a1816b9badf36077b4554d11720e284e395a1121bc45279e148b2064c65e49020000000651ab6a53636a2c713088d20f4bc4001264d972cce05b9fe004dc33376ad24d0d013e417b91a5f1b6734e000000000100ffffffff02e3064c0500000000066552006a5165b86e8705000000000665ab65ab53522052eadb", "00ab53525265", 0, 776203277, "47207b48777727532f62e09afcd4104ea6687e723c7657c30504fa2081331cc8"],
|
||||
["d1b6a703038f14d41fcc5cc45455faa135a5322be4bf0f5cbcd526578fc270a236cacb853f0200000001abffffffff135aeff902fa38f202ccf5bd34437ff89c9dc57a028b62447a0a38579383e8ef0000000000ffffffffadf398d2c818d0b90bc474f540c3618a4a643482eeab73d36101987e2ec0335900000000004bd3323504e69fc10000000000055151535251790ada02000000000563ab6aab521337a704000000000963ac63abacac52656a1e9862010000000007656500ac51ab6a8f4ee672", "ab5251656565ac63", 2, 82008394, "b8f3d255549909c07588ecba10a02e55a2d6f2206d831af9da1a7dae64cfbc8b"],
|
||||
["81dadaa7011556683db3fe95262f4fdb20391b7e75b7ffcee51b176af64d83c06f85545d620200000005ab5151ab52ffffffff044805ef0300000000065353516352639702c802000000000900516351515252ab5270db08040000000009ac516aab526553abac4aabc90500000000096365ab0052636a525100000000", "6565ab6a5152", 0, -2126294159, "ad01ec9d6dbae325ec3a8e1fd98e2d03b1188378210efef093dd8b0b0ef3f19d"],
|
||||
["3b937e05032b8895d2f4945cb7e3679be2fbd15311e2414f4184706dbfc0558cf7de7b4d000000000001638b91a12668a3c3ce349788c961c26aa893c862f1e630f18d80e7843686b6e1e6fc396310000000000852635353ab65ac51eeb09dd1c9605391258ee6f74b9ae17b5e8c2ef010dc721c5433dcdc6e93a1593e3b6d1700000000085365ac6553526351ffffffff0308b18e04000000000253acb6dd00040000000008536aac5153ac516ab0a88201000000000500ac006500804e3ff2", "", 0, 416167343, "595a3c02254564634e8085283ec4ea7c23808da97ce9c5da7aecd7b553e7fd7f"],
|
||||
["a48f27ca047997470da74c8ee086ddad82f36d9c22e790bd6f8603ee6e27ad4d3174ea875403000000095153ac636aab6aacabffffffffefc936294e468d2c9a99e09909ba599978a8c0891ad47dc00ba424761627cef202000000056a51630053ffffffff304cae7ed2d3dbb4f2fbd679da442aed06221ffda9aee460a28ceec5a9399f4e0200000000f5bddf82c9c25fc29c5729274c1ff0b43934303e5f595ce86316fc66ad263b96ca46ab8d0100000003536500d7cf226b0146b00c04000000000200ac5c2014ce", "515100636563", 0, 1991799059, "9c051a7092fe17fa62b1720bc2c4cb2ffc1527d9fb0b006d2e142bb8fe07bf3c"],
|
||||
["180cd53101c5074cf0b7f089d139e837fe49932791f73fa2342bd823c6df6a2f72fe6dba1303000000076a6a63ac53acabffffffff03853bc1020000000007ac526a6a6a6a003c4a8903000000000453515163a0fbbd030000000005ab656a5253253d64cf", "ac65", 0, -1548453970, "4d8efb3b99b9064d2f6be33b194a903ffabb9d0e7baa97a48fcec038072aac06"],
|
||||
["c21ec8b60376c47e057f2c71caa90269888d0ffd5c46a471649144a920d0b409e56f190b700000000008acac6a526a536365ffffffff5d315d9da8bf643a9ba11299450b1f87272e6030fdb0c8adc04e6c1bfc87de9a0000000000ea43a9a142e5830c96b0ce827663af36b23b0277244658f8f606e95384574b91750b8e940000000007516a63ac0063acffffffff023c61be0400000000055165ab5263313cc8020000000006006a53526551ed8c3d56", "6a", 1, 1160627414, "a638cc17fd91f4b1e77877e8d82448c84b2a4e100df1373f779de7ad32695112"],
|
||||
["128cd90f04b66a4cbc78bf48748f6eec0f08d5193ee8d0a6f2e8d3e5f138ed12c2c87d01a301000000085200ab6aac00ab00ffffffff09fc88bb1851e3dfb3d30179c38e15aeb1b39929c7c74f6acd071994ed4806490300000000e7fc5ea12ec56f56c0d758ecf4bb88aa95f3b08176b336db3b9bec2f6e27336dce28adbe030000000400530051fffffffffd6ff1adcf1fbe0d883451ee46904f1b7e8820243d395559b2d4ee8190a6e891000000000080fb1ae702f85b400000000000035200ab8d9651010000000006ab6a52536aab00000000", "ab", 1, 1667598199, "c10ccc9db8a92d7d4b133a2980782dab9d9d1d633d0dde9f9612ada57771fd89"],
|
||||
["da9695a403493d3511c10e1fe1286f954db0366b7667c91ef18ae4578056c1bf752114ac5901000000035351519788d91dd1f9c62dc005d80ea54eb13f7131ca5aace3d5d29f9b58ccc5fbc9a27e779950010000000453ac6a00ffffffffe2556ff29ebe83eb42a32c7a8d93bc598043578f491b5935805a33608538845a030000000252ab65d21b3b018f26c4030000000006acab51535352e1cbcb10", "006565ab52", 2, -1550927794, "0ca673a1ee66f9625ceb9ab278ebef772c113c188112b02824570c17fdf48194"],
|
||||
["b240517501334021240427adb0b413433641555424f6d24647211e3e6bfbb22a8045cbda2f000000000071bac8630112717802000000000000000000", "6a5165abac52656551", 0, 1790414254, "2c8be597620d95abd88f9c1cf4967c1ae3ca2309f3afec8928058c9598660e9e"],
|
||||
["96bac43903044a199b4b3efeeec5d196ee23fb05495541fa2cd6fb6405a9432d1723363660010000000151ffffffffe6ce2b66ce1488918a3e880bebb0e750123f007c7bcbac8fcd67ce75cb6fbae80300000000ffffffff9c0955aa07f506455834895c0c56be5a095398f47c62a3d431fe125b161d666a0200000005520000abac7ffdbc540216f2f004000000000165a26dce010000000001ab00000000", "5151ab656a656a6a63", 0, -707123065, "26b22e18d5d9081fde9631594a4f7c49069ed2e429f3d08caf9d834f685ccab2"],
|
||||
["b8fd394001ed255f49ad491fecc990b7f38688e9c837ccbc7714ddbbf5404f42524e68c18f0000000007ab6353535363ab081e15ee02706f7d050000000008515200535351526364c7ec040000000005636a53acac9206cbe1", "655352ac", 0, -1251578838, "8e0697d8cd8a9ccea837fd798cc6c5ed29f6fbd1892ee9bcb6c944772778af19"],
|
||||
["e42a76740264677829e30ed610864160c7f97232c16528fe5610fc08814b21c34eefcea69d010000000653006a6a0052ffffffff647046cf44f217d040e6a8ff3f295312ab4dd5a0df231c66968ad1c6d8f4428000000000025352ffffffff0199a7f900000000000000000000", "655263006a005163", 1, 1122505713, "7cda43f1ff9191c646c56a4e29b1a8c6cb3f7b331da6883ef2f0480a515d0861"],
|
||||
["0f034f32027a8e094119443aa9cfe11737c6d7dda9a52b839bc073dcc0235b847b28e0fab60200000006ac53ac536a63eee63447dfdad80476994b68706e916df1bd9d7cb4f3a4f6b14369de84564bea2e8688bd030000000565636a65acf8434663020b35fe01000000000800abab655163acabb3d6a103000000000353acab345eeda0", "526a51ac63ab51", 1, 66020215, "4435e62ff6531ac73529aac9cf878a7219e0b6e6cac79af8487c5355d1ad6d43"],
|
||||
["a2dfa4690214c1ab25331815a5128f143219de51a47abdc7ce2d367e683eeb93960a31af9f010000000363636affffffff8be0628abb1861b078fcc19c236bc4cc726fa49068b88ad170adb2a97862e7460200000004ac655363ffffffff0441f11103000000000153dbab0c000000000009ab53ac5365526aab63abbb95050000000004ab52516a29a029040000000003ac526a00000000", "6a52ac63", 1, -1302210567, "913060c7454e6c80f5ba3835454b54db2188e37dc4ce72a16b37d11a430b3d23"],
|
||||
["9dbc591f04521670af83fb3bb591c5d4da99206f5d38e020289f7db95414390dddbbeb56680100000004ac5100acffffffffb6a40b5e29d5e459f8e72d39f800089529f0889006cad3d734011991da8ef09d0100000009526a5100acab536a515fc427436df97cc51dc8497642ffc868857ee245314d28b356bd70adba671bd6071301fc0000000000ffffffff487efde2f620566a9b017b2e6e6d42525e4070f73a602f85c6dfd58304518db30000000005516353006a8d8090180244904a0200000000046a65656ab1e9c203000000000451ab63aba06a5449", "", 0, -1414953913, "bae189eb3d64aedbc28a6c28f6c0ccbd58472caaf0cf45a5aabae3e031dd1fea"],
|
||||
["1345fb2c04bb21a35ae33a3f9f295bece34650308a9d8984a989dfe4c977790b0c21ff9a7f0000000006ac52ac6a0053ffffffff7baee9e8717d81d375a43b691e91579be53875350dfe23ba0058ea950029fcb7020000000753ab53ab63ab52ffffffff684b6b3828dfb4c8a92043b49b8cb15dd3a7c98b978da1d314dce5b9570dadd202000000086353ab6a5200ac63d1a8647bf667ceb2eae7ec75569ca249fbfd5d1b582acfbd7e1fcf5886121fca699c011d0100000003ac006affffffff049b1eb00300000000001e46dc0100000000080065ab6a6a630065ca95b40300000000030051520c8499010000000006ab6aac526a6500000000", "53526aac636300", 2, 1809978100, "cfeaa36790bc398783d4ca45e6354e1ea52ee74e005df7f9ebd10a680e9607bf"],
|
||||
["7d75dc8f011e5f9f7313ba6aedef8dbe10d0a471aca88bbfc0c4a448ce424a2c5580cda1560300000003ab5152ffffffff01997f8e0200000000096552ac6a65656563530d93bbcc", "00656a6563", 0, 1414485913, "ec91eda1149f75bffb97612569a78855498c5d5386d473752a2c81454f297fa7"],
|
||||
["1459179504b69f01c066e8ade5e124c748ae5652566b34ed673eea38568c483a5a4c4836ca0100000008ac5352006563656affffffff5d4e037880ab1975ce95ea378d2874dcd49d5e01e1cdbfae3343a01f383fa35800000000095251ac52ac6aac6500ffffffff7de3ae7d97373b7f2aeb4c55137b5e947b2d5fb325e892530cb589bc4f92abd503000000086563ac53ab520052ffffffffb4db36a32d6e543ef49f4bafde46053cb85b2a6c4f0e19fa0860d9083901a1190300000003ab51531bbcfe5504a6dbda040000000008536a5365abac6500d660c80300000000096565abab6a53536a6a54e84e010000000003acac52df2ccf0500000000025351220c857e", "", 2, 1879181631, "3aad18a209fab8db44954eb55fd3cc7689b5ec9c77373a4d5f4dae8f7ae58d14"],
|
||||
["d98b777f04b1b3f4de16b07a05c31d79965579d0edda05600c118908d7cf642c9cd670093f020000000953005351ac65ab5363a268caad6733b7d1718008997f249e1375eb3ab9fe68ab0fe170d8e745ea24f54ce67f9b00000000066500516a5151ffffffff7ef8040dfcc86a0651f5907e8bfd1017c940f51cf8d57e3d3fe78d57e40b1e610200000003535263ffffffff39846cfed4babc098ff465256ba3820c30d710581316afcb67cd31c623b703360300000001acffffffff03d405120100000000056300006a5201a73d050000000004ab636a6a294c8c000000000006ac65536553ac00000000", "63525351abac", 1, 2018694761, "86970af23c89b72a4f9d6281e46b9ef5220816bed71ebf1ae20df53f38fe16ff"],
|
||||
["cabb1b06045a895e6dcfc0c1e971e94130c46feace286759f69a16d298c8b0f6fd0afef8f20300000004ac006352ffffffffa299f5edac903072bfb7d29b663c1dd1345c2a33546a508ba5cf17aab911234602000000056a65515365ffffffff89a20dc2ee0524b361231092a070ace03343b162e7162479c96b757739c8394a0300000002abab92ec524daf73fabee63f95c1b79fa8b84e92d0e8bac57295e1d0adc55dc7af5534ebea410200000001534d70e79b04674f6f00000000000600abacab53517d60cc0200000000035265ab96c51d040000000004ac6300ac62a787050000000008006a516563ab63639e2e7ff7", "6551ac6351ac", 3, 1942663262, "d0c4a780e4e0bc22e2f231e23f01c9d536b09f6e5be51c123d218e906ec518be"],
|
||||
["8b96d7a30132f6005b5bd33ea82aa325e2bcb441f46f63b5fca159ac7094499f380f6b7e2e00000000076aacabac6300acffffffff0158056700000000000465005100c319e6d0", "52006a", 0, -1100733473, "fb4bd26a91b5cf225dd3f170eb09bad0eac314bc1e74503cc2a3f376833f183e"],
|
||||
["112191b7013cfbe18a175eaf09af7a43cbac2c396f3695bbe050e1e5f4250603056d60910e02000000001c8a5bba03738a22010000000005525352656a77a149010000000002510003b52302000000000351ac52722be8e6", "65ac6565", 0, -1847972737, "8e795aeef18f510d117dfa2b9f4a2bd2e2847a343205276cedd2ba14548fd63f"],
|
||||
["ce6e1a9e04b4c746318424705ea69517e5e0343357d131ad55d071562d0b6ebfedafd6cb840100000003656553ffffffff67bd2fa78e2f52d9f8900c58b84c27ef9d7679f67a0a6f78645ce61b883fb8de000000000100d699a56b9861d99be2838e8504884af4d30b909b1911639dd0c5ad47c557a0773155d4d303000000046a5151abffffffff9fdb84b77c326921a8266854f7bbd5a71305b54385e747fe41af8a397e78b7fa010000000863acac6a51ab00ac0d2e9b9d049b8173010000000007ac53526a650063ba9b7e010000000008526a00525263acac0ab3fd030000000000ea8a0303000000000200aca61a97b9", "", 1, -1276952681, "b6ed4a3721be3c3c7305a5128c9d418efa58e419580cec0d83f133a93e3a22c5"],
|
||||
["a7721d94021652d90c79aaf5022d98219337d50f836382403ed313adb1116ba507ac28b0b0010000000551ac6300ab89e6d64a7aa81fb9595368f04d1b36d7020e7adf5807535c80d015f994cce29554fe869b01000000065353ab636500ffffffff024944c90100000000046300635369df9f01000000000000000000", "656a536551ab", 0, -1740151687, "935892c6f02948f3b08bcd463b6acb769b02c1912be4450126768b055e8f183a"],
|
||||
["2f7353dd02e395b0a4d16da0f7472db618857cd3de5b9e2789232952a9b154d249102245fd030000000151617fd88f103280b85b0a198198e438e7cab1a4c92ba58409709997cc7a65a619eb9eec3c0200000003636aabffffffff0397481c0200000000045300636a0dc97803000000000009d389030000000003ac6a53134007bb", "0000536552526a", 0, -1912746174, "30c4cd4bd6b291f7e9489cc4b4440a083f93a7664ea1f93e77a9597dab8ded9c"],
|
||||
["7d95473604fd5267d0e1bb8c9b8be06d7e83ff18ad597e7a568a0aa033fa5b4e1e2b6f1007020000000465006a6affffffffaee008503bfc5708bd557c7e78d2eab4878216a9f19daa87555f175490c40aaf000000000263abffffffffabd74f0cff6e7ceb9acc2ee25e65af1abcebb50c08306e6c78fa8171c37613dd010000000552acacababffffffff54a3069393f7930fa1b331cdff0cb945ec21c11d4605d8eedba1d3e094c6ae1f01000000026300ffffffff0182edeb050000000009526353ab5153530065a247e8cd", "51516aab00", 2, -426210430, "2707ca714af09494bb4cf0794abe33c6cba5f29891d619e76070269d1fa8e690"],
|
||||
["221d4718023d9ca9fe1af178dbfce02b2b369bf823ea3f43f00891b7fef98e215c06b94fdd000000000951005153ab000051acffffffffb1c7ad1c64b7441bf5e70cd0f6eb4ec96821d67fc4997d9e6dfdceadecd36dde01000000070051536a635153ffffffff04e883cd00000000000851ab536553ab0052bbb2f70400000000002f1b2e03000000000165259fcb00000000000010dbde99", "ab", 1, 665721280, "4abce77432a86dfe608e7c1646c18b5253a373392ff962e288e3ab96bba1ba1d"],
|
||||
["6f66c0b3013e6ae6aabae9382a4326df31c981eac169b6bc4f746edaa7fc1f8c796ef4e374000000000665ab6aabac6affffffff0191c8d6030000000002525300000000", "6a5352516a635352ab", 0, -1299629906, "48411efeb133c6b7fec4e7bdbe613f827093cb06ea0dbcc2ffcfde3a9ac4356c"],
|
||||
["89e7928c04363cb520eff4465251fd8e41550cbd0d2cdf18c456a0be3d634382abcfd4a2130200000006ac516a6a656355042a796061ed72db52ae47d1607b1ceef6ca6aea3b7eea48e7e02429f382b378c4e51901000000085351ab6352ab5252ffffffff53631cbda79b40183000d6ede011c778f70147dc6fa1aed3395d4ce9f7a8e69701000000096a6553ab52516a52abad0de418d80afe059aab5da73237e0beb60af4ac490c3394c12d66665d1bac13bdf29aa8000000000153f2b59ab6027a33eb040000000007005351ac5100ac88b941030000000003ab0052e1e8a143", "63656a", 0, 1258533326, "b575a04b0bb56e38bbf26e1a396a76b99fb09db01527651673a073a75f0a7a34"],
|
||||
["ca356e2004bea08ec2dd2df203dc275765dc3f6073f55c46513a588a7abcc4cbde2ff011c7020000000553525100003aefec4860ef5d6c1c6be93e13bd2d2a40c6fb7361694136a7620b020ecbaca9413bcd2a030000000965ac00536352535100ace4289e00e97caaea741f2b89c1143060011a1f93090dc230bee3f05e34fbd8d8b6c399010000000365526affffffff48fc444238bda7a757cb6a98cb89fb44338829d3e24e46a60a36d4e24ba05d9002000000026a53ffffffff03d70b440200000000056a6a526aac853c97010000000002515335552202000000000351635300000000", "0052", 3, -528192467, "fc93cc056c70d5e033933d730965f36ad81ef64f1762e57f0bc5506c5b507e24"],
|
||||
["82d4fa65017958d53e562fac073df233ab154bd0cf6e5a18f57f4badea8200b217975e31030200000004636aab51ac0891a204227cc9050000000006635200655365bfef8802000000000865650051635252acfc2d09050000000006ab65ac51516380195e030000000007ac52525352510063d50572", "53", 0, -713567171, "e095003ca82af89738c1863f0f5488ec56a96fb81ea7df334f9344fcb1d0cf40"],
|
||||
["75f6949503e0e47dd70426ef32002d6cdb564a45abedc1575425a18a8828bf385fa8e808e600000000036aabab82f9fd14e9647d7a1b5284e6c55169c8bd228a7ea335987cef0195841e83da45ec28aa2e0300000002516350dc6fe239d150efdb1b51aa288fe85f9b9f741c72956c11d9dcd176889963d699abd63f0000000001ab429a63f502777d20010000000007abac52ac516a53d081d9020000000003acac630c3cc3a8", "535152516551510000", 1, 973814968, "c6ec1b7cb5c16a1bfd8a3790db227d2acc836300534564252b57bd66acf95092"],
|
||||
["24f24cd90132b2162f938f1c22d3ca5e7daa83515883f31a61a5177aebf99d7db6bdfc398c010000000163ffffffff01d5562d0100000000016300000000", "5265ac5165ac5252ab", 0, 1055129103, "5eeb03e03806cd7bfd44bbba69c30f84c2c5120df9e68cd8facc605fcfbc9693"],
|
||||
["5ff2cac201423064a4d87a96b88f1669b33adddc6fa9acdc840c0d8a243671e0e6de49a5b00300000005ac6353655353b91db50180db5a03000000000663535151006a047a3aff", "52ab51ab5365005163", 0, -1336626596, "b8db8d57fe40ab3a99cf2f8ed57da7a65050fcc1d34d4280e25faf10108d3110"],
|
||||
["10011f150220ad76a50ccc7bb1a015eda0ff987e64cd447f84b0afb8dc3060bdae5b36a6900200000000ffffffff1e92dd814dfafa830187bc8e5b9258de2445ec07b02c420ee5181d0b203bb334000000000565ab536a65ffffffff0124e65401000000000800ab636553ab53ac00000000", "53abab0051", 0, 440222748, "c6675bf229737e005b5c8ffa6f81d9e2c4396840921b6151316f67c4315a4270"],
|
||||
["8b95ec900456648d820a9b8df1d8f816db647df8a8dc9f6e7151ebf6079d90ee3f6861352a02000000085200ab00ac535151ffffffff039b10b845f961225ac0bcaac4f5fe1991029a051aa3d06a3811b5762977a67403000000035252abffffffff8559d65f40d5e261f45aec8aad3d2c56c6114b22b26f7ee54a06f0881be3a7f5010000000765635252536363ffffffff38f8b003b50f6412feb2322b06b270197f81ad69c36af02ca5008b94eee5f650020000000165ffffffff01ae2b00010000000001638eb153a2", "0053ab5300ac53", 2, 1266056769, "205f3653f0142b35ce3ef39625442efebae98cde8cbf0516b97b51073bb0479f"],
|
||||
["babbb7ea01ab5d584727cb44393b17cf66521606dc81e25d85273be0d57bad43e8f6b6d43501000000036a656aba83a68803fb0f4a000000000005536353ab633fcfe4020000000009ac00acab6351006a65182a0c03000000000453ac5363bee74f44", "536a6a6a6365ac51ab", 0, -799187625, "3275e98dca37243b977525a07b5d8e369d6c3bdc08cb948029a635547d0d1a4e"],
|
||||
["e86a24bc03e4fae784cdf81b24d120348cb5e52d937cd9055402fdba7e43281e482e77a1c100000000046363006affffffffa5447e9bdcdab22bd20d88b19795d4c8fb263fbbf7ce8f4f9a85f865953a6325020000000663ac53535253ffffffff9f8b693bc84e0101fc73748e0513a8cecdc264270d8a4ee1a1b6717607ee1eaa00000000026a513417bf980158d82c020000000009005253005351acac5200000000", "6353516365536a6a", 2, -563792735, "508129278ef07b43112ac32faf00170ad38a500eed97615a860fd58baaad174b"],
|
||||
["53bd749603798ed78798ef0f1861b498fc61dcee2ee0f2b37cddb115b118e73bc6a5a47a0201000000096a63656a6aab6a000007ff674a0d74f8b4be9d2e8e654840e99d533263adbdd0cf083fa1d5dd38e44d2d163d900100000007abab5251ac6a51c8b6b63f744a9b9273ccfdd47ceb05d3be6400c1ed0f7283d32b34a7f4f0889cccf06be30000000009516a52636551ab516a9ac1fe63030c677e05000000000027bc610000000000086565636a635100526e2dc60200000000015300000000", "6552536a515351ab", 1, -1617066878, "fe516df92299e995b8e6489be824c6839543071ec5e9286060b2600935bf1f20"],
|
||||
["691bf9fc028ca3099020b79184e70039cf53b3c7b3fe695d661fd62d7b433e65feda2150610000000003ac63abffffffff2c814c15b142bc944192bddccb90a392cd05b968b599c1d8cd99a55a28a243fd0100000009ab5300526a5200abac98516a5803dfd3540500000000046552ac522838120100000000040053ab6a4409a903000000000665636a5300658759621b", "65ac5165ab", 0, -359941441, "d582c442e0ecc400c7ba33a56c93ad9c8cfd45af820350a13623594b793486f0"],
|
||||
["536bc5e60232eb60954587667d6bcdd19a49048d67a027383cc0c2a29a48b960dc38c5a0370300000005ac636300abffffffff8f1cfc102f39b1c9348a2195d496e602c77d9f57e0769dabde7eaaedf9c69e250100000006acabab6a6351ffffffff0432f56f0400000000046a5365517fd54b0400000000035265539484e4050000000003536a5376dc25020000000008ac536aab6aab536ab978e686", "ac0051006a006a006a", 0, -273074082, "f151f1ec305f698d9fdce18ea292b145a58d931f1518cf2a4c83484d9a429638"],
|
||||
["74606eba01c2f98b86c29ba5a32dc7a7807c2abe6ed8d89435b3da875d87c12ae05329e6070200000003510052ffffffff02a1e2c4020000000006516563526a63c68bae04000000000952ab6363ab00006363fe19ae4f", "63ababacac5365", 0, 112323400, "d1b1d79001b4a0324962607b739972d6f39c1493c4500ce814fd3bd72d32a5a0"],
|
||||
["2ed805e20399e52b5bcc9dc075dad5cf19049ff5d7f3de1a77aee9288e59c5f4986751483f020000000165ffffffff967531a5726e7a653a9db75bd3d5208fa3e2c5e6cd5970c4d3aba84eb644c72c0300000000ffffffffd79030d20c65e5f8d3c55b5692e5bdaa2ae78cfa1935a0282efb97515feac43f030000000400006365261ab88c02bdf66a000000000003ab6351d6ad8b000000000005525152abac00000000", "630053ab5265", 0, 2072814938, "1d25d16d84d5793be1ad5cda2de9c9cf70e04a66c3dae618f1a7ca4026198e7f"],
|
||||
["fab796ee03f737f07669160d1f1c8bf0800041157e3ac7961fea33a293f976d79ce49c02ab0200000003ac5252eb097ea1a6d1a7ae9dace338505ba559e579a1ee98a2e9ad96f30696d6337adcda5a85f403000000096500abab656a6a656396d5d41a9b11f571d91e4242ddc0cf2420eca796ad4882ef1251e84e42b930398ec69dd80100000005526551ac6a8e5d0de804f763bb0400000000015288271a010000000001acf2bf2905000000000300ab51c9641500000000000952655363636365ac5100000000", "00ac536552", 0, -1854521113, "f3bbab70b759fe6cfae1bf349ce10716dbc64f6e9b32916904be4386eb461f1f"],
|
||||
["f2b539a401e4e8402869d5e1502dbc3156dbce93583f516a4947b333260d5af1a34810c6a00200000003525363ffffffff01d305e2000000000005acab535200a265fe77", "", 0, -1435650456, "41617b27321a830c712638dbb156dae23d4ef181c7a06728ccbf3153ec53d7dd"],
|
||||
["9f10b1d8033aee81ac04d84ceee0c03416a784d1017a2af8f8a34d2f56b767aea28ff88c8f02000000025352ffffffff748cb29843bea8e9c44ed5ff258df1faf55fbb9146870b8d76454786c4549de100000000016a5ba089417305424d05112c0ca445bc7107339083e7da15e430050d578f034ec0c589223b0200000007abac53ac6565abffffffff025a4ecd010000000006636563ab65ab40d2700000000000056a6553526333fa296c", "", 0, -395044364, "20fd0eee5b5716d6cbc0ddf852614b686e7a1534693570809f6719b6fcb0a626"],
|
||||
["ab81755f02b325cbd2377acd416374806aa51482f9cc5c3b72991e64f459a25d0ddb52e66703000000036a00ab8727056d48c00cc6e6222be6608c721bc2b1e69d0ffbadd51d131f05ec54bcd83003aac5000000000003f2cdb60454630e020000000007526aac63000000e9e25c040000000003516a0088c97e0000000000076a535265655263771b5805000000000851ab00ac6565515100000000", "5151ab00ac", 0, -230931127, "ba0a2c987fcdd74b6915f6462f62c3f126a0750aa70048f7aa20f70726e6a20b"],
|
||||
["7a17e0ef0378dab4c601240639139335da3b7d684600fa682f59b7346ef39386fe9abd69350000000004ac5252ab807f26fb3249326813e18260a603b9ad66f41f05eaa8146f66bcca452162a502aac4aa8b02000000026a534ea460faa7e3d7854ec6c70d7e797025697b547ec500b2c09c873b4d5517767d3f3720660300000000ffffffff01b12e7a02000000000900ab006aab65656a63991c03e2", "6aab6a", 1, -1577994103, "62cd3413d9d819fb7355336365cf8a2a997f7436cc050a7143972044343b3281"],
|
||||
["ff2ecc09041b4cf5abb7b760e910b775268abee2792c7f21cc5301dd3fecc1b4233ee70a2c0200000009acac5300006a51526affffffffeb39c195a5426afff38379fc85369771e4933587218ef4968f3f05c51d6b7c92000000000165453a5f039b8dbef7c1ffdc70ac383b481f72f99f52b0b3a5903c825c45cfa5d2c0642cd50200000001654b5038e6c49daea8c0a9ac8611cfe904fc206dad03a41fb4e5b1d6d85b1ecad73ecd4c0102000000096a51000053ab656565bdb5548302cc719200000000000452655265214a3603000000000300ab6a00000000", "52516a006a63", 1, -2113289251, "37ed6fae36fcb3360c69cac8b359daa62230fc1419b2cf992a32d8f3e079dcff"],
|
||||
["70a8577804e553e462a859375957db68cfdf724d68caeacf08995e80d7fa93db7ebc04519d02000000045352ab53619f4f2a428109c5fcf9fee634a2ab92f4a09dc01a5015e8ecb3fc0d9279c4a77fb27e900000000006ab6a51006a6affffffff3ed1a0a0d03f25c5e8d279bb5d931b7eb7e99c8203306a6c310db113419a69ad010000000565516300abffffffff6bf668d4ff5005ef73a1b0c51f32e8235e67ab31fe019bf131e1382050b39a630000000004536a6563ffffffff02faf0bb00000000000163cf2b4b05000000000752ac635363acac15ab369f", "ac", 0, -1175809030, "1c9d6816c20865849078f9777544b5ddf37c8620fe7bd1618e4b72fb72dddca1"],
|
||||
["a3604e5304caa5a6ba3c257c20b45dcd468f2c732a8ca59016e77b6476ac741ce8b16ca8360200000004acac6553ffffffff695e7006495517e0b79bd4770f955040610e74d35f01e41c9932ab8ccfa3b55d0300000007ac5253515365acffffffff6153120efc5d73cd959d72566fc829a4eb00b3ef1a5bd3559677fb5aae116e38000000000400abab52c29e7abd06ff98372a3a06227386609adc7665a602e511cadcb06377cc6ac0b8f63d4fdb03000000055100acabacffffffff04209073050000000009ab5163ac525253ab6514462e05000000000952abacab636300656a20672c0400000000025153b276990000000000056565ab6a5300000000", "5351", 0, 1460890590, "249c4513a49076c6618aabf736dfd5ae2172be4311844a62cf313950b4ba94be"],
|
||||
["c6a72ed403313b7d027f6864e705ec6b5fa52eb99169f8ea7cd884f5cdb830a150cebade870100000009ac63ab516565ab6a51ffffffff398d5838735ff43c390ca418593dbe43f3445ba69394a6d665b5dc3b4769b5d700000000075265acab515365ffffffff7ee5616a1ee105fd18189806a477300e2a9cf836bf8035464e8192a0d785eea3030000000700ac6a51516a52ffffffff018075fd0000000000015100000000", "005251acac5252", 2, -656067295, "2cc1c7514fdc512fd45ca7ba4f7be8a9fe6d3318328bc1a61ae6e7675047e654"],
|
||||
["93c12cc30270fc4370c960665b8f774e07942a627c83e58e860e38bd6b0aa2cb7a2c1e060901000000036300abffffffff4d9b618035f9175f564837f733a2b108c0f462f28818093372eec070d9f0a5440300000001acffffffff039c2137020000000001525500990100000000055265ab636a07980e0300000000005ba0e9d1", "656a5100", 1, 18954182, "6beca0e0388f824ca33bf3589087a3c8ad0857f9fe7b7609ae3704bef0eb83e2"],
|
||||
["97bddc63015f1767619d56598ad0eb5c7e9f880b24a928fea1e040e95429c930c1dc653bdb0100000008ac53acac00005152aaa94eb90235ed10040000000000287bdd0400000000016a8077673a", "acac6a536352655252", 0, -813649781, "5990b139451847343c9bb89cdba0e6daee6850b60e5b7ea505b04efba15f5d92"],
|
||||
["cc3c9dd303637839fb727270261d8e9ddb8a21b7f6cbdcf07015ba1e5cf01dc3c3a327745d0300000000d2d7804fe20a9fca9659a0e49f258800304580499e8753046276062f69dbbde85d17cd2201000000096352536a520000acabffffffffbc75dfa9b5f81f3552e4143e08f485dfb97ae6187330e6cd6752de6c21bdfd21030000000600ab53650063ffffffff0313d0140400000000096565515253526aacac167f0a040000000008acab00535263536a9a52f8030000000006abab5151ab63f75b66f2", "6a635353636a65ac65", 1, 377286607, "dbc7935d718328d23d73f8a6dc4f53a267b8d4d9816d0091f33823bd1f0233e9"],
|
||||
["236f91b702b8ffea3b890700b6f91af713480769dda5a085ae219c8737ebae90ff25915a3203000000056300ac6300811a6a10230f12c9faa28dae5be2ebe93f37c06a79e76214feba49bb017fb25305ff84eb020000000100ffffffff041e351703000000000351ac004ff53e050000000003ab53636c1460010000000000cb55f701000000000651520051ab0000000000", "acac636a6aac5300", 0, 406448919, "793a3d3c37f6494fab79ff10c16702de002f63e34be25dd8561f424b0ea938c4"],
|
||||
["22e10d2003ab4ea9849a2801921113583b7c35c3710ff49a6003489395789a7cfb1e6051900100000006526a65535151ffffffff82f21e249ec60db33831d33b9ead0d56f6496db64337dcb7f1c3327c47729c4a020000000253abffffffff138f098f0e6a4cf51dc3e7a3b749f487d1ebde71b73b731d1d02ad1180ac7b8c02000000036563acda215011027a9484020000000007635165530000ac4bf6cb0400000000066aacabab65ab3ce3f32c", "ab0052ab", 2, 1136359457, "b5bd080bbcb8cd652f440484311d7a3cb6a973cd48f03c5c00fd6beb52dfc061"],
|
||||
["c47d5ad60485cb2f7a825587b95ea665a593769191382852f3514a486d7a7a11d220b62c54000000000663655253acab8c3cf32b0285b040e50dcf6987ddf7c385b3665048ad2f9317b9e0c5ba0405d8fde4129b00000000095251ab00ac65635300ffffffff549fe963ee410d6435bb2ed3042a7c294d0c7382a83edefba8582a2064af3265000000000152fffffffff7737a85e0e94c2d19cd1cde47328ece04b3e33cd60f24a8a345da7f2a96a6d0000000000865ab6a0051656aab28ff30d5049613ea020000000005ac51000063f06df1050000000008ac63516aabac5153afef5901000000000700656500655253688bc00000000000086aab5352526a53521ff1d5ff", "51ac52", 2, -1296011911, "0c1fd44476ff28bf603ad4f306e8b6c7f0135a441dc3194a6f227cb54598642a"],
|
||||
["0b43f122032f182366541e7ee18562eb5f39bc7a8e5e0d3c398f7e306e551cdef773941918030000000863006351ac51acabffffffffae586660c8ff43355b685dfa8676a370799865fbc4b641c5a962f0849a13d8250100000005abab63acabffffffff0b2b6b800d8e77807cf130de6286b237717957658443674df047a2ab18e413860100000008ab6aac655200ab63ffffffff04f1dbca03000000000800635253ab656a52a6eefd0300000000036365655d8ca90200000000005a0d530400000000015300000000", "65ac65acac", 0, 351448685, "86f26e23822afd1bdfc9fff92840fc1e60089f12f54439e3ab9e5167d0361dcf"],
|
||||
["4b0ecc0c03ba35700d2a30a71f28e432ff6ac7e357533b49f4e97cf28f1071119ad6b97f3e0300000008acab516363ac63acffffffffcd6a2019d99b5c2d639ddca0b1aa5ea7c1326a071255ea226960bd88f45ca57d00000000085253655363005353ffffffffba257635191c9f216de3277be548cb5a2313114cb1a4c563b03b4ef6c0f4f7040300000001abda542edf0495cdc40100000000026353c049e903000000000752516a53ab65512b0f9304000000000963ab516aac65516552fa9ece050000000009acab6500005152530000000000", "65ab51525352510052", 1, -1355414590, "3cd85f84aae6d702436f3f9b8980adcc1f8f202e957759540a27da0a32fc6c87"],
|
||||
["adaac0a803f66811346271c733036d6e0d45e15a9b602092e2e04ad93564f196e7f020b088000000000600526a636a00700ec3f9db07a3a6ce910bf318c7ec87a876e1f2a3366cc69f20cde09203b99c1cb9d15800000000050000ac636a4d0de554ebe95c6cc14faf5ff6361d1deba9474b8b0fd3b93c011cd96aec783abb3f36830200000005ab65005251ffffffff0464eb10050000000007520000ab6a65ab1beaa80300000000005a2f31050000000006526aab65ac52ba7db10000000000045251ab6a0cfb46e7", "ab0051ac52636a", 1, -184733716, "961ff413850336d3987c550404fc1d923266ca36cc9ffee7113edb3a9fea7f30"],
|
||||
["af1c4ab301ec462f76ee69ba419b1b2557b7ded639f3442a3522d4f9170b2d6859765c3df402000000016affffffff01a5ca6c000000000008ab52536aab00005300000000", "6a6351", 0, 110304602, "e88ed2eea9143f2517b15c03db00767eb01a5ce12193b99b964a35700607e5f4"],
|
||||
["0bfd34210451c92cdfa02125a62ba365448e11ff1db3fb8bc84f1c7e5615da40233a8cd368010000000252ac9a070cd88dec5cf9aed1eab10d19529720e12c52d3a21b92c6fdb589d056908e43ea910e0200000009ac516a52656a6a5165ffffffffc3edcca8d2f61f34a5296c405c5f6bc58276416c720c956ff277f1fb81541ddd00000000030063abffffffff811247905cdfc973d179c03014c01e37d44e78f087233444dfdce1d1389d97c302000000065163000063ab1724a26e02ca37c902000000000851ab53525352ac529012a90100000000085200525253535353fa32575b", "5352ac6351", 1, -1087700448, "b8f1e1f35e3e1368bd17008c756e59cced216b3c699bcd7bebdb5b6c8eec4697"],
|
||||
["2c84c0640487a4a695751d3e4be48019dbaea85a6e854f796881697383ea455347d2b2769001000000055265526500ffffffff6aac176d8aa00778d496a7231eeb7d3334f20c512d3db1683276402100d98de5030000000700536a5263526ac1ee9ceb171c0c984ebaf12c234fd1487fbf3b3d73aa0756907f26837efba78d1bed33200300000001ab4d9e8ec0bed837cb929bbed76ee848959cec59de44bd7667b7631a744f880d5c71a20cfd0100000007005363515300abffffffff023753fb0000000000036565532d3873050000000009005152ab6a63acab5200000000", "ab650053ab", 0, -877941183, "c49af297dffe2d80deddf10ceea84b99f8554bd2d55bbdc34e449728c31f0835"],
|
||||
["1f7e4b1b045d3efa6cd7a11d7873a8bab886c19bd11fcb6712f0948f2db3a7be76ff76c8f100000000095265ab6a0065ac5363ffffffffdaafcfa6029336c997680a541725190f09a6f6da21e54560eca4b5b8ae987da1000000000952ac52acac52515165ffffffff825a38d3b1e5bb4d10f33653ab3ab6882c7abdaec74460257d1528ce7be3f98e0100000007526a006a656a63c14adc8f04953a5d3d3f89237f38b857dd357713896d36215f7e8b77b11d98ea3cdc93df02000000015212484f6104bfafae0300000000025263a2b0120000000000056563ab00516c4d2605000000000653ac6500655301cc93030000000002acab14643b1f", "63acac53ab", 0, 333824258, "18da6ceb011cd36f15ad7dd6c55ef07e6f6ed48881ce3bb31416d3c290d9a0e9"],
|
||||
["467a3e7602e6d1a7a531106791845ec3908a29b833598e41f610ef83d02a7da3a1900bf2960000000005ab6a636353ffffffff031db6dac6f0bafafe723b9199420217ad2c94221b6880654f2b35114f44b1df010000000965ab52636a63ac6352ffffffff02b3b95c0100000000026300703216030000000001ab3261c0aa", "6a", 0, 2110869267, "3078b1d1a7713c6d101c64afe35adfae0977a5ab4c7e07a0b170b041258adbf2"],
|
||||
["8713bc4f01b411149d575ebae575f5dd7e456198d61d238695df459dd9b86c4e3b2734b62e0300000004abac6363ffffffff03b58049050000000002ac653c714c04000000000953656a005151526a527b5a9e03000000000652ac5100525300000000", "52", 0, -647281251, "0e0bed1bf2ff255aef6e5c587f879ae0be6222ab33bd75ee365ec6fbb8acbe38"],
|
||||
["f2ba8a8701b9c401efe3dd0695d655e20532b90ac0142768cee4a3bb0a89646758f544aa8102000000036a52527899f4e4040c6f0b030000000008636565ab530051ab52b60c000000000009515200ab630053ac53a49c5f040000000008ab53ab516300ab63fa27340300000000015100000000", "ac63abab5251", 0, -1328936437, "ab61497afd39e61fe06bc5677326919716f9b20083c9f3417dcea905090e0411"],
|
||||
["b5a7df6102107beded33ae7f1dec0531d4829dff7477260925aa2cba54119b7a07d92d5a1d02000000046a516a52803b625c334c1d2107a326538a3db92c6c6ae3f7c3516cd90a09b619ec6f58d10e77bd6703000000056563006a63ffffffff0117484b03000000000853acab52526a65abc1b548a1", "ac006a525100", 0, 2074359913, "680336db57347d8183b8898cd27a83f1ba5884155aeae5ce20b4840b75e12871"],
|
||||
["278cb16204b9dadf400266106392c4aa9df01ba03af988c8139dae4c1818ac009f13fc5f1a00000000065200ac656a52ffffffffd006bbebd8cbd7bdead24cddc9badfcc6bc0c2e63c037e5c29aa858f5d0f3e7d01000000046a0051acffffffffbc62a5f57e58da0b67956003ae81ac97cb4cbd1d694c914fc41515c008c4d8fd020000000165e329c844bcc16164be64b64a81cbf4ffd41ed2934e0daa0040ccb8365bab0b2a9e401c180300000003ab52abffffffff02588460030000000000a25a12030000000005535100005300000000", "6553ab6a5300acab51", 3, 989407546, "1c29f110576f4a3b257f67454d99dfc0dee62ef5517ca702848ce4bd2ea1a1d7"],
|
||||
["49eb2178020a04fca08612c34959fd41447319c190fb7ffed9f71c235aa77bec28703aa1820200000003ac6353abaff326071f07ec6b77fb651af06e8e8bd171068ec96b52ed584de1d71437fed186aecf0300000001acffffffff03da3dbe02000000000652ac63ac6aab8f3b680400000000096a536a65636a53516a5175470100000000016500000000", "6a536365", 0, 1283691249, "c670219a93234929f662ecb9aa148a85a2d281e83f4e53d10509461cdea47979"],
|
||||
["0f96cea9019b4b3233c0485d5b1bad770c246fe8d4a58fb24c3b7dfdb3b0fd90ea4e8e947f0300000006006a5163515303571e1e01906956030000000005ab635353abadc0fbbe", "acac", 0, -1491469027, "716a8180e417228f769dcb49e0491e3fda63badf3d5ea0ceeac7970d483dd7e2"],
|
||||
["9a7d858604577171f5fe3f3fd3e5e039c4b0a06717a5381e9977d80e9f53e025e0f16d2877020000000752636565536353ffffffff5862bd028e8276e63f044be1dddcbb8d0c3fa097678308abf2b0f45104a93dbd0100000001531200667ba8fdd3b28e98a35da73d3ddfe51e210303d8eb580f923de988ee632d77793892030000000752526363526563ffffffffe9744eb44db2658f120847c77f47786d268c302120d269e6004455aa3ea5f5e20200000009ab6300636aab656551ffffffff03c61a3c020000000009ab516a6aab6aab53ab737f1a05000000000853acabab655365ab92a4a00400000000016367edf6c8", "535352ab", 3, 659348595, "d36ee79fc80db2e63e05cdc50357d186181b40ae20e3720878284228a13ee8b3"],
|
||||
["148e68480196eb52529af8e83e14127cbfdbd4a174e60a86ac2d86eac9665f46f4447cf7aa01000000045200ac538f8f871401cf240c0300000000065252ab52656a5266cf61", "", 0, -344314825, "eacc47c5a53734d6ae3aedbc6a7c0a75a1565310851b29ef0342dc4745ceb607"],
|
||||
["e2bc29d4013660631ba14ecf75c60ec5e9bed7237524d8c10f66d0675daa66d1492cb834530200000004ac510065e42d0c9e04f2b26c01000000000951525152acac65ababa35b7504000000000953ac6aac00650053ab94688c0400000000056365526553a1bced0300000000016a00000000", "65ab0063655353", 0, -888431789, "59a34b3ed3a1cce0b104de8f7d733f2d386ffc7445efae67680cd90bc915f7e0"],
|
||||
["0c8a70d70494dca6ab05b2bc941b5b431c43a292bd8f2f02eab5e240a408ca73a676044a4103000000056a51ab006affffffff84496004e54836c035821f14439149f22e1db834f315b24588ba2f031511926c0100000000ffffffffbbc5e70ed1c3060ba1bfe99c1656a3158a7307c3ce8eb362ec32c668596d2bd30000000009636563635351abab00b039344c6fc4f9bec24322e45407af271b2d3dfec5f259ee2fc7227bc5285e22b3be85b40100000009ac00ab53abac6a5352e5ddfcff02d50231020000000005006a51536ab086d9020000000006ababac51ac6a00000000", "abab636565acac6a", 3, 241546088, "643a7b4c8d832e14d5c10762e74ec84f2c3f7ed96c03053157f1bed226614911"],
|
||||
["f98f79cf0274b745e1d6f36da7cbe205a79132a7ad462bdc434cfb1dcd62a6977c3d2a5dbc010000000553516a5365ffffffff4f89f485b53cdad7fb80cc1b7e314b9735b9383bc92c1248bb0e5c6173a55c0d010000000353655293f9b014045ad96d02000000000963ac526a53ac636365f4c27904000000000952536563635152526a2788f0030000000002516aff5add01000000000863530051655351abd04716ba", "ab6552536a53", 1, -2128899945, "56d29f5e300ddfed2cd8dcce5d79826e193981d0b70dc7487772c8a0b3b8d7b1"],
|
||||
["6c7913f902aa3f5f939dd1615114ce961beda7c1e0dd195be36a2f0d9d047c28ac62738c3a020000000453abac00ffffffff477bf2c5b5c6733881447ac1ecaff3a6f80d7016eee3513f382ad7f554015b970100000007ab6563acab5152ffffffff04e58fe1040000000009ab00526aabab526553e59790010000000002ab525a834b03000000000035fdaf0200000000086551ac65515200ab00000000", "63ac53", 1, 1285478169, "1536da582a0b6de017862445e91ba14181bd6bf953f4de2f46b040d351a747c9"],
|
||||
["4624aa9204584f06a8a325c84e3b108cafb97a387af62dc9eab9afd85ae5e2c71e593a3b690200000003636a005eb2b44eabbaeca6257c442fea00107c80e32e8715a1293cc164a42e62ce14fea146220c020000000090b9ee38106e3310037bfc519fd209bdbd21c588522a0e96df5fba4e979392bc993bfe9f01000000086363636a635353ab6f1907d218ef6f3c729d9200e23c1dbff2df58b8b1282c6717b26cf760ee4c880d23f4d100000000086a516a536a525163ffffffff01d6f162050000000000ebbab208", "525365ab0053", 1, -1515409325, "6cf9cd409b7185b1f118171f0a34217af5b612ea54195ea186505b667c19337f"],
|
||||
["16562fc503f1cf9113987040c408bfd4523f1512da699a2ca6ba122dc65677a4c9bf7763830000000003636552ffffffff1ec1fab5ff099d1c8e6b068156f4e39b5543286bab53c6d61e2582d1e07c96cf02000000045163656affffffffd0ef40003524d54c08cb4d13a5ee61c84fbb28cde9eca7a6d11ba3a9335d8c620100000007635153536a6300fbb84fc2012003a601000000000363ab6a00000000", "63636a006a6aab", 0, -1310262675, "1efbf3d37a92bc03d9eb950b792f307e95504f7c4998f668aa250707ebb752ac"],
|
||||
["531665d701f86bacbdb881c317ef60d9cd1baeffb2475e57d3b282cd9225e2a3bf9cbe0ded01000000086300ac515263acabffffffff0453a8500100000000086353acab516a6565e5e9200500000000026a52a44caa00000000000453ac000065e41b0500000000076500ac0065526ab4476f4d", "006563006aab00636a", 0, 1770013777, "0898b26dd3ca08632a5131fa48eb55b44386d0c5070c24d6e329673d5e3693b8"],
|
||||
["0f1227a20140655a3da36e413b9b5d108a866f6f147eb4940f032f5a89854eae6d7c3a91600100000009525363515153515253e37a79480161ab61020000000001ab00000000", "ab65005200", 0, -1996383599, "979782dc3f36d908d37d7e4046a38d306b4b08ddc60a5eba355fe3d6da1b29a9"],
|
||||
["063ff6eb01aff98d0d2a6db224475010edb634c2f3b46257084676adeb84165a4ff8558d7601000000066353006a5165deb3262c042d109c0000000000076363ab52ac005200b9c4050000000007516300ac510063cfffc800000000000200639e815501000000000700526a52ac6365ac7b07b8", "656552abac6500", 0, -1559847112, "674a4bcb04247f8dc98780f1792cac86b8aee41a800fc1e6f5032f6e1dccde65"],
|
||||
["3320f6730132f830c4681d0cae542188e4177cad5d526fae84565c60ceb5c0118e844f90bd030000000163ffffffff0257ec5a040000000005525251ac6538344d000000000002515200000000", "5352656a53ac516a65", 0, 788050308, "3afacaca0ef6be9d39e71d7b1b118994f99e4ea5973c9107ca687d28d8eba485"],
|
||||
["c13aa4b702eedd7cde09d0416e649a890d40e675aa9b5b6d6912686e20e9b9e10dbd40abb1000000000863ab6353515351ac11d24dc4cc22ded7cdbc13edd3f87bd4b226eda3e4408853a57bcd1becf2df2a1671fd1600000000045165516affffffff01baea300100000000076aab52ab53005300000000", "0065", 0, -1195908377, "241a23e7b1982d5f78917ed97a8678087acbbffe7f624b81df78a5fe5e41e754"],
|
||||
["d9a6f20e019dd1b5fae897fb472843903f9c3c2293a0ffb59cff2b413bae6eceab574aaf9d030000000663ab006a515102f54939032df5100100000000056a51ab65530ec28f010000000004ac5100007e874905000000000651005265ac6a00000000", "abacab63acacabab", 0, 271463254, "1326a46f4c21e7619f30a992719a905aa1632aaf481a57e1cbd7d7c22139b41e"],
|
||||
["157c81bf0490432b3fcb3f9a5b79e5f91f67f05efb89fa1c8740a3fe7e9bdc18d7cb6acd2203000000026351ffffffff912e48e72bbcf8a540b693cf8b028e532a950e6e63a28801f6eaad1afcc52ad00000000000b1a4b170a2b9e60e0cad88a0085137309f6807d25d5afb5c1e1d32aa10ba1cdf7df596dd0000000009525165656a51ab65ab3674fba32a76fe09b273618d5f14124465933f4190ba4e0fd09d838daafc6223b31642ac00000000086a53536551ac6565ffffffff01fe9fb6030000000008ab51656a5165636a00000000", "ab00ab6a6551", 3, -64357617, "1ddaab7f973551d71f16bd70c4c4edbf7225e64e784a6da0ee7f7a9fe4f12a0b"],
|
||||
["a2692fff03b2387f5bacd5640c86ba7df574a0ee9ed7f66f22c73cccaef3907eae791cbd230200000004536363abffffffff4d9fe7e5b375de88ba48925d9b2005447a69ea2e00495a96eafb2f144ad475b40000000008000053000052636537259bee3cedd3dcc07c8f423739690c590dc195274a7d398fa196af37f3e9b4a1413f810000000006ac63acac52abffffffff04c65fe60200000000075151536365ab657236fc020000000009005263ab00656a6a5195b8b6030000000007ac5165636aac6a7d7b66010000000002acab00000000", "51", 2, -826546582, "925037c7dc7625f3f12dc83904755a37016560de8e1cdd153c88270a7201cf15"],
|
||||
["2c5b003201b88654ac2d02ff6762446cb5a4af77586f05e65ee5d54680cea13291efcf930d0100000005ab536a006a37423d2504100367000000000004536a515335149800000000000152166aeb03000000000452510063226c8e03000000000000000000", "635251", 0, 1060344799, "7e058ca5dd07640e4aae7dea731cfb7d7fef1bfd0d6d7b6ce109d041f4ca2a31"],
|
||||
["f981b9e104acb93b9a7e2375080f3ea0e7a94ce54cd8fb25c57992fa8042bdf4378572859f0100000002630008604febba7e4837da77084d5d1b81965e0ea0deb6d61278b6be8627b0d9a2ecd7aeb06a0300000005ac5353536a42af3ef15ce7a2cd60482fc0d191c4236e66b4b48c9018d7dbe4db820f5925aad0e8b52a0300000008ab0063510052516301863715efc8608bf69c0343f18fb81a8b0c720898a3563eca8fe630736c0440a179129d03000000086aac6a52ac6a63ac44fec4c00408320a03000000000062c21c030000000007ac6a655263006553835f0100000000015303cd60000000000005535263536558b596e0", "00", 0, -2140385880, "49870a961263354c9baf108c6979b28261f99b374e97605baa532d9fa3848797"],
|
||||
["e7416df901269b7af14a13d9d0507709b3cd751f586ce9d5da8d16a121e1bd481f5a086e1103000000056aab005200ffffffff01aa269c040000000006acac6a6a5263ee718de6", "ab525363", 0, 1309186551, "eea7d2212bda2d408fff146f9ae5e85e6b640a93b9362622bb9d5e6e36798389"],
|
||||
["402a815902193073625ab13d876190d1bbb72aecb0ea733c3330f2a4c2fe6146f322d8843a0300000008656aab0000535363fffffffff9dccdec5d8509d9297d26dfcb1e789cf02236c77dc4b90ebccbf94d1b5821150300000001510bf1f96a03c5c145000000000002ac6ae11b1c0100000000055163516a5239c8a600000000000365636300000000", "63536aacab", 0, -1811424955, "0090803a20102a778ab967a74532faee13e03b702083b090b1497bc2267ee2fe"],
|
||||
["c4b702e502f1a54f235224f0e6de961d2e53b506ab45b9a40805d1dacd35148f0acf24ca5e00000000085200ac65ac53acabf34ba6099135658460de9d9b433b84a8562032723635baf21ca1db561dce1c13a06f4407000000000851ac006a63516aabffffffff02a853a603000000000163d17a67030000000005ab63006a5200000000", "ac5363515153", 1, 480734903, "5c46f7ac3d6460af0da28468fcc5b3c87f2b9093d0f837954b7c8174b4d7b6e7"],
|
||||
["9b83f78704f492b9b353a3faad8d93f688e885030c274856e4037818848b99e490afef27770200000000ffffffff36b60675a5888c0ef4d9e11744ecd90d9fe9e6d8abb4cff5666c898fdce98d9e00000000056aab656352596370fca7a7c139752971e169a1af3e67d7656fc4fc7fd3b98408e607c2f2c836c9f27c030000000653ac51ab6300a0761de7e158947f401b3595b7dc0fe7b75fa9c833d13f1af57b9206e4012de0c41b8124030000000953656a53ab53510052242e5f5601bf83b301000000000465516a6300000000", "63515200ac656365", 3, -150879312, "9cf05990421ea853782e4a2c67118e03434629e7d52ab3f1d55c37cf7d72cdc4"],
|
||||
["f492a9da04f80b679708c01224f68203d5ea2668b1f442ebba16b1aa4301d2fe5b4e2568f3010000000953005351525263ab65ffffffff93b34c3f37d4a66df255b514419105b56d7d60c24bf395415eda3d3d8aa5cd0101000000020065ffffffff9dba34dabdc4f1643b372b6b77fdf2b482b33ed425914bb4b1a61e4fad33cf390000000002ab52ffffffffbbf3dc82f397ef3ee902c5146c8a80d9a1344fa6e38b7abce0f157be7adaefae0000000009515351005365006a51ffffffff021359ba010000000000403fea0200000000095200ac6353abac635300000000", "00ac51acacac", 0, -2115078404, "fd44fc98639ca32c927929196fc3f3594578f4c4bd248156a25c04a65bf3a9f3"],
|
||||
["2f73e0b304f154d3a00fde2fdd40e791295e28d6cb76af9c0fd8547acf3771a02e3a92ba37030000000852ac6351ab6565639aa95467b065cec61b6e7dc4d6192b5536a7c569315fb43f470078b31ed22a55dab8265f02000000080065636a6aab6a53ffffffff9e3addbff52b2aaf9fe49c67017395198a9b71f0aa668c5cb354d06c295a691a0100000000ffffffff45c2b4019abaf05c5e484df982a4a07459204d1343a6ee5badade358141f8f990300000007ac516a6aacac6308655cd601f3bc2f0000000000015200000000", "", 0, -2082053939, "9a95e692e1f78efd3e46bb98f178a1e3a0ef60bd0301d9f064c0e5703dc879c2"],
|
||||
["5a60b9b503553f3c099f775db56af3456330f1e44e67355c4ab290d22764b9144a7b5f959003000000030052acbd63e0564decc8659aa53868be48c1bfcda0a8c9857b0db32a217bc8b46d9e7323fe9649020000000553ac6551abd0ecf806211db989bead96c09c7f3ec5f73c1411d3329d47d12f9e46678f09bac0dc383e0200000000ffffffff01494bb202000000000500516551ac00000000", "ac", 0, 1169947809, "62a36c6e8da037202fa8aeae03e533665376d5a4e0a854fc4624a75ec52e4eb1"],
|
||||
["7e98d353045569c52347ca0ff2fdba608829e744f61eb779ffdb5830aae0e6d6857ab2690e03000000075365acab656352ffffffffa890dd37818776d12da8dca53d02d243ef23b4535c67016f4c58103eed85360f030000000093dbacdc25ca65d2951e047d6102c4a7da5e37f3d5e3c8b87c29b489360725dcd117ee2003000000056a6300ac53c7e99fa1dc2b8b51733034e6555f6d6de47dbbf1026effac7db80cb2080678687380dc1e02000000075352005263516affffffff04423272040000000008ab6353ab65510051e0f53b0500000000086300516552635152f74a5f04000000000853acab0053ab52ab0e8e5f00000000000951ac5363516a6aabab00000000", "6a5163ab52", 3, 890006103, "476868cecd1763c91dade98f17defa42d31049547df45acffa1cc5ae5c3d75d6"],
|
||||
["e3649aa40405e6ffe377dbb1bbbb672a40d8424c430fa6512c6165273a2b9b6afa9949ec430200000007630052ab655153a365f62f2792fa90c784efe3f0981134d72aac0b1e1578097132c7f0406671457c332b84020000000353ab6ad780f40cf51be22bb4ff755434779c7f1def4999e4f289d2bd23d142f36b66fbe5cfbb4b01000000076a5252abac52ab1430ffdc67127c9c0fc97dcd4b578dab64f4fb9550d2b59d599773962077a563e8b6732c02000000016affffffff04cb2687000000000002ab636e320904000000000252acf70e9401000000000100dc3393050000000006ab0063536aacbc231765", "65520053", 3, -2016196547, "f64f805f0ff7f237359fa6b0e58085f3c766d1859003332223444fd29144112a"],
|
||||
["1d033569040700441686672832b531ab55db89b50dc1f9fc00fb72218b652da9dcfbc83be901000000066551ac526a632b390f9ad068e5fdee6563e88e2a8e4e09763c861072713dc069893dc6bbc9db3f00e26502000000096a5363526565525252ffffffff8a36bdd0aaf38f6707592d203e14476ca9f259021e487135c7e8324244057ed90300000000ed3fb2a3dfd4d46b5f3603fe0148653911988457bd0ed7f742b07c452f5476c228ff9f600200000007526aac00525152ffffffff04b88e48030000000000c753d602000000000853510000006553518fda2603000000000853ac52acac5263534839f1030000000006ac006aacac5300000000", "516553635300ab0052", 1, 2075958316, "c2cefaec2293134acbcf6d2a8bf2b3eb42e4ec04ee8f8bf30ff23e65680677c1"],
|
||||
["4c4be7540344050e3044f0f1d628039a334a7c1f7b4573469cfea46101d6888bb6161fe9710200000000ffffffffac85a4fdad641d8e28523f78cf5b0f4dc74e6c5d903c10b358dd13a5a1fd8a06000000000163e0ae75d05616b72467b691dc207fe2e65ea35e2eadb7e06ea442b2adb9715f212c0924f10200000000ffffffff0194ddfe02000000000265ac00000000", "00006500", 1, -479922562, "d66924d49f03a6960d3ca479f3415d638c45889ce9ab05e25b65ac260b51d634"],
|
||||
["202c18eb012bc0a987e69e205aea63f0f0c089f96dd8f0e9fcde199f2f37892b1d4e6da90302000000055352ac6565ffffffff0257e5450100000000025300ad257203000000000000000000", "520052ac6a005265", 0, 168054797, "502967a6f999f7ee25610a443caf8653dda288e6d644a77537bcc115a8a29894"],
|
||||
["32fa0b0804e6ea101e137665a041cc2350b794e59bf42d9b09088b01cde806ec1bbea077df0200000008515153650000006506a11c55904258fa418e57b88b12724b81153260d3f4c9f080439789a391ab147aabb0fa0000000007000052ac51ab510986f2a15c0d5e05d20dc876dd2dafa435276d53da7b47c393f20900e55f163b97ce0b800000000008ab526a520065636a8087df7d4d9c985fb42308fb09dce704650719140aa6050e8955fa5d2ea46b464a333f870000000009636300636a6565006affffffff01994a0d040000000002536500000000", "516563530065", 2, -163068286, "f58637277d2bc42e18358dc55f7e87e7043f5e33f4ce1fc974e715ef0d3d1c2a"],
|
||||
["ae23424d040cd884ebfb9a815d8f17176980ab8015285e03fdde899449f4ae71e04275e9a80100000007ab006553530053ffffffff018e06db6af519dadc5280c07791c0fd33251500955e43fe4ac747a4df5c54df020000000251ac330e977c0fec6149a1768e0d312fdb53ed9953a3737d7b5d06aad4d86e9970346a4feeb5030000000951ab51ac6563ab526a67cabc431ee3d8111224d5ecdbb7d717aa8fe82ce4a63842c9bd1aa848f111910e5ae1eb0100000004ac515300bfb7e0d7048acddc030000000009636a5253636a655363a3428e040000000001525b99c6050000000004655265ab717e6e020000000000d99011eb", "ac6a6a516565", 1, -716251549, "b098eb9aff1bbd375c70a0cbb9497882ab51f3abfebbf4e1f8d74c0739dc7717"],
|
||||
["030f44fc01b4a9267335a95677bd190c1c12655e64df74addc53b753641259af1a54146baa020000000152e004b56c04ba11780300000000026a53f125f001000000000251acd2cc7c03000000000763536563655363c9b9e50500000000015200000000", "ac", 0, -1351818298, "19dd32190ed2a37be22f0224a9b55b91e37290577c6c346d36d32774db0219a3"],
|
||||
["c05f448f02817740b30652c5681a3b128322f9dc97d166bd4402d39c37c0b14506d8adb5890300000003536353ffffffffa188b430357055ba291c648f951cd2f9b28a2e76353bef391b71a889ba68d5fc02000000056565526a6affffffff02745f73010000000001ab3ec34c0400000000036aac5200000000", "516551510053", 0, -267877178, "3a1c6742d4c374f061b1ebe330b1e169a113a19792a1fdde979b53e094cc4a3c"],
|
||||
["163ba45703dd8c2c5a1c1f8b806afdc710a2a8fc40c0138e2d83e329e0e02a9b6c837ff6b8000000000700655151ab6a522b48b8f134eb1a7e6f5a6fa319ce9d11b36327ba427b7d65ead3b4a6a69f85cda8bbcd22030000000563656552acffffffffdbcf4955232bd11eef0cc6954f3f6279675b2956b9bcc24f08c360894027a60201000000066500006500abffffffff04d0ce9d0200000000008380650000000000015233f360040000000003006aabedcf0801000000000000000000", "000065006500ac", 0, 216965323, "9afe3f4978df6a86e9a8ebd62ef6a9d48a2203f02629349f1864ef2b8b92fd55"],
|
||||
["07f7f5530453a12ad0c7eb8fbc3f140c7ab6818144d67d2d8752600ca5d9a9358e2dff87d4000000000663526aab526a9e599c379d455e2da36d0cde88d931a863a3e97e01e93b9edb65856f3d958dc08b92b720000000000165bbc8d66dae3b1b170a6e2457f5b161465cb8706e0e6ffc6af55deb918365f14c5f40d4890100000000a7bd77c069ee4b48638e2363fcf2a86b02bea022047bd9fcb16d2b94ad068308d19b31cb00000000066aab5300ab529672aa8f01dbd8a205000000000663536353006a02e99901", "ac006351006a63ab63", 1, 119789359, "6629a1e75c6ae8f4f9d5f734246b6a71682a5ea57246040ef0584f6b97916175"],
|
||||
["fe647f950311bf8f3a4d90afd7517df306e04a344d2b2a2fea368935faf11fa6882505890d0000000005ab5100516affffffff43c140947d9778718919c49c0535667fc6cc727f5876851cb8f7b6460710c7f60100000000ffffffffce4aa5d90d7ab93cbec2e9626a435afcf2a68dd693c15b0e1ece81a9fcbe025e0300000000ffffffff02f34806020000000002515262e54403000000000965635151ac655363636de5ce24", "6a005100ac516351", 2, 989643518, "818a7ceaf963f52b5c48a7f01681ac6653c26b63a9f491856f090d9d60f2ffe3"],
|
||||
["a1050f8604d0f9d2feefcdb5051ae0052f38e21bf39daf583fd0c3900faa3eab5d431c0bbe030000000653536a005151683d27e5c6e0da8f22125823f32d5d98477d8098ef36263b9694d61d4d85d3f2ac02b7570200000007000052005165abffffffff0cad981542bcb54a87d9400aa63e514c7c6fab7158c2b1fb37821ea755eb162a0200000000b94feb5100e5ef3bf8ed8d43356c8a8d5ac6c7e80d7ff6040f4f0aa19abbe783f4f461240200000007636500000052655686fd70042be3ad02000000000465ab636a15680b000000000004acac53511277c705000000000452635252d27a0102000000000000000000", "6a6aacab65655251", 1, -982144648, "dfcf484111801989eb6df8dc2bafb944d7365ffeb36a575a08f3270d3ef24c9f"],
|
||||
["cef7316804c3e77fe67fc6207a1ea6ae6eb06b3bf1b3a4010a45ae5c7ad677bb8a4ebd16d90200000009ac536a5152ac5263005301ab8a0da2b3e0654d31a30264f9356ba1851c820a403be2948d35cafc7f9fe67a06960300000006526a63636a53ffffffffbada0d85465199fa4232c6e4222df790470c5b7afd54704595a48eedd7a4916b030000000865ab63ac006a006ab28dba4ad55e58b5375053f78b8cdf4879f723ea4068aed3dd4138766cb4d80aab0aff3d0300000003ac6a00ffffffff010f5dd6010000000006ab006aab51ab00000000", "", 1, 889284257, "d0f32a6db43378af84b063a6706d614e2d647031cf066997c48c04de3b493a94"],
|
||||
["7b3ff28004ba3c7590ed6e36f45453ebb3f16636fe716acb2418bb2963df596a50ed954d2e03000000065251515265abffffffff706ee16e32e22179400c9841013971645dabf63a3a6d2d5feb42f83aa468983e030000000653ac51ac5152ffffffffa03a16e5e5de65dfa848b9a64ee8bf8656cc1f96b06a15d35bd5f3d32629876e020000000043c1a3965448b3b46f0f0689f1368f3b2981208a368ec5c30defb35595ef9cf95ffd10e902000000036aac65253a5bbe042e907204000000000800006565656352634203b4020000000002656336b3b7010000000001ab7a063f0100000000026500a233cb76", "006551636a53ac5251", 1, -1144216171, "68c7bd717b399b1ee33a6562a916825a2fed3019cdf4920418bb72ffd7403c8c"],
|
||||
["d5c1b16f0248c60a3ddccf7ebd1b3f260360bbdf2230577d1c236891a1993725e262e1b6cb000000000363636affffffff0a32362cfe68d25b243a015fc9aa172ea9c6b087c9e231474bb01824fd6bd8bc0300000005ab52ab516affffffff0420d9a70200000000045152656a45765d0000000000055252536a5277bad100000000000252ab3f3f3803000000000463acac5200000000", "52636a52ab65", 1, 1305123906, "978dc178ecd03d403b048213d904653979d11c51730381c96c4208e3ea24243a"],
|
||||
["1be8ee5604a9937ebecffc832155d9ba7860d0ca451eaced58ca3688945a31d93420c27c460100000006abac5300535288b65458af2f17cbbf7c5fbcdcfb334ffd84c1510d5500dc7d25a43c36679b702e850f7c0200000003005300ffffffff7c237281cb859653eb5bb0a66dbb7aeb2ac11d99ba9ed0f12c766a8ae2a2157203000000086aabac526365acabfffffffff09d3d6639849f442a6a52ad10a5d0e4cb1f4a6b22a98a8f442f60280c9e5be80200000007ab00ab6565ab52ffffffff0398fe83030000000005526aababacbdd6ec010000000005535252ab6a82c1e6040000000001652b71c40c", "6563526353656351", 2, -853634888, "0d936cceda2f56c7bb87d90a7b508f6208577014ff280910a710580357df25f3"],
|
||||
["9e0f99c504fbca858c209c6d9371ddd78985be1ab52845db0720af9ae5e2664d352f5037d4010000000552ac53636affffffff0e0ce866bc3f5b0a49748f597c18fa47a2483b8a94cef1d7295d9a5d36d31ae7030000000663515263ac635bb5d1698325164cdd3f7f3f7831635a3588f26d47cc30bf0fefd56cd87dc4e84f162ab702000000036a6365ffffffff85c2b1a61de4bcbd1d5332d5f59f338dd5e8accbc466fd860f96eef1f54c28ec030000000165ffffffff04f5cabd010000000007000052ac526563c18f1502000000000465510051dc9157050000000008655363ac525253ac506bb600000000000865656a53ab63006a00000000", "006a6a0052", 0, 1186324483, "2f9b7348600336512686e7271c53015d1cb096ab1a5e0bce49acd35bceb42bc8"],
|
||||
["11ce51f90164b4b54b9278f0337d95c50d16f6828fcb641df9c7a041a2b274aa70b1250f2b0000000008ab6a6a65006551524c9fe7f604af44be050000000005525365006521f79a0300000000015306bb4e04000000000265ac99611a05000000000765acab656500006dc866d0", "", 0, -1710478768, "cfa4b7573559b3b199478880c8013fa713ca81ca8754a3fd68a6d7ee6147dc5a"],
|
||||
["86bc233e02ba3c647e356558e7252481a7769491fb46e883dd547a4ce9898fc9a1ca1b77790000000006ab5351abab51f0c1d09c37696d5c7c257788f5dff5583f4700687bcb7d4acfb48521dc953659e325fa390300000003acac5280f29523027225af03000000000963abac0065ab65acab7e59d90400000000016549dac846", "53006aac52acac", 0, 711159875, "880330ccde00991503ea598a6dfd81135c6cda9d317820352781417f89134d85"],
|
||||
["beac155d03a853bf18cd5c490bb2a245b3b2a501a3ce5967945b0bf388fec2ba9f04c03d68030000000012fe96283aec4d3aafed8f888b0f1534bd903f9cd1af86a7e64006a2fa0d2d30711af770010000000163ffffffffd963a19d19a292104b9021c535d3e302925543fb3b5ed39fb2124ee23a9db00302000000056500ac63acffffffff01ad67f503000000000300ac5189f78db2", "53536a636500", 2, 748992863, "bde3dd0575164d7ece3b5783ce0783ffddb7df98f178fe6468683230314f285a"],
|
||||
["81dab34a039c9e225ba8ef421ec8e0e9d46b5172e892058a9ade579fe0eb239f7d9c97d45b0300000009ac65655351ab526363ffffffff10c0faaf7f597fc8b00bbc67c3fd4c6b70ca6b22718d15946bf6b032e62dae570000000005536a00ab6a02cddec3acf985bbe62c96fccf17012a87026ed63fc6756fa39e286eb4c2dd79b59d37400300000002516affffffff04f18b8d03000000000753abab5152636564411c02000000000400ab6300e965750300000000001bd2cf02000000000565ab526aab00000000", "006551ab", 0, -1488174485, "a3d65a8cd0c1eea8558d01396b929520a2221c29d9f25f29035b8abae874447f"],
|
||||
["489ebbf10478e260ba88c0168bd7509a651b36aaee983e400c7063da39c93bf28100011f280100000004abab63ab2fc856f05f59b257a4445253e0d91b6dffe32302d520ac8e7f6f2467f7f6b4b65f2f59e903000000096353abacab6351656affffffff0122d9480db6c45a2c6fd68b7bc57246edffbf6330c39ccd36aa3aa45ec108fc030000000265ab9a7e78a69aadd6b030b12602dff0739bbc346b466c7c0129b34f50ae1f61e634e11e9f3d0000000006516a53525100ffffffff011271070000000000086563ab6353536352c4dd0e2c", "", 0, -293358504, "4eba3055bc2b58765593ec6e11775cea4b6493d8f785e28d01e2d5470ea71575"],
|
||||
["6911195d04f449e8eade3bc49fd09b6fb4b7b7ec86529918b8593a9f6c34c2f2d301ec378b000000000263ab49162266af054643505b572c24ff6f8e4c920e601b23b3c42095881857d00caf56b28acd030000000565525200ac3ac4d24cb59ee8cfec0950312dcdcc14d1b360ab343e834004a5628d629642422f3c5acc02000000035100accf99b663e3c74787aba1272129a34130668a877cc6516bfb7574af9fa6d07f9b4197303400000000085351ab5152635252ffffffff042b3c95000000000000ff92330200000000046a5252ab884a2402000000000853530065520063000d78be03000000000953abab52ab53ac65aba72cb34b", "6a", 2, -637739405, "6b80d74eb0e7ee59d14f06f30ba7d72a48d3a8ff2d68d3b99e770dec23e9284f"],
|
||||
["746347cf03faa548f4c0b9d2bd96504d2e780292730f690bf0475b188493fb67ca58dcca4f0000000002005336e3521bfb94c254058e852a32fc4cf50d99f9cc7215f7c632b251922104f638aa0b9d080100000008656aac5351635251ffffffff4da22a678bb5bb3ad1a29f97f6f7e5b5de11bb80bcf2f7bb96b67b9f1ac44d09030000000365ababffffffff036f02b30000000000076353ab6aac63ac50b72a050000000002acaba8abf804000000000663006a6a6353797eb999", "acac5100", 1, -1484493812, "164c32a263f357e385bd744619b91c3f9e3ce6c256d6a827d6defcbdff38fa75"],
|
||||
["e17149010239dd33f847bf1f57896db60e955117d8cf013e7553fae6baa9acd3d0f1412ad90200000006516500516500cb7b32a8a67d58dddfb6ceb5897e75ef1c1ff812d8cd73875856487826dec4a4e2d2422a0100000004ac525365196dbb69039229270400000000070000535351636a8b7596020000000006ab51ac52655131e99d040000000003516551ee437f5c", "ac656a53", 1, 1102662601, "8858bb47a042243f369f27d9ab4a9cd6216adeac1c1ac413ed0890e46f23d3f3"],
|
||||
["144971940223597a2d1dec49c7d4ec557e4f4bd207428618bafa3c96c411752d494249e1fb0100000004526a5151ffffffff340a545b1080d4f7e2225ff1c9831f283a7d4ca4d3d0a29d12e07d86d6826f7f0200000003006553ffffffff03c36965000000000000dfa9af00000000000451636aac7f7d140300000000016300000000", "", 1, -108117779, "c84fcaf9d779df736a26cc3cabd04d0e61150d4d5472dd5358d6626e610be57f"],
|
||||
["b11b6752044e650b9c4744fb9c930819227d2ac4040d8c91a133080e090b042a142e93906e0000000003650053ffffffff6b9ce7e29550d3c1676b702e5e1537567354b002c8b7bb3d3535e63ad03b50ea01000000055100516300fffffffffcf7b252fea3ad5a108af3640a9bc2cd724a7a3ce22a760fba95496e88e2f2e801000000036a00ac7c58df5efba193d33d9549547f6ca839f93e14fa0e111f780c28c60cc938f785b363941b000000000863ab51516552ac5265e51fcd0308e9830400000000036a00abab72190300000000016a63d0710000000000050051ab6a6300000000", "53005165ac51ab65", 0, 229563932, "e562579d1a2b10d1c5e45c06513456002a6bec157d7eb42511d30b118103c052"],
|
||||
["2aee6b9a02172a8288e02fac654520c9dd9ab93cf514d73163701f4788b4caeeb9297d2e250300000004ab6363008fb36695528d7482710ea2926412f877a3b20acae31e9d3091406bfa6b62ebf9d9d2a6470100000009535165536a63520065ffffffff03f7b560050000000003acab6a9a8338050000000000206ce90000000000056552516a5100000000", "5252", 1, -1102319963, "fa4676c374ae3a417124b4c970d1ed3319dc3ac91fb36efca1aa9ed981a8aa1b"],
|
||||
["9554595203ad5d687f34474685425c1919e3d2cd05cf2dac89d5f33cd3963e5bb43f8706480100000000ffffffff9de2539c2fe3000d59afbd376cb46cefa8bd01dbc43938ff6089b63d68acdc2b02000000096553655251536a6500fffffffff9695e4016cd4dfeb5f7dadf00968e6a409ef048f81922cec231efed4ac78f5d010000000763abab6a5365006caaf0070162cc640200000000045163ab5100000000", "", 0, -1105256289, "e8e10ed162b1a43bfd23bd06b74a6c2f138b8dc1ab094ffb2fa11d5b22869bee"],
|
||||
["04f51f2a0484cba53d63de1cb0efdcb222999cdf2dd9d19b3542a896ca96e23a643dfc45f00200000007acac53510063002b091fd0bfc0cfb386edf7b9e694f1927d7a3cf4e1d2ce937c1e01610313729ef6419ae7030000000165a3372a913c59b8b3da458335dc1714805c0db98992fd0d93f16a7f28c55dc747fe66a5b503000000095351ab65ab52536351ffffffff5650b318b3e236802a4e41ed9bc0a19c32b7aa3f9b2cda1178f84499963a0cde000000000165ffffffff0383954f04000000000553ac536363a8fc90030000000000a2e315000000000005acab00ab5100000000", "0053", 2, -1424653648, "a5bc0356f56b2b41a2314ec05bee7b91ef57f1074bcd2efc4da442222269d1a3"],
|
||||
["5e4fab42024a27f0544fe11abc781f46596f75086730be9d16ce948b04cc36f86db7ad50fd01000000026a00613330f4916285b5305cc2d3de6f0293946aa6362fc087727e5203e558c676b314ef8dd401000000001af590d202ba496f040000000001009e3c9604000000000351ac51943d64d3", "51acabab5100ab52", 1, -129301207, "556c3f90aa81f9b4df5b92a23399fe6432cf8fecf7bba66fd8fdb0246440036c"],
|
||||
["a115284704b88b45a5f060af429a3a8eab10b26b7c15ed421258f5320fa22f4882817d6c2b0300000003005300ffffffff4162f4d738e973e5d26991452769b2e1be4b2b5b7e8cbeab79b9cf9df2882c040000000006636aac63ac5194abc8aa22f8ddc8a7ab102a58e39671683d1891799d19bd1308d24ea6d365e571172f1e030000000700515352515153ffffffff4da7ad75ce6d8541acbb0226e9818a1784e9c97c54b7d1ff82f791df1c6578f60000000000ffffffff01b1f265040000000009ab0051ac656a516a5300000000", "51abab6352535265", 0, -1269106800, "0ef7b6e87c782fa33fe109aab157a2d9cddc4472864f629510a1c92fa1fe7fc1"],
|
||||
["f3f771ae02939752bfe309d6c652c0d271b7cab14107e98032f269d92b2a8c8853ab057da8010000000563ab6a6365670c305c38f458e30a7c0ab45ee9abd9a8dc03bae1860f965ffced879cb2e5d0bb156821020000000153ffffffff025dc619050000000002ac51ec0d250100000000076a5200636a6363333aecd8", "650053ac515100ab", 1, 1812404608, "a7aa34bf8a5644f03c6dd8801f9b15ba2e07e07256dbf1e02dad59f0d3e17ea9"],
|
||||
["fd3e267203ae7d6d3975e738ca84f12540229bb237dd228d5f688e9d5ba53fce4302b0334d01000000026353ffffffff602a3ab75af7aa951d93093e345ef0037a2863f3f580a9b1a575fffe68e677450300000000239e476d1e8f81e8b6313880d8a49b27c1b00af467f29756e76f675f084a5676539636ab030000000765ab6351acac52d9217747044d773204000000000752ac51526353acc33e45050000000005516500005115d889040000000004ab5163510cbbbd0200000000016500000000", "65ac526aac6a53ab52", 2, -886179388, "bc46f3f83058ddf5bebd9e1f2c117a673847c4dc5e31cfb24bac91adf30877cf"],
|
||||
["f380ae23033646af5dfc186f6599098015139e961919aea28502ea2d69474413d94a555ea2000000000853635265abacac5314da394b99b07733341ddba9e86022637be3b76492992fb0f58f23c915098979250a96620300000003ab6300ffffffff4bb6d1c0a0d84eac7f770d3ad0fdc5369ae42a21bbe4c06e0b5060d5990776220300000000ffffffff0486fd70020000000007ac6500635252acf3fd72010000000005656a6a6551212de90500000000096365006a63635153000fa33100000000000600535151656300000000", "ab52", 2, -740890152, "f804fc4d81f039009ed1f2cccb5c91da797543f235ac71b214c20e763a6d86d7"],
|
||||
["5c45d09801bb4d8e7679d857b86b97697472d514f8b76d862460e7421e8617b15a2df217c6010000000863acacab6565006affffffff01156dbc03000000000952ac63516551ac6aac00000000", "6aabac", 0, 1310125891, "270445ab77258ced2e5e22a6d0d8c36ac7c30fff9beefa4b3e981867b03fa0ad"],
|
||||
["4ecc6bde030ca0f83c0ed3d4b777f94c0c88708c6c933fe1df6874f296d425cac95355c23d0000000006ac6a51536a52f286a0969d6170e20f2a8000193807f5bc556770e9d82341ef8e17b0035eace89c76edd50200000007ac65525100656affffffff5bade6e462fac1927f078d69d3a981f5b4c1e59311a38efcb9a910aa436afaa80000000007ac6a006352ab52ffffffff0331e58902000000000763ac53636352abb8b3ca000000000001637a1d26040000000009535263ac6a5352ab655ae34a39", "6a65ab", 2, 2142728517, "4a3415eb1677ae4e0c939644a4cfd5dc6299780b55cd0dc735967057b6b1526a"],
|
||||
["a59484b501eb50114be0fc79e72ab9bc9f4a5f7acdf274a56d6b68684eb68cf8b07ec5d1c2000000000765abab00ab00639e09aa940141e3530200000000046500ac6500000000", "00516565ab", 0, -1561622405, "d60bbadd2cc0674100baa08d0e0493ee4248f0304b3eb778da942041f503a896"],
|
||||
["53dc1a88046531c7b57a35f4d9adf101d068bf8d63fbbedaf4741dba8bc5e92c8725def571030000000453655251fcdf116a226b3ec240739c4c7493800e4edfe67275234e371a227721eac43d3d9ecaf1b50300000003ac0052ffffffff2c9279ffeea4718d167e9499bd067600715c14484e373ef93ae4a31d2f5671ab0000000009516553ac636a6a65001977752eeba95a8f16b88c571a459c2f2a204e23d48cc7090e4f4cc35846ca7fc0a455ce00000000055165ac0063188143f80205972902000000000765ac63ac516353c7b6a50000000000036a510000000000", "655351536a", 0, 103806788, "b276584d3514e5b4e058167c41dc02915b9d97f6795936a51f40e894ed8508bc"],
|
||||
["53f8959f01ddb36afdcd20167edcbb75a63d18654fdcf10bc0004c761ab450fe236d79cb2702000000065151650063653435003a033a5e34050000000009ac52516a630000516ab86db3030000000002006344ac090500000000046363ab00f3644537", "5263abab63ac656353", 0, -218513553, "f1f2a489682e42a6fc20025dfc89584d17f150b2d7ae3ddedd2bf43d5e24f37f"],
|
||||
["5a06cb4602dcfc85f49b8d14513f33c48f67146f2ee44959bbca092788e6823b2719f3160b0200000001ab3c013f2518035b9ea635f9a1c74ec1a3fb7496a160f46aae2e09bfc5cd5111a0f20969e003000000015158c89ab7049f20d6010000000008ac6a52abac53515349765e00000000000300ab638292630100000000045351ab0086da09010000000006656a6365525300000000", "526a63", 1, 1502936586, "bdfaff8a4e775379c5dc26e024968efa805f923de53fa8272dd53ec582afa0c5"],
|
||||
["ca9d84fa0129011e1bf27d7cb71819650b59fb292b053d625c6f02b0339249b498ff7fd4b601000000025352ffffffff032173a0040000000008525253abab5152639473bb030000000009005153526a53535151d085bd0000000000086a5365ab5165655300000000", "005152ac51", 0, 580353445, "c629d93b02037f40aa110e46d903edb34107f64806aa0c418d435926feef68b8"],
|
||||
["e3cdbfb4014d90ae6a4401e85f7ac717adc2c035858bf6ff48979dd399d155bce1f150daea0300000002ac51a67a0d39017f6c71040000000005535200535200000000", "", 0, -1899950911, "c1c7df8206e661d593f6455db1d61a364a249407f88e99ecad05346e495b38d7"],
|
||||
["b2b6b9ab0283d9d73eeae3d847f41439cd88279c166aa805e44f8243adeb3b09e584efb1df00000000026300ffffffff7dfe653bd67ca094f8dab51007c6adaced09de2af745e175b9714ca1f5c68d050000000003ac6500aa8e596903fd3f3204000000000553ac6a6a533a2e210500000000075253acabab526392d0ee020000000008520065635200ab5200000000", "65acacac65005365", 0, 28298553, "39c2aaa2496212b3ab120ab7d7f37c5e852bfe38d20f5226413a2268663eeae8"],
|
||||
["f30c5c3d01a6edb9e10fafaf7e85db14e7fec558b9dca4a80b05d7c3a2944d282c5018f4680200000003005263ffffffff04aac3530300000000026551bc2419010000000009005163acab6a5100658e7085050000000000c5e4ec050000000007656a6a635365ab2d8e8882", "abac53ab005251ac52", 0, -490287546, "877e347ec7487497769e2581142276d1a8d813b652e4483cf9cc993d16354417"],
|
||||
["4314339e01de40faabcb1b970245a7f19eedbc17c507dac86cf986c2973715035cf95736ae0200000007abababababab65bde67b900151510b04000000000853ac00655200535300000000", "52", 0, 399070095, "47585dc25469d04ff3a60939d0a03779e3e81a411bf0ca18b91bb925ebd30718"],
|
||||
["2d4cf4e9031b3e175b2ff18cd933151379d9cfac4713d8bd0e63b70bd4a92277aa7af901ab000000000565515353abffffffff557666c7f3be9cdecdad44c3df206eb63a2da4ed1f159d21193882a9f0340081020000000963ab53ab5252ac63abffffffff8a8c897bdb87e93886aad5ded9d82a13101d5476554386373646ca5e23612e450300000009006a526552abab6a635ac03fc00198bb02040000000009525100526a6563636a1d052834", "ab52ac00acac6a", 0, -1469882480, "09ed6563a454814ab7e3b4c28d56d8751162b77df1825b37ba66c6147750b2a3"],
|
||||
["f063171b03e1830fdc1d685a30a377537363ccafdc68b42bf2e3acb908dac61ee24b37595c020000000765ac5100ab6aacf447bc8e037b89d6cadd62d960cc442d5ced901d188867b5122b42a862929ce45e7b628d010000000253aba009a1ba42b00f1490b0b857052820976c675f335491cda838fb7934d5eea0257684a2a202000000001e83cf2401a7f777030000000008ab6553526a53526a00000000", "", 2, 1984790332, "c19caada8e71535e29a86fa29cfd9b74a0c7412003fc722a121005e461e01636"],
|
||||
["cf7bdc250249e22cbe23baf6b648328d31773ea0e771b3b76a48b4748d7fbd390e88a004d30000000003ac536a4ab8cce0e097136c90b2037f231b7fde2063017facd40ed4e5896da7ad00e9c71dd70ae600000000096a0063516352525365ffffffff01b71e3e00000000000300536a00000000", "", 1, 546970113, "6a815ba155270af102322c882f26d22da11c5330a751f520807936b320b9af5d"],
|
||||
["ac7a125a0269d35f5dbdab9948c48674616e7507413cd10e1acebeaf85b369cd8c88301b7c030000000963656aac6a530053abffffffffed94c39a582e1a46ce4c6bffda2ccdb16cda485f3a0d94b06206066da12aecfe010000000752abab63536363ef71dcfb02ee07fa0400000000016a6908c802000000000751656a6551abac688c2c2d", "6a6351526551", 0, 858400684, "552ff97d7924f51cda6d1b94be53483153ef725cc0a3a107adbef220c753f9a6"],
|
||||
["3a1f454a03a4591e46cf1f7605a3a130b631bf4dfd81bd2443dc4fac1e0a224e74112884fe0000000005516aac6a53a87e78b55548601ffc941f91d75eab263aa79cd498c88c37fdf275a64feff89fc1710efe03000000016a39d7ef6f2a52c00378b4f8f8301853b61c54792c0f1c4e2cd18a08cb97a7668caa008d970200000002656affffffff017642b20100000000096a63535253abac6a6528271998", "51", 2, 1459585400, "e9a7f21fc2d38be7be47095fbc8f1bf8923660aa4d71df6d797ae0ba5ca4d5b0"],
|
||||
["f59366cc0114c2a18e6bd1347ed9470f2522284e9e835dd5c5f7ef243639ebea95d9b232b6020000000153474b62eb045c00170500000000096352ab516352ab5200038a520400000000086aab5253656a63005b968904000000000963536353ac0053635387106002000000000000000000", "ab52526300ab51", 0, 1834116153, "cdf51f6e3a9dc2be5a59ea4c00f5aac1e1426a5202c325e6cf2567d07d8d8de4"],
|
||||
["6269e0fa0173e76e89657ca495913f1b86af5b8f1c1586bcd6c960aede9bc759718dfd5044000000000352ac530e2c7bd90219849b000000000007ab00ab6a53006319f281000000000007ab00515165ac5200000000", "6a", 0, -2039568300, "62094f98234a05bf1b9c7078c5275ed085656856fb5bdfd1b48090e86b53dd85"],
|
||||
["eb2bc00604815b9ced1c604960d54beea4a3a74b5c0035d4a8b6bfec5d0c9108f143c0e99a0000000000ffffffff22645b6e8da5f11d90e5130fd0a0df8cf79829b2647957471d881c2372c527d8010000000263acffffffff1179dbaf17404109f706ae27ad7ba61e860346f63f0c81cb235d2b05d14f2c1003000000025300264cb23aaffdc4d6fa8ec0bb94eff3a2e50a83418a8e9473a16aaa4ef8b855625ed77ef40100000003ac51acf8414ad404dd328901000000000652526500006ab6261c000000000002526a72a4c9020000000006ac526500656586d2e7000000000006656aac00ac5279cd8908", "51", 1, -399279379, "d37532e7b2b8e7db5c7c534197600397ebcc15a750e3af07a3e2d2e4f84b024f"],
|
||||
["dc9fe6a8038b84209bbdae5d848e8c040433237f415437592907aa798bf30d9dbbddf0ff85010000000153ffffffff23269a7ea29fcf788db483b8d4c4b35669e582608644259e950ce152b0fa6e050000000003acababffffffff65de94857897ae9ea3aa0b938ba6e5adf374d48469922d2b36dbb83d3b8c8261010000000452ac5200ffffffff02856e9b0300000000026a51980c8e02000000000365ab63d2648db4", "00ab0051ac526565", 2, 1562581941, "5cef9d8e18a2d5a70448f17b465d411a19dab78f0ddf1672ffd518b188f52433"],
|
||||
["eba8b0de04ac276293c272d0d3636e81400b1aaa60db5f11561480592f99e6f6fa13ad387002000000070053acab536563bebb23d66fd17d98271b182019864a90e60a54f5a615e40b643a54f8408fa8512cfac927030000000963ac6a6aabac65ababffffffff890a72192bc01255058314f376bab1dc72b5fea104c154a15d6faee75dfa5dba020000000100592b3559b0085387ac7575c05b29b1f35d9a2c26a0c27903cc0f43e7e6e37d5a60d8305a030000000252abffffffff0126518f05000000000000000000", "005300635252635351", 1, 664344756, "26dc2cba4bd5334e5c0b3a520b44cc1640c6b923d10e576062f1197171724097"],
|
||||
["91bd040802c92f6fe97411b159df2cd60fb9571764b001f31657f2d616964637605875c2a901000000055263006a65ffffffff3651df372645f50cf4e32fdf6e61c766e912e16335db2b40c5d52fe89eefe7cd00000000040065ab65ffffffff03ca8625030000000009ab51ac63530052ab52c6bf14020000000006ab00ab52005167d270000000000007ab53525351636a00000000", "5151ab63005252ac", 1, 1983087664, "3e5aa0200248d8d86ede3b315ca1b857018b89184a4bd023bd88ab12e499f6e1"],
|
||||
["185cda1a01ecf7a8a8c28466725b60431545fc7a3367ab68e34d486e8ea85ee3128e0d8384000000000465ac63abec88b7bb031c56eb04000000000965636a51005252006a7c78d5040000000007acac63abac51ac3024a40500000000086300526a51abac51464c0e8c", "0065535265515352", 0, 1594558917, "b5280b9610c0625a65b36a8c2402a95019a7bbb9dd3de77f7c3cb1d82c3263ba"],
|
||||
["a9531f07034091668b65fea8b1a79700d586ac9e2f42ca0455a26abe41f9e1805d009a0f5702000000096365516365ac5263ab3619bac643a9e28ee47855118cf80c3a74531cdf198835d206d0fe41804e325a4f9f105e03000000016a58e3ab0d46375d98994daf0fa7c600d2bb4669e726fca0e3a3f21ea0d9e777396740328f0100000008636a5363ab526a538d3ea7700304cb66030000000007515163ab52ab510184030500000000085353636565ac0051d9cff402000000000751ab52ab5352abf0e36254", "ab5353ac5365acab", 2, 1633101834, "04c9ef72f33668ca449c0415becf62cc0b8e0c75f9c8813852d42a58acf107c8"],
|
||||
["6b5ecc7903fe0ba37ea551df92a59e12bad0a3065846ba69179a8f4a741a2b4fcf679aac810200000004535263529a3d343293b99ab425e7ef8529549d84f480bcd92472bab972ea380a302128ae14dfcd0200000000025163ffffffff24636e4545cab9bf87009119b7fc3ec4d5ee9e206b90f35d1df8a563b6cd097a010000000852abac53005153abc64467860406e832020000000009526300006a53ac6352ac1395010000000002ac53b117f300000000000863655351acab00651edf02030000000008ab51ac6353535252628ef71d", "ab63ab6a52ac526563", 2, -1559697626, "8f07ece7d65e509f1e0780584ef8d271c1c61a13b10335d5faafc7afc8b5b8ec"],
|
||||
["92c9fb780138abc472e589d5b59489303f234acc838ca66ffcdf0164517a8679bb622a4267020000000153468e373d04de03fa020000000009ac006a5265ab5163006af649050000000007515153006a00658ceb59030000000001ac36afa0020000000009ab53006351ab51000000000000", "6a", 0, 2059357502, "e2358dfb51831ee81d7b0bc602a65287d6cd2dbfacf55106e2bf597e22a4b573"],
|
||||
["6f62138301436f33a00b84a26a0457ccbfc0f82403288b9cbae39986b34357cb2ff9b889b302000000045253655335a7ff6701bac9960400000000086552ab656352635200000000", "6aac51", 0, 1444414211, "502a2435fd02898d2ff3ab08a3c19078414b32ec9b73d64a944834efc9dae10c"],
|
||||
["9981143a040a88c2484ac3abe053849e72d04862120f424f373753161997dd40505dcb4783030000000700536365536565a2e10da3f4b1c1ad049d97b33f0ae0ea48c5d7c30cc8810e144ad93be97789706a5ead180100000003636a00ffffffffbdcbac84c4bcc87f03d0ad83fbe13b369d7e42ddb3aecf40870a37e814ad8bb5010000000963536a5100636a53abffffffff883609905a80e34202101544f69b58a0b4576fb7391e12a769f890eef90ffb72020000000651656352526affffffff04243660000000000004ab5352534a9ce001000000000863656363ab6a53652df19d030000000003ac65acedc51700000000000000000000", "ac6300acac", 2, 293672388, "7ba99b289c04718a7283f150d831175ed6303081e191a0608ea81f78926c5bdf"],
|
||||
["a2bb630b01989bc5d643f2da4fb9b55c0cdf846ba06d1dbe372893024dbbe5b9b8a1900af802000000055265ac63aca7a68d2f04916c74010000000003abac007077f0040000000001007d4127010000000005ac516aac000f31e8030000000000571079c9", "65ab0051ac", 0, -1103627693, "92d53b4390262e6b288e8a32e0cfc36cd5adfdfabfe96c7bfd4a19d65e233761"],
|
||||
["49f7d0b6037bba276e910ad3cd74966c7b3bc197ffbcfefd6108d6587006947e97789835ea0300000008526a52006a650053ffffffff8d7b6c07cd10f4c4010eac7946f61aff7fb5f3920bdf3467e939e58a1d4100ab03000000076aac63ac535351ffffffff8f48c3ba2d52ad67fbcdc90d8778f3c8a3894e3c35b9730562d7176b81af23c80100000003ab5265ffffffff0301e3ef0300000000046a525353e899ac0500000000075153ab6a65abac259bea0400000000007b739972", "53516aacac6aac", 1, 955403557, "5d366a7f4346ae18aeb7c9fc4dab5af71173184aa20ed22fcb4ea8511ad25449"],
|
||||
["58a4fed801fbd8d92db9dfcb2e26b6ff10b120204243fee954d7dcb3b4b9b53380e7bb8fb60100000003006351ffffffff02a0795b050000000006536351ac6aac2718d00200000000075151acabac515354d21ba1", "005363515351", 0, -1322430665, "bbee941bbad950424bf40e3623457db47f60ed29deaa43c99dec702317cb3326"],
|
||||
["32765a0b02e455793d9ce530e9f6a44bcbc612e893a875b5da61d822dc56d8245166c398b403000000085353abac6300006a6bdee2a78d0d0b6a5ea666eed70b9bfea99d1d612ba3878f615c4da10d4a521cba27155002000000035363abffffffff043cd42401000000000551656a53653685320100000000030000511881bc0500000000065165abab636a20169f010000000007acab656aac63acdb0706a8", "65ac53ab53", 0, 1936499176, "5c5a9c3a5de7dc7a82bc171c9d3505913b8bcc450bc8b2d11772c1a1d781210b"],
|
||||
["17fad0d303da0d764fedf9f2887a91ea625331b28704940f41e39adf3903d8e75683ef6d46020000000151ffffffffff376eea4e880bcf0f03d33999104aafed2b3daf4907950bb06496af6b51720a020000000900636a63525253525196521684f3b08497bad2c660b00b43a6a517edc58217876eb5e478aa3b5fda0f29ee1bea00000000046aacab6affffffff03dde8e2050000000007ac5365ac51516a14772e000000000005630000abacbbb360010000000006ab5251ab656a50f180f0", "0053", 0, -1043701251, "a3bdf8771c8990971bff9b4e7d59b7829b067ed0b8d3ac1ec203429811384668"],
|
||||
["236c32850300045e292c84ede2b9ab5733ba08315a2bb09ab234c4b4e8894808edbdac0d3b020000000653635363abacffffffffd3f696bb31fdd18a72f3fc2bb9ae54b416a253fc37c1a0f0180b52d35bad49440100000004650053abffffffffa85c75a2406d82a93b12e555b66641c1896a4e83ae41ef1038218311e38ace060200000006abab006a51ac104b5e6701e2842c04000000000800630051ac0000ab00000000", "ab63ac6a516a", 1, -1709887524, "8c29ea8ef60c5a927fccdba8ea385db6b6b84d98e891db45f5d4ee3148d3f5a7"],
|
||||
["b78d5fd601345f3100af494cdf447e7d4076179f940035b0ebe8962587d4d0c9c6c9fc34ee0300000003516a6affffffff03dc5c890100000000085353ac53ac6a52534ac941040000000007ac63656a51ab51d4266b0100000000036aacac70731f2d", "005351ab0053", 0, -1789071265, "d5f1c1cb35956a5711d67bfb4cedbc67e77c089b912d688ad440ff735adb390d"],
|
||||
["5a2257df03554550b774e677f348939b37f8e765a212e566ce6b60b4ea8fed4c9504b7f7d1000000000653655265ab5258b67bb931df15b041177cf9599b0604160b79e30f3d7a594e7826bae2c29700f6d8f8f40300000005515300ac6a159cf8808a41f504eb5c2e0e8a9279f3801a5b5d7bc6a70515fbf1c5edc875bb4c9ffac500000000050063510052ffffffff0422a90105000000000965006a650000516a006417d2020000000006526363ab00524d969d0100000000035153acc4f077040000000005ac5200636500000000", "6a52", 1, -1482463464, "37b794b05d0687c9b93d5917ab068f6b2f0e38406ff04e7154d104fc1fb14cdc"],
|
||||
["e0032ad601269154b3fa72d3888a3151da0aed32fb2e1a15b3ae7bee57c3ddcffff76a1321010000000100110d93ae03f5bd080100000000075263516a6551002871e60100000000046a005252eaa753040000000004ab6aab526e325c71", "630052", 0, -1857873018, "ea117348e94de86381bb8ad1c7f93b8c623f0272104341701bb54e6cb433596c"],
|
||||
["014b2a5304d46764817aca180dca50f5ab25f2e0d5749f21bb74a2f8bf6b8b7b3fa8189cb7030000000965ac5165ab6a51ac6360ecd91e8abc7e700a4c36c1a708a494c94bb20cbe695c408543146566ab22be43beae9103000000045163ab00ffffffffffa48066012829629a9ec06ccd4905a05df0e2b745b966f6a269c9c8e13451fc00000000026565ffffffffc40ccadc21e65fe8a4b1e072f4994738ccaf4881ae6fede2a2844d7da4d199ab02000000065152ab536aabffffffff01b6e054030000000004515352ab3e063432", "", 0, 1056459916, "a7aff48f3b8aeb7a4bfe2e6017c80a84168487a69b69e46681e0d0d8e63a84b6"],
|
||||
["c4ef04c103c5dde65410fced19bf6a569549ecf01ceb0db4867db11f2a3a3eef0320c9e8e001000000085100536a53516aabffffffff2a0354fa5bd96f1e28835ffe30f52e19bd7d5150c687d255021a6bec03cf4cfd03000000056a006300514900c5b01d3d4ae1b97370ff1155b9dd0510e198d266c356d6168109c54c11b4c283dca00300000002ababffffffff02e19e3003000000000451655351fa5c0003000000000163ef1fc64b", "51636a51ab630065", 1, -1754709177, "0a281172d306b6a32e166e6fb2a2cc52c505c5d60ea448e9ba7029aa0a2211e1"],
|
||||
["29083fe00398bd2bb76ceb178f22c51b49b5c029336a51357442ed1bac35b67e1ae6fdf13100000000066a6500acab51ffffffffe4ca45c9dc84fd2c9c47c7281575c2ba4bf33b0b45c7eca8a2a483f9e3ebe4b3010000000200abffffffffdf47ad2b8c263fafb1e3908158b18146357c3a6e0832f718cd464518a219d18303000000096352ac656351ac0052daddfb3b0231c36f00000000000400526a5275c7e0020000000001ab00000000", "acab536aac52", 2, 300802386, "82ebc07b16cff0077e9c1a279373185b3494e39d08fd3194aae6a4a019377509"],
|
||||
["1201ab5d04f89f07c0077abd009762e59db4bb0d86048383ba9e1dad2c9c2ad96ef660e6d00200000007ab6a65ac5200652466fa5143ab13d55886b6cdc3d0f226f47ec1c3020c1c6e32602cd3428aceab544ef43e00000000086a6a6a526a6a5263ffffffffd5be0b0be13ab75001243749c839d779716f46687e2e9978bd6c9e2fe457ee48020000000365abab1e1bac0f72005cf638f71a3df2e3bbc0fa35bf00f32d9c7dc9c39a5e8909f7d53170c8ae0200000008ab6a51516363516affffffff02f0a6210500000000036300ac867356010000000009acab65ac6353536a659356d367", "ac53535252", 0, 917543338, "418acc156c2bc76a5d7baa58db29f1b4cf6c266c9222ed167ef5b4d47f0e0f41"],
|
||||
["344fa11e01c19c4dd232c77742f0dd0aeb3695f18f76da627628741d0ee362b0ea1fb3a2180200000007635151005100529bab25af01937c1f0500000000055153ab53656e7630af", "6351005163ac51", 0, -629732125, "228ca52a0a376fe0527a61cfa8da6d7baf87486bba92d49dfd3899cac8a1034f"],
|
||||
["b2fda1950191358a2b855f5626a0ebc830ab625bea7480f09f9cd3b388102e35c0f303124c030000000565ac65ab53ffffffff03f9c5ec04000000000765ab51516551650e2b9f0500000000045365525284e8f6040000000001ac00000000", "ac51655253", 0, 1433027632, "d2fa7e13c34cecda5105156bd2424c9b84ee0a07162642b0706f83243ff811a8"],
|
||||
["a4a6bbd201aa5d882957ac94f2c74d4747ae32d69fdc765add4acc2b68abd1bdb8ee333d6e0300000008516a6552515152abffffffff02c353cb040000000007ac6351ab51536588bd320500000000066552525253ac00000000", "", 0, 1702060459, "499da7d74032388f820645191ac3c8d20f9dba8e8ded7fa3a5401ea2942392a1"],
|
||||
["584e8d6c035a6b2f9dac2791b980a485994bf38e876d9dda9b77ad156eee02fa39e19224a60300000003ab636529db326cc8686a339b79ab6b6e82794a18e0aabc19d9ad13f31dee9d7aad8eff38288588020000000452530052ffffffff09a41f07755c16cea1c7e193c765807d18cadddca6ec1c2ed7f5dcdca99e90e80000000001acffffffff01cba62305000000000451ac63acccdf1f67", "ab536a6363", 2, -27393461, "1125645b49202dca2df2d76dae51877387903a096a9d3f66b5ac80e042c95788"],
|
||||
["83a583d204d926f2ee587a83dd526cf1e25a44bb668e45370798f91a2907d184f7cddcbbc7030000000700ab6565536a539f71d3776300dffdfa0cdd1c3784c9a1f773e34041ca400193612341a9c42df64e3f550e01000000050052515251ffffffff52dab2034ab0648553a1bb8fc4e924b2c89ed97c18dfc8a63e248b454035564b01000000015139ab54708c7d4d2c2886290f08a5221cf69592a810fd1979d7b63d35c271961e710424fd0300000005ac65ac5251ffffffff01168f7c030000000000a85e5fb0", "6a536353656a00", 0, 179595345, "5350a31ac954a0b49931239d0ecafbf34d035a537fd0c545816b8fdc355e9961"],
|
||||
["ffd35d51042f290108fcb6ea49a560ba0a6560f9181da7453a55dfdbdfe672dc800b39e7320200000006630065516a65f2166db2e3827f44457e86dddfd27a8af3a19074e216348daa0204717d61825f198ec0030100000006ab51abab00abffffffffdf41807adb7dff7db9f14d95fd6dc4e65f8402c002d009a3f1ddedf6f4895fc8030000000500ab006a65a5a848345052f860620abd5fcd074195548ce3bd0839fa9ad8642ed80627bf43a0d47dbd010000000765ab006a656a53b38cdd6502a186da05000000000765ab00ab006a53527c0e0100000000085365ab51acacac52534bd1b1", "6a635253ac0000", 0, 1095082149, "3c05473a816621a3613f0e903faa1a1e44891dd40862b029e41fc520776350fa"],
|
||||
["6c9a4b98013c8f1cae1b1df9f0f2de518d0c50206a0ab871603ac682155504c0e0ce946f460100000000ffffffff04e9266305000000000753535100ac6aacded39e04000000000365ac6ab93ccd010000000002515397bf3d050000000003ab636300000000", "63520052ac656353", 0, -352633155, "936eff8cdfd771be24124da87c7b24feb48da7cbc2c25fb5ba13d1a23255d902"],
|
||||
["e01dc7f0021dc07928906b2946ca3e9ac95f14ad4026887101e2d722c26982c27dc2b59fdb0000000005ac5200516ab5a31ffadcbe74957a5a3f97d7f1475cc6423fc6dbc4f96471bd44c70cc736e7dec0d1ea020000000951636a526a52abac53ffffffff04bc2edd05000000000252ab528c7b02000000000952ac51526500525353324820040000000002005380c713000000000009630065ab00ac525252451bbb48", "53ab65ac", 0, -552384418, "69c0b30f4c630a6c878fde6ea6b74dae94f4eb3bcfbde2dc3649e1a9ada00757"],
|
||||
["009046a1023f266d0113556d604931374d7932b4d6a7952d08fbd9c9b87cbd83f4f4c178b4030000000452ac526346e73b438c4516c60edd5488023131f07acb5f9ea1540b3e84de92f4e3c432289781ea4900000000046500655357dfd6da02baef910100000000026a007d101703000000000800516500abacac5100000000", "6aab6553ac", 0, -802456605, "f8757fbb4448ca34e0cd41b997685b37238d331e70316659a9cc9087d116169d"],
|
||||
["df76ec0801a3fcf3d18862c5f686b878266dd5083f16cf655facab888b4cb3123b3ce5db7e01000000010010e7ac6a0233c83803000000000365ac51faf14a040000000004ac51655100000000", "6353acab", 0, 15705861, "e7d873aa079a19ec712b269a37d2670f60d8cb334c4f97e2e3fd10eeb8ee5f5e"],
|
||||
["828fd3e0031084051ccef9cfdd97fae4d9cc50c0dae36bd22a3ff332881f17e9756c3e288e0200000004ab535363961a2ccccaf0218ec6a16ba0c1d8b5e93cfd025c95b6e72bc629ec0a3f47da7a4c396dad01000000025353ffffffff19ad28747fb32b4caf7b5dbd9b2da5a264bedb6c86d3a4805cd294ae53a86ac40200000009ab53535351ab6551abffffffff04a41650030000000005656aab6aab8331a304000000000700516365ac516a0d2a47010000000007abac516353abacdebc19040000000006ab5300636a6300000000", "51ab52ab53ac52", 0, 1866105980, "311094b4d73e31aefc77e97859ef07ca2f07a7b7e4d7def80c69d3f5d58527e5"],
|
||||
["c4b80f850323022205b3e1582f1ed097911a81be593471a8dce93d5c3a7bded92ef6c7c1260100000002006affffffff70294d62f37c3da7c5eae5d67dce6e1b28fedd7316d03f4f48e1829f78a88ae801000000096a5200530000516351f6b7b544f7c39189d3a2106ca58ce4130605328ce7795204be592a90acd81bef517d6f170200000000ffffffff012ab8080000000000075100006365006335454c1e", "53ac6a536aacac", 0, -1124103895, "06277201504e6bf8b8c94136fad81b6e3dadacb9d4a2c21a8e10017bfa929e0e"],
|
||||
["8ab69ed50351b47b6e04ac05e12320984a63801716739ed7a940b3429c9c9fed44d3398ad40300000006536a516a52638171ef3a46a2adb8025a4884b453889bc457d63499971307a7e834b0e76eec69c943038a0300000000ffffffff566bb96f94904ed8d43d9d44a4a6301073cef2c011bf5a12a89bedbaa03e4724030000000265acb606affd01edea38050000000008515252516aacac6300000000", "65000000006365ac53", 0, -1338942849, "7912573937824058103cb921a59a7f910a854bf2682f4116a393a2045045a8c3"],
|
||||
["2484991e047f1cf3cfe38eab071f915fe86ebd45d111463b315217bf9481daf0e0d10902a402000000006e71a424eb1347ffa638363604c0d5eccbc90447ff371e000bf52fc743ec832851bb564a0100000001abffffffffef7d014fad3ae7927948edbbb3afe247c1bcbe7c4c8f5d6cf97c799696412612020000000851536a5353006a001dfee0d7a0dd46ada63b925709e141863f7338f34f7aebde85d39268ae21b77c3068c01d0000000008535151ab00636563ffffffff018478070200000000095200635365ac52ab5341b08cd3", "", 3, 265623923, "24cb420a53b4f8bb477f7cbb293caabfd2fc47cc400ce37dbbab07f92d3a9575"],
|
||||
["54839ef9026f65db30fc9cfcb71f5f84d7bb3c48731ab9d63351a1b3c7bc1e7da22bbd508e0300000000442ad138f170e446d427d1f64040016032f36d8325c3b2f7a4078766bdd8fb106e52e8d20000000003656500ffffffff02219aa101000000000851ababac52ab00659646bd02000000000552acacabac24c394a5", "ac", 0, 906807497, "69264faadcd1a581f7000570a239a0a26b82f2ad40374c5b9c1f58730514de96"],
|
||||
["5036d7080434eb4eef93efda86b9131b0b4c6a0c421e1e5feb099a28ff9dd8477728639f77030000000951516aab535152ab5391429be9cce85d9f3d358c5605cf8c3666f034af42740e94d495e28b9aaa1001ba0c87580300000008006552ab00ab006affffffffd838978e10c0c78f1cd0a0830d6815f38cdcc631408649c32a25170099669daa0000000002acab8984227e804ad268b5b367285edcdf102d382d027789250a2c0641892b480c21bf84e3fb0100000000b518041e023d8653010000000001004040fb0100000000080051ac5200636a6300000000", "52ac", 0, 366357656, "bd0e88829afa6bdc1e192bb8b2d9d14db69298a4d81d464cbd34df0302c634c6"],
|
||||
["9ad5ccf503fa4facf6a27b538bc910cce83c118d6dfd82f3fb1b8ae364a1aff4dcefabd38f03000000096365655263ac655300807c48130c5937190a996105a69a8eba585e0bd32fadfc57d24029cbed6446d30ebc1f100100000004000053650f0ccfca1356768df7f9210cbf078a53c72e0712736d9a7a238e0115faac0ca383f219d0010000000600ab536552002799982b0221b8280000000000000c41320000000000086552ac6365636a6595f233a3", "6a5152", 2, 553208588, "f99c29a79f1d73d2a69c59abbb5798e987639e36d4c44125d8dc78a94ddcfb13"],
|
||||
["669538a204047214ce058aed6a07ca5ad4866c821c41ac1642c7d63ed0054f84677077a84f030000000853abacab6a655353ffffffff70c2a071c115282924e3cb678b13800c1d29b6a028b3c989a598c491bc7c76c5030000000752ac52ac5163ac80420e8a6e43d39af0163271580df6b936237f15de998e9589ec39fe717553d415ac02a4030000000463635153184ad8a5a4e69a8969f71288c331aff3c2b7d1b677d2ebafad47234840454b624bf7ac1d03000000056a63abab63df38c24a02fbc63a040000000002ab535ec3dc050000000002536500000000", "635153", 3, -190399351, "9615541884dfb1feeb08073a6a6aa73ef694bc5076e52187fdf4138a369f94d9"],
|
||||
["a7f139e502af5894be88158853b7cbea49ba08417fbbca876ca6614b5a41432be34499987b000000000765635165abac63ffffffff8b8d70e96c7f54eb70da0229b548ced438e1ca2ba5ddd648a027f72277ee1efc0100000001abffffffff044f2c4204000000000165e93f550100000000050000526a6a94550304000000000365536aadc21c0300000000016300000000", "6aacac6363ab5265ac", 1, 2143189425, "6e3f97955490d93d6a107c18d7fe402f1cada79993bb0ff0d096357261b3a724"],
|
||||
["3b94438f0366f9f53579a9989b86a95d134256ce271da63ca7cd16f7dd5e4bffa17d35133f010000000100ffffffff1aaad0c721e06ec00d07e61a84fb6dc840b9a968002ce7e142f943f06fd143a10100000008535151ac51ab0053b68b8e9c672daf66041332163e04db3f6048534bd718e1940b3fc3811c4eef5b7a56888b01000000001d58e38c012e38e700000000000852ab53ac6365536a00000000", "ab655352", 1, -935223304, "b3b336de141d4f071313a2207b2a0c7cf54a070dd8d234a511b7f1d13e23b0c4"],
|
||||
["e5dca8a20456de0a67e185fa6ea94085ceae478d2c15c73cb931a500db3a1b6735dd1649ec0200000005ab536aabab32d11bbdcb81361202681df06a6b824b12b5cb40bb1a672cf9af8f2a836e4d95b7839327030000000951005365ab65abacabb345085932939eef0c724adef8a57f9e1bf5813852d957c039b6a12d9c2f201ea520fb030000000009ac5352005165acac6a5efc6072f1a421dc7dc714fc6368f6d763a5d76d0278b95fc0503b9268ccfadb48213a2500000000026a53ffffffff039ee1c4020000000009ac5353ab6353535163184018000000000005655265526a9a4a8a050000000001ac00000000", "65ab53ab6a00ab6553", 2, 1902561212, "7928ae8e86c0b0cad1b2c120ea313087437974382ee6d46443ca5ac3f5878b88"],
|
||||
["972128b904e7b673517e96e98d80c0c8ceceae76e2f5c126d63da77ffd7893fb53308bb2da0300000006ac6552ab52acffffffff4cac767c797d297c079a93d06dc8569f016b4bf7a7d79b605c526e1d36a40e2202000000095365ab636aac6a6a6a69928d2eddc836133a690cfb72ec2d3115bf50fb3b0d10708fa5d2ebb09b4810c426a1db01000000060052526300001e8e89585da7e77b2dd2e30625887f0660accdf29e53a614d23cf698e6fc8ab03310e87700000000076a520051acac6555231ddb0330ec2d03000000000200abfaf457040000000004ab6a6352bdc42400000000000153d6dd2f04", "", 0, 209234698, "4a92fec1eb03f5bd754ee9bfd70707dc4420cc13737374f4675f48529be518e4"],
|
||||
["1fb4085b022c6cfb848f8af7ba3ba8d21bd23ffa9f0bfd181cb68bcaaf2074e66d4974a31602000000090000006a6a6500acab6c12c07d9f3dbd2d93295c3a49e3757119767097e7fd5371f7d1ba9ba32f1a67a5a426f00000000000ffffffff018fd2fc04000000000363ac5100000000", "65ab006a6aab526a", 0, 1431502299, "8b7dd0ff12ca0d8f4dbf9abf0abba00e897c2f6fd3b92c79f5f6a534e0b33b32"],
|
||||
["5374f0c603d727f63006078bd6c3dce48bd5d0a4b6ea00a47e5832292d86af258ea0825c260000000009655353636352526a6af2221067297d42a9f8933dfe07f61a574048ff9d3a44a3535cd8eb7de79fb7c45b6f47320200000003ac006affffffff153d917c447d367e75693c5591e0abf4c94bbdd88a98ab8ad7f75bfe69a08c470200000005ac65516365ffffffff037b5b7b000000000001515dc4d904000000000004bb26010000000004536a6aac00000000", "516552516352ac", 2, 328538756, "8bb7a0129eaf4b8fc23e911c531b9b7637a21ab11a246352c6c053ff6e93fcb6"],
|
||||
["c441132102cc82101b6f31c1025066ab089f28108c95f18fa67db179610247086350c163bd010000000651525263ab00ffffffff9b8d56b1f16746f075249b215bdb3516cbbe190fef6292c75b1ad8a8988897c3000000000751ab6553abab00ffffffff02f9078b000000000009ab0053ac51ac00ab51c0422105000000000651006563525200000000", "ac51", 0, -197051790, "55acd8293ed0be6792150a3d7ced6c5ccd153ca7daf09cee035c1b0dac92bb96"],
|
||||
["ab82ad3b04545bd86b3bb937eb1af304d3ef1a6d1343ed809b4346cafb79b7297c09e1648202000000086351ac5200535353ffffffff95d32795bbaaf5977a81c2128a9ec0b3c7551b9b1c3d952876fcb423b2dfb9e80000000005515363acac47a7d050ec1a603627ce6cd606b3af314fa7964abcc579d92e19c7aba00cf6c3090d6d4601000000056a516551633e794768bfe39277ebc0db18b5afb5f0c8117dde9b4dfd5697e9027210eca76a9be20d63000000000700520063ab6aacffffffff01ec2ddc050000000008ac52ac65ac65ac5100000000", "536300abab", 1, -2070209841, "b362da5634f20be7267de78b545d81773d711b82fe9310f23cd0414a8280801d"],
|
||||
["8bff9d170419fa6d556c65fa227a185fe066efc1decf8a1c490bc5cbb9f742d68da2ab7f320100000007ab000053525365a7a43a80ab9593b9e8b6130a7849603b14b5c9397a190008d89d362250c3a2257504eb810200000007acabacac00ab51ee141be418f003e75b127fd3883dbf4e8c3f6cd05ca4afcaac52edd25dd3027ae70a62a00000000008ac52526a5200536affffffffb8058f4e1d7f220a1d1fa17e96d81dfb9a304a2de4e004250c9a576963a586ae0300000005abacac5363b9bc856c039c01d804000000000951656aac53005365acb0724e00000000000565abab63acea7c7a0000000000036a00ac00000000", "6565", 1, -1349282084, "2b822737c2affeefae13451d7c9db22ff98e06490005aba57013f6b9bbc97250"],
|
||||
["0e1633b4041c50f656e882a53fde964e7f0c853b0ada0964fc89ae124a2b7ffc5bc97ea6230100000006ac6aacacabacffffffff2e35f4dfcad2d53ea1c8ada8041d13ea6c65880860d96a14835b025f76b1fbd9000000000351515121270867ef6bf63a91adbaf790a43465c61a096acc5a776b8e5215d4e5cd1492e611f761000000000600ac6aab5265ffffffff63b5fc39bcac83ca80ac36124abafc5caee608f9f63a12479b68473bd4bae769000000000965ac52acac5263acabffffffff0163153e020000000008ab005165ab65515300000000", "6a6aac00", 0, -968477862, "20732d5073805419f275c53784e78db45e53332ee618a9fcf60a3417a6e2ca69"],
|
||||
["2b052c24022369e956a8d318e38780ef73b487ba6a8f674a56bdb80a9a63634c6110fb5154010000000251acffffffff48fe138fb7fdaa014d67044bc05940f4127e70c113c6744fbd13f8d51d45143e01000000005710db3804e01aa9030000000008acac6a516a5152abfd55aa01000000000751ab510000ac636d6026010000000000b97da9000000000000fddf3b53", "006552", 0, 595461670, "685d67d84755906d67a007a7d4fa311519467b9bdc6a351913246a41e082a29f"],
|
||||
["073bc856015245f03b2ea2da62ccedc44ecb99e4250c7042f596bcb23b294c9dc92cfceb6b02000000095163abab52abab636afe292fb303b7c3f001000000000352636af3c49502000000000400ac6a535851850100000000066aac6553ab6500000000", "ab6aab53006aab52", 0, 247114317, "123916c6485cf23bfea95654a8815fbf04ce4d21a3b7f862805c241472906658"],
|
||||
["7888b71403f6d522e414d4ca2e12786247acf3e78f1918f6d727d081a79813d129ee8befce0100000009ab516a6353ab6365abffffffff4a882791bf6400fda7a8209fb2c83c6eef51831bdf0f5dacde648859090797ec030000000153ffffffffbb08957d59fa15303b681bad19ccf670d7d913697a2f4f51584bf85fcf91f1f30200000008526565ac52ac63acffffffff0227c0e8050000000001ac361dc801000000000800515165ab00ab0000000000", "656a", 2, 1869281295, "f43378a0b7822ad672773944884e866d7a46579ee34f9afc17b20afc1f6cf197"],
|
||||
["cc4dda57047bd0ca6806243a6a4b108f7ced43d8042a1acaa28083c9160911cf47eab910c40200000007526a0000ab6a63e4154e581fcf52567836c9a455e8b41b162a78c85906ccc1c2b2b300b4c69caaaa2ba0230300000008ab5152ac5100ab65ffffffff69696b523ed4bd41ecd4d65b4af73c9cf77edf0e066138712a8e60a04614ea1c0300000004ab6a000016c9045c7df7836e05ac4b2e397e2dd72a5708f4a8bf6d2bc36adc5af3cacefcf074b8b403000000065352ac5252acffffffff01d7e380050000000000cf4e699a", "525163656351", 1, -776533694, "ff18c5bffd086e00917c2234f880034d24e7ea2d1e1933a28973d134ca9e35d2"],
|
||||
["b7877f82019c832707a60cf14fba44cfa254d787501fdd676bd58c744f6e951dbba0b3b77f0200000009ac515263ac53525300a5a36e500148f89c0500000000085265ac6a6a65acab00000000", "6563", 0, -1785108415, "cb6e4322955af12eb29613c70e1a00ddbb559c887ba844df0bcdebed736dffbd"],
|
||||
["aeb14046045a28cc59f244c2347134d3434faaf980961019a084f7547218785a2bd03916f3000000000165f852e6104304955bda5fa0b75826ee176211acc4a78209816bbb4419feff984377b2352200000000003a94a5032df1e0d60390715b4b188c330e4bb7b995f07cdef11ced9d17ee0f60bb7ffc8e0100000002516513e343a5c1dc1c80cd4561e9dddad22391a2dbf9c8d2b6048e519343ca1925a9c6f0800a020000000665516365ac513180144a0290db27000000000006ab655151ab5138b187010000000007ab5363abac516a9e5cd98a", "53ac", 0, 478591320, "e8d89a302ae626898d4775d103867a8d9e81f4fd387af07212adab99946311ef"],
|
||||
["c9270fe004c7911b791a00999d108ce42f9f1b19ec59143f7b7b04a67400888808487bd59103000000066a0052ac6565b905e76687be2dd7723b22c5e8269bc0f2000a332a289cfc40bc0d617cfe3214a61a85a30300000007ac63ac00635251560871209f21eb0268f175b8b4a06edd0b04162a974cf8b5dada43e499a1f22380d35ede0300000000792213fc58b6342cc8100079f9f5f046fb89f2d92cf0a2cb6d07304d32d9da858757037c0000000008abab51636565516affffffff02c72a8b03000000000452acac530dfb9f05000000000096f94307", "5253ab536351", 3, 543688436, "0278adbcc476d135493ae9bdcd7b3c2002df17f2d81c17d631c50c73e546c264"],
|
||||
["57a5a04c0278c8c8e243d2df4bb716f81d41ac41e2df153e7096f5682380c4f441888d9d260300000004ab63ab6afdbe4203525dff42a7b1e628fe22bccaa5edbb34d8ab02faff198e085580ea5fcdb0c61b0000000002ac6affffffff03375e6c05000000000663ab516a6a513cb6260400000000007ca328020000000006516a636a52ab94701cc7", "0053ac5152", 0, -550925626, "b7ca991ab2e20d0158168df2d3dd842a57ab4a3b67cca8f45b07c4b7d1d11126"],
|
||||
["072b75a504ad2550c2e9a02614bc9b2a2f50b5b553af7b87c0ef07c64ddc8d8934c96d216401000000036aabaca1387242a5bcd21099b016ad6045bed7dce603472757d9822cc5f602caa4ae20414d378b02000000026a63e4ac816734acdc969538d6f70b8ab43a2589f55e0177a4dc471bdd0eb61d59f0f46f6bb801000000065351526aab52d9f2977be76a492c3a7617b7a16dc29a3b0a7618f328c2f7d4fd9bafe760dc427a5066ef000000000465635165ffffffff02c5793600000000000165296820050000000002ac6300000000", "53006a6aac0052ab", 2, 66084636, "437e89bb6f70fd2ed2feef33350b6f6483b891305e574da03e580b3efd81ae13"],
|
||||
["7e27c42d0279c1a05eeb9b9faedcc9be0cab6303bde351a19e5cbb26dd0d594b9d74f40d2b020000000200518c8689a08a01e862d5c4dcb294a2331912ff11c13785be7dce3092f154a005624970f84e0200000000500cf5a601e74c1f0000000000076aab52636a6a5200000000", "6500006a5351", 0, 449533391, "535ba819d74770d4d613ee19369001576f98837e18e1777b8246238ff2381dd0"],
|
||||
["11414de403d7f6c0135a9df01cb108c1359b8d4e105be50a3dcba5e6be595c8817217490b20000000003005263ffffffff0c6becb9c3ad301c8dcd92f5cbc07c8bed7973573806d1489316fc77a829da03030000000700005253535352ffffffff2346d74ff9e12e5111aa8779a2025981850d4bf788a48de72baa2e321e4bc9ca00000000056352acab63cc585b64045e0385050000000009ab5253ab516aacac00efa9cf0300000000065200635151acbe80330400000000070063635100ab000be159050000000007525300655300ac00000000", "51656a0051ab", 0, 683137826, "d4737f3b58f3e5081b35f36f91acde89dda00a6a09d447e516b523e7a99264d5"],
|
||||
["1c6b5f29033fc139338658237a42456123727c8430019ca25bd71c6168a9e35a2bf54538d80100000008536aac52ac6a6a52ffffffff3fb36be74036ff0c940a0247c451d923c65f826793d0ac2bb3f01ecbec8033290100000007ab000051ab6363ffffffff5d9eca0cf711685105bd060bf7a67321eaef95367acffab36ce8dedddd632ee2000000000652ac6a63ac517167319e032d26de040000000003516363dc38fb010000000000b37b00000000000006ab520051ac534baba51f", "636300ababac6563", 0, -2049129935, "3282a2ec6b8c87c9303e6060c17b421687db1bd35fbfa0345b48f2490e15b6cc"],
|
||||
["978b9dad0214cfc7ce392d74d9dcc507350dc34007d72e4125861c63071ebf2cc0a6fd4856020000000651ac6a6aab52ffffffff47f20734e3370e733f87a6edab95a7a268ae44db7a8974e255614836b22938720200000008635265ac51516553ffffffff0137b2560100000000035252ac2f3363e9", "006aab6352", 1, 2014249801, "55611a5fb1483bce4c14c33ed15198130e788b72cd8929b2ceef4dd68b1806bf"],
|
||||
["442f1c8703ab39876153c241ab3d69f432ba6db4732bea5002be45c8ca10c3a2356fe0e9590300000001accb2b679cab7c58a660cb6d4b3452c21cd7251a1b77a52c300f655f5baeb6fa27ff5b79880300000003005252e5ccf55712bc8ed6179f6726f8a78f3018a7a0391594b7e286ef5ee99efdcde302a102cc0200000009006352526351536a63ffffffff04443f63030000000006536a63ab63651405fb020000000009ac535351525300ab6a9f172b000000000004ab535263ad5c50050000000008656a65ab630000ac00000000", "65636aab006552", 2, 2125838294, "b3ff10f21e71ebc8b25fe058c4074c42f08617e0dcc03f9e75d20539d3242644"],
|
||||
["2b3470dd028083910117f86614cdcfb459ee56d876572510be4df24c72e8f58c70d5f5948b03000000066aab65635265da2c3aac9d42c9baafd4b655c2f3efc181784d8cba5418e053482132ee798408ba43ccf90300000000ffffffff047dda4703000000000765516a52ac53009384a603000000000651636a63ab6a8cf57a03000000000352ab6a8cf6a405000000000952636a6a6565525100661e09cb", "ac520063ac6a6a52", 1, 1405647183, "9b360c3310d55c845ef537125662b9fe56840c72136891274e9fedfef56f9bb5"],
|
||||
["d74282b501be95d3c19a5d9da3d49c8a88a7049c573f3788f2c42fc6fa594f59715560b9b00000000009655353525265ac52ac9772121f028f8303030000000003510065af5f47040000000007ac516a6551630000000000", "acab53006363ac", 0, -1113209770, "2f482b97178f17286f693796a756f4d7bd2dfcdbecd4142528eec1c7a3e5101a"],
|
||||
["3a5644a9010f199f253f858d65782d3caec0ac64c3262b56893022b9796086275c9d4d097b02000000009d168f7603a67b30050000000007ac51536a0053acd9d88a050000000007655363535263ab3cf1f403000000000352ac6a00000000", "005363536565acac6a", 0, -1383947195, "6390ab0963cf611e0cea35a71dc958b494b084e6fd71d22217fdc5524787ade6"],
|
||||
["67b3cc43049d13007485a8133b90d94648bcf30e83ba174f5486ab42c9107c69c5530c5e1f0000000003005100ffffffff9870ebb65c14263282ea8d41e4f4f40df16b565c2cf86f1d22a9494cad03a67f01000000016a5a121bee5e359da548e808ae1ad6dfccae7c67cbb8898d811638a1f455a671e822f228ef030000000151c1fcc9f9825f27c0dde27ea709da62a80a2ff9f6b1b86a5874c50d6c37d39ae31fb6c8a0030000000163553b8786020ca74a00000000000665635153ab5275c0760000000000020052e659b05d", "636aab6a6a", 0, -342795451, "f77c3322c97b1681c17b1eba461fa27b07e04c1534e8aaf735a49cab72c7c2e2"],
|
||||
["bda1ff6804a3c228b7a12799a4c20917301dd501c67847d35da497533a606701ad31bf9d5e0300000001ac16a6c5d03cf516cd7364e4cbbf5aeccd62f8fd03cb6675883a0636a7daeb650423cb1291010000000500656553ac4a63c30b6a835606909c9efbae1b2597e9db020c5ecfc0642da6dc583fba4e84167539a8020000000865525353515200acffffffff990807720a5803c305b7da08a9f24b92abe343c42ac9e917a84e1f335aad785d00000000026a52ffffffff04981f20030000000001ab8c762200000000000253ab690b9605000000000151ce88b301000000000753526a6a51006500000000", "000052ac52530000", 1, -1809193140, "5299b0fb7fc16f40a5d6b337e71fcd1eb04d2600aefd22c06fe9c71fe0b0ba54"],
|
||||
["2ead28ff0243b3ab285e5d1067f0ec8724224402b21b9cef9be962a8b0d153d401be99bbee0000000004ac635153ffffffff6985987b7c1360c9fa8406dd6e0a61141709f0d5195f946da55ed83be4e3895301000000020053ffffffff016503d20500000000085251ac6a65656a6a00000000", "51abab", 1, 1723793403, "67483ee62516be17a2431a163e96fd88a08ff2ce8634a52e42c1bc04e30f3f8a"],
|
||||
["db4904e6026b6dd8d898f278c6428a176410d1ffbde75a4fa37cda12263108ccd4ca6137440100000007656a0000515263ffffffff1db7d5005c1c40da0ed17b74cf6b2a6ee2c33c9e0bacda76c0da2017dcac2fc70200000004abab6a53ffffffff0454cf2103000000000153463aef000000000009ab6a630065ab52636387e0ed050000000000e8d16f05000000000352ac63e4521b22", "", 1, 1027042424, "48315a95e49277ab6a2d561ee4626820b7bab919eea372b6bf4e9931ab221d04"],
|
||||
["dca31ad10461ead74751e83d9a81dcee08db778d3d79ad9a6d079cfdb93919ac1b0b61871102000000086500525365ab51ac7f7e9aed78e1ef8d213d40a1c50145403d196019985c837ffe83836222fe3e5955e177e70100000006525152525300ffffffff5e98482883cc08a6fe946f674cca479822f0576a43bf4113de9cbf414ca628060100000006ac53516a5253ffffffff07490b0b898198ec16c23b75d606e14fa16aa3107ef9818594f72d5776805ec502000000036a0052ffffffff01932a2803000000000865ab6551ac6a516a2687aa06", "635300ac", 2, -1880362326, "74d6a2fa7866fd8b74b2e34693e2d6fd690410384b7afdcd6461b1ae71d265ce"],
|
||||
["e14e1a9f0442ab44dfc5f6d945ad1ff8a376bc966aad5515421e96ddbe49e529614995cafc03000000055165515165fffffffff97582b8290e5a5cfeb2b0f018882dbe1b43f60b7f45e4dd21dbd3a8b0cfca3b0200000000daa267726fe075db282d694b9fee7d6216d17a8c1f00b2229085495c5dc5b260c8f8cd5d000000000363ac6affffffffaab083d22d0465471c896a438c6ac3abf4d383ae79420617a8e0ba8b9baa872b010000000963526563ac5363ababd948b5ce022113440200000000076a636552006a53229017040000000000e6f62ac8", "526353636a65", 3, -485265025, "1bc8ad76f9b7c366c5d052dc479d6a8a2015566d3a42e93ab12f727692c89d65"],
|
||||
["720d4693025ca3d347360e219e9bc746ef8f7bc88e8795162e5e2f0b0fc99dc17116fc937100000000046353520045cb1fd79824a100d30b6946eab9b219daea2b0cdca6c86367c0c36af98f19ac64f3575002000000008a1c881003ed16f3050000000008536a63630000abac45e0e704000000000151f6551a05000000000963536565515363abab00000000", "6553ab6a6a510000ab", 1, 1249091393, "a575fa4f59a8e90cd07de012c78fe8f981183bb170b9c50fcc292b8c164cbc3b"],
|
||||
["69df842a04c1410bfca10896467ce664cfa31c681a5dac10106b34d4b9d4d6d0dc1eac01c1000000000551536a5165269835ca4ad7268667b16d0a2df154ec81e304290d5ed69e0069b43f8c89e673328005e200000000076a5153006aacabffffffffc9314bd80b176488f3d634360fcba90c3a659e74a52e100ac91d3897072e3509010000000765abac51636363ffffffff0e0768b13f10f0fbd2fa3f68e4b4841809b3b5ba0e53987c3aaffcf09eee12bf0300000008ac535263526a53ac514f4c2402da8fab0400000000001ef15201000000000451526a52d0ec9aca", "525365ac52", 1, 313967049, "a72a760b361af41832d2c667c7488dc9702091918d11e344afc234a4aea3ec44"],
|
||||
["adf2340d03af5c589cb5d28c06635ac07dd0757b884d4777ba85a6a7c410408ad5efa8b19001000000045100ab00ffffffff808dc0231c96e6667c04786865727013922bcb7db20739b686f0c17f5ba70e8f0300000000fd2332a654b580881a5e2bfec8313f5aa878ae94312f37441bf2d226e7fc953dcf0c77ab000000000163aa73dc580412f8c2050000000005636aacac63da02d502000000000153e74b52020000000001536b293d030000000009636552ababacab526500000000", "000052ab52ababab", 0, -568651175, "2c45d021db545df7167ac03c9ee56473f2398d9b2b739cf3ff3e074501d324f8"],
|
||||
["e4fec9f10378a95199c1dd23c6228732c9de0d7997bf1c83918a5cfd36012476c0c3cba24002000000085165536500ac0000ad08ab93fb49d77d12a7ccdbb596bc5110876451b53a79fdce43104ff1c316ad63501de801000000046a6352ab76af9908463444aeecd32516a04dd5803e02680ed7f16307242a794024d93287595250f4000000000089807279041a82e603000000000200521429100200000000055253636a63f20b940400000000004049ed04000000000500ab5265ab43dfaf7d", "6563526aac", 2, -1923470368, "32f3c012eca9a823bebb9b282240aec40ca65df9f38da43b1dcfa0cac0c0df7e"],
|
||||
["4000d3600100b7a3ff5b41ec8d6ccdc8b2775ad034765bad505192f05d1f55d2bc39d0cbe10100000007ab5165ac6a5163ffffffff034949150100000000026a6a92c9f6000000000008ab6553ab6aab635200e697040000000007636a5353525365237ae7d2", "52000063", 0, -880046683, "c76146f68f43037289aaeb2bacf47408cddc0fb326b350eb4f5ef6f0f8564793"],
|
||||
["eabc0aa701fe489c0e4e6222d72b52f083166b49d63ad1410fb98caed027b6a71c02ab830c03000000075253ab63530065ffffffff01a5dc0b05000000000253533e820177", "", 0, 954499283, "1d849b92eedb9bf26bd4ced52ce9cb0595164295b0526842ab1096001fcd31b1"],
|
||||
["d48d55d304aad0139783b44789a771539d052db565379f668def5084daba0dfd348f7dcf6b00000000006826f59e5ffba0dd0ccbac89c1e2d69a346531d7f995dea2ca6d7e6d9225d81aec257c6003000000096a655200ac656552acffffffffa188ffbd5365cae844c8e0dea6213c4d1b2407274ae287b769ab0bf293e049eb0300000005ac6a6aab51ad1c407c5b116ca8f65ed496b476183f85f072c5f8a0193a4273e2015b1cc288bf03e9e2030000000252abffffffff04076f44040000000006655353abab53be6500050000000003ac65ac3c15040500000000095100ab536353516a52ed3aba04000000000900ac53ab53636aabac00000000", "5253526563acac", 2, -1506108646, "bbee17c8582514744bab5df50012c94b0db4aff5984d2e13a8d09421674404e2"],
|
||||
["9746f45b039bfe723258fdb6be77eb85917af808211eb9d43b15475ee0b01253d33fc3bfc502000000065163006a655312b12562dc9c54e11299210266428632a7d0ee31d04dfc7375dcad2da6e9c11947ced0e000000000009074095a5ac4df057554566dd04740c61490e1d3826000ad9d8f777a93373c8dddc4918a00000000025351ffffffff01287564030000000004636a00ab00000000", "52", 2, -1380411075, "84af1623366c4db68d81f452b86346832344734492b9c23fbb89015e516c60b2"],
|
||||
["8731b64903d735ba16da64af537eaf487b57d73977f390baac57c7b567cb2770dfa2ef65870100000001635aedd990c42645482340eacb0bfa4a0a9e888057389c728b5b6a8691cdeb1a6a67b45e140200000008ac53526a52516551ffffffff45c4f567c47b8d999916fd49642cbc5d10d43c304b99e32d044d35091679cb860100000003006a51ffffffff0176d6c200000000000000000000", "ab6a65ab53", 2, -1221546710, "ccfdba36d9445f4451fb7cbf0752cc89c23d4fc6fff0f3930d20e116f9db0b95"],
|
||||
["f5cfc52f016209ab1385e890c2865a74e93076595d1ca77cbe8fbf2022a2f2061a90fb0f3e010000000253acffffffff027de73f0200000000085252ac510052acac49cd6a020000000000e6c2cb56", "516552535300ab63", 0, -1195302704, "5532717402a2da01a1da912d824964024185ca7e8d4ad1748659dc393a14182b"],
|
||||
["df0a32ae01c4672fd1abd0b2623aae0a1a8256028df57e532f9a472d1a9ceb194267b6ee190200000009536a6a51516a525251b545f9e803469a2302000000000465526500810631040000000000441f5b050000000006530051006aaceb183c76", "536a635252ac6a", 0, 1601138113, "9a0435996cc58bdba09643927fe48c1fc908d491a050abbef8daec87f323c58f"],
|
||||
["d102d10c028b9c721abb259fe70bc68962f6cae384dabd77477c59cbeb1fb26266e091ba3e0100000002516affffffffe8d7305a74f43e30c772109849f4cd6fb867c7216e6d92e27605e69a0818899700000000026a65ecf82d58027db4620500000000026552c28ed3010000000001ab00000000", "0051ab515365", 1, -131815460, "1d1757a782cb5860302128bcbe9398243124a2f82d671a113f74f8e582c7a182"],
|
||||
["cef930ed01c36fcb1d62ceef931bef57098f27a77a4299904cc0cbb44504802d535fb11557010000000153ffffffff02c8657403000000000863ac655253520063d593380400000000046aab536a00000000", "656a0051ab6365ab53", 0, -351313308, "e69dba3efb5c02af2ab1087d0a990678784671f4744d01ca097d71aec14dd8e9"],
|
||||
["b1c0b71804dff30812b92eefb533ac77c4b9fdb9ab2f77120a76128d7da43ad70c20bbfb990200000002536392693e6001bc59411aebf15a3dc62a6566ec71a302141b0c730a3ecc8de5d76538b30f55010000000665535252ac514b740c6271fb9fe69fdf82bf98b459a7faa8a3b62f3af34943ad55df4881e0d93d3ce0ac0200000000c4158866eb9fb73da252102d1e64a3ce611b52e873533be43e6883137d0aaa0f63966f060000000001abffffffff04a605b604000000000851006a656a630052f49a0300000000000252515a94e1050000000009abac65ab0052abab00fd8dd002000000000651535163526a2566852d", "ac5363", 0, -1718831517, "b0dc030661783dd9939e4bf1a6dfcba809da2017e1b315a6312e5942d714cf05"],
|
||||
["6a270ee404ebc8d137cfd4bb6b92aa3702213a3139a579c1fc6f56fbc7edd9574ef17b13f30100000009ab00ab656565ababacffffffffaa65b1ab6c6d87260d9e27a472edceb7dd212483e72d90f08857abf1dbfd46d10100000000fffffffff93c4c9c84c4dbbe8a912b99a2830cfe3401aebc919041de063d660e585fc9f002000000096aabacab52ac6a53acfa6dcef3f28355a8d98eee53839455445eeee83eecd2c854e784efa53cee699dbfecaebd0100000003ab6a51ffffffff04f7d71b050000000009ac6a536aac6a6365513c37650500000000065265abab6a53fa742002000000000039ed82030000000009516aac635165ab51ab2fdabd17", "ab535252526563", 1, -1326210506, "1dec0d5eb921bf5b2df39c8576e19c38d0c17254a4a0b78ac4b5422bcc426258"],
|
||||
["3657e4260304ccdc19936e47bdf058d36167ee3d4eb145c52b224eff04c9eb5d1b4e434dfc0000000001ab58aefe57707c66328d3cceef2e6f56ab6b7465e587410c5f73555a513ace2b232793a74400000000036a006522e69d3a785b61ad41a635d59b3a06b2780a92173f85f8ed428491d0aaa436619baa9c4501000000046351abab2609629902eb7793050000000000a1b967040000000003525353a34d6192", "516a", 0, -1761874713, "0a2ff41f6d155d8d0e37cd9438f3b270df9f9214cda8e95c76d5a239ca189df2"],
|
||||
["a0eb6dc402994e493c787b45d1f946d267b09c596c5edde043e620ce3d59e95b2b5b93d43002000000096a5252526aac63ab6555694287a279e29ee491c177a801cd685b8744a2eab83824255a3bcd08fc0e3ea13fb8820000000009abab6365ab52ab0063ffffffff029e424a040000000008acab53ab516a636a23830f0400000000016adf49c1f9", "ac0065ac6500005252", 1, 669294500, "e05e3d383631a7ed1b78210c13c2eb26564e5577db7ddfcea2583c7c014091d4"],
|
||||
["6e67c0d3027701ef71082204c85ed63c700ef1400c65efb62ce3580d187fb348376a23e9710200000001655b91369d3155ba916a0bc6fe4f5d94cad461d899bb8aaac3699a755838bfc229d6828920010000000765536353526a52ffffffff04c0c792000000000005650052535372f79e000000000001527fc0ee010000000005ac5300ab65d1b3e902000000000251aba942b278", "6a5151", 0, 1741407676, "e657e2c8ec4ebc769ddd3198a83267b47d4f2a419fc737e813812acefad92ff7"],
|
||||
["8f53639901f1d643e01fc631f632b7a16e831d846a0184cdcda289b8fa7767f0c292eb221a00000000046a53abacffffffff037a2daa01000000000553ac6a6a51eac349020000000005ac526552638421b3040000000007006a005100ac63048a1492", "ac65", 0, 1033685559, "da86c260d42a692358f46893d6f91563985d86eeb9ea9e21cd38c2d8ffcfcc4d"],
|
||||
["491f99cb01bdfba1aa235e5538dac081fae9ce55f9622de483afe7e65105c2b0db75d360d200000000045251636340b60f0f041421330300000000096351ac000051636553ce2822040000000005516a00ac5180c8e40300000000025100caa8570400000000020000cfdc8da6", "6a5100516aab655365", 0, -953727341, "397c68803b7ce953666830b0221a5e2bcf897aa2ded8e36a6b76c497dcb1a2e1"],
|
||||
["b3cad3a7041c2c17d90a2cd994f6c37307753fa3635e9ef05ab8b1ff121ca11239a0902e700300000009ab635300006aac5163ffffffffcec91722c7468156dce4664f3c783afef147f0e6f80739c83b5f09d5a09a57040200000004516a6552ffffffff969d1c6daf8ef53a70b7cdf1b4102fb3240055a8eaeaed2489617cd84cfd56cf020000000352ab53ffffffff46598b6579494a77b593681c33422a99559b9993d77ca2fa97833508b0c169f80200000009655300655365516351ffffffff04d7ddf800000000000853536a65ac6351ab09f3420300000000056aab65abac33589d04000000000952656a65655151acac944d6f0400000000006a8004ba", "005165", 1, 1035865506, "fe1dc9e8554deecf8f50c417c670b839cc9d650722ebaaf36572418756075d58"],
|
||||
["e1cfd73b0125add9e9d699f5a45dca458355af175a7bd4486ebef28f1928d87864384d02df02000000036a0051ffffffff0357df030100000000036a5365777e2d04000000000763ab6a00005265f434a601000000000351655100000000", "ab53ab", 0, -1936500914, "950f4b4f72ccdf8a6a0f381265d6c8842fdb7e8b3df3e9742905f643b2432b69"],
|
||||
["cf781855040a755f5ba85eef93837236b34a5d3daeb2dbbdcf58bb811828d806ed05754ab8010000000351ac53ffffffffda1e264727cf55c67f06ebcc56dfe7fa12ac2a994fecd0180ce09ee15c480f7d00000000096351516a51acac00ab53dd49ff9f334befd6d6f87f1a832cddfd826a90b78fd8cf19a52cb8287788af94e939d6020000000700525251ac526310d54a7e8900ed633f0f6f0841145aae7ee0cbbb1e2a0cae724ee4558dbabfdc58ba6855010000000552536a53abfd1b101102c51f910500000000096300656a525252656a300bee010000000009ac52005263635151abe19235c9", "53005365", 2, 1422854188, "d5981bd4467817c1330da72ddb8760d6c2556cd809264b2d85e6d274609fc3a3"],
|
||||
["fea256ce01272d125e577c0a09570a71366898280dda279b021000db1325f27edda41a53460100000002ab53c752c21c013c2b3a01000000000000000000", "65", 0, 1145543262, "076b9f844f6ae429de228a2c337c704df1652c292b6c6494882190638dad9efd"]
|
||||
]
|
||||
397
src/test/data/tx_invalid.json
Normal file
397
src/test/data/tx_invalid.json
Normal file
|
|
@ -0,0 +1,397 @@
|
|||
[
|
||||
["The following are deserialized transactions which are invalid."],
|
||||
["They are in the form"],
|
||||
["[[[prevout hash, prevout index, prevout scriptPubKey, amount?], [input 2], ...],"],
|
||||
["serializedTransaction, verifyFlags]"],
|
||||
["Use BADTX for verifyFlags if it is expected to fail CheckTransaction()"],
|
||||
["Objects that are only a single string (like this one) are ignored"],
|
||||
|
||||
["0e1b5688cf179cd9f7cbda1fac0090f6e684bbf8cd946660120197c3f3681809 but with extra junk appended to the end of the scriptPubKey"],
|
||||
[[["6ca7ec7b1847f6bdbd737176050e6a08d66ccd55bb94ad24f4018024107a5827", 0, "0x41 0x043b640e983c9690a14c039a2037ecc3467b27a0dcd58f19d76c7bc118d09fec45adc5370a1c5bf8067ca9f5557a4cf885fdb0fe0dcc9c3a7137226106fbc779a5 CHECKSIG VERIFY 1"]],
|
||||
"010000000127587a10248001f424ad94bb55cd6cd6086a0e05767173bdbdf647187beca76c000000004948304502201b822ad10d6adc1a341ae8835be3f70a25201bbff31f59cbb9c5353a5f0eca18022100ea7b2f7074e9aa9cf70aa8d0ffee13e6b45dddabf1ab961bda378bcdb778fa4701ffffffff0100f2052a010000001976a914fc50c5907d86fed474ba5ce8b12a66e0a4c139d888ac00000000", "NONE"],
|
||||
|
||||
["This is the nearly-standard transaction with CHECKSIGVERIFY 1 instead of CHECKSIG from tx_valid.json"],
|
||||
["but with the signature duplicated in the scriptPubKey with a non-standard pushdata prefix"],
|
||||
["See FindAndDelete, which will only remove if it uses the same pushdata prefix as is standard"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x4c 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a01"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", "NONE"],
|
||||
|
||||
["Same as above, but with the sig in the scriptSig also pushed with the same non-standard OP_PUSHDATA"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x4c 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a01"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000006b4c473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", "NONE"],
|
||||
|
||||
["This is the nearly-standard transaction with CHECKSIGVERIFY 1 instead of CHECKSIG from tx_valid.json"],
|
||||
["but with the signature duplicated in the scriptPubKey with a different hashtype suffix"],
|
||||
["See FindAndDelete, which will only remove if the signature, including the hash type, matches"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a81"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", "NONE"],
|
||||
|
||||
["An invalid P2SH Transaction"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x7a052c840ba73af26755de42cf01cc9e0a49fef0 EQUAL"]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000009085768617420697320ffffffff010000000000000000015100000000", "P2SH"],
|
||||
|
||||
["Tests for CheckTransaction()"],
|
||||
["No outputs"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x05ab9e14d983742513f0f451e105ffb4198d1dd4 EQUAL"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022100f16703104aab4e4088317c862daec83440242411b039d14280e03dd33b487ab802201318a7be236672c5c56083eb7a5a195bc57a40af7923ff8545016cd3b571e2a601232103c40e5d339df3f30bf753e7e04450ae4ef76c9e45587d1d993bdc4cd06f0651c7acffffffff0000000000", "BADTX"],
|
||||
|
||||
["Negative output"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xae609aca8061d77c5e111f6bb62501a6bbe2bfdb EQUAL"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d4830450220063222cbb128731fc09de0d7323746539166544d6c1df84d867ccea84bcc8903022100bf568e8552844de664cd41648a031554327aa8844af34b4f27397c65b92c04de0123210243ec37dee0e2e053a9c976f43147e79bc7d9dc606ea51010af1ac80db6b069e1acffffffff01ffffffffffffffff015100000000", "BADTX"],
|
||||
|
||||
["MAX_MONEY + 1 output"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x32afac281462b822adbec5094b8d4d337dd5bd6a EQUAL"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100e1eadba00d9296c743cb6ecc703fd9ddc9b3cd12906176a226ae4c18d6b00796022100a71aef7d2874deff681ba6080f1b278bac7bb99c61b08a85f4311970ffe7f63f012321030c0588dc44d92bdcbf8e72093466766fdc265ead8db64517b0c542275b70fffbacffffffff01000452acdfb2241d015100000000", "BADTX"],
|
||||
|
||||
["MAX_MONEY output + 1 output"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xb558cbf4930954aa6a344363a15668d7477ae716 EQUAL"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022027deccc14aa6668e78a8c9da3484fbcd4f9dcc9bb7d1b85146314b21b9ae4d86022100d0b43dece8cfb07348de0ca8bc5b86276fa88f7f2138381128b7c36ab2e42264012321029bb13463ddd5d2cc05da6e84e37536cb9525703cfd8f43afdb414988987a92f6acffffffff02000452acdfb2241d01510001000000000000015100000000", "BADTX"],
|
||||
|
||||
["Duplicate inputs"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x236d0639db62b0773fd8ac34dc85ae19e9aba80a EQUAL"]],
|
||||
"01000000020001000000000000000000000000000000000000000000000000000000000000000000006c47304402204bb1197053d0d7799bf1b30cd503c44b58d6240cccbdc85b6fe76d087980208f02204beeed78200178ffc6c74237bb74b3f276bbb4098b5605d814304fe128bf1431012321039e8815e15952a7c3fada1905f8cf55419837133bd7756c0ef14fc8dfe50c0deaacffffffff0001000000000000000000000000000000000000000000000000000000000000000000006c47304402202306489afef52a6f62e90bf750bbcdf40c06f5c6b138286e6b6b86176bb9341802200dba98486ea68380f47ebb19a7df173b99e6bc9c681d6ccf3bde31465d1f16b3012321039e8815e15952a7c3fada1905f8cf55419837133bd7756c0ef14fc8dfe50c0deaacffffffff010000000000000000015100000000", "BADTX"],
|
||||
|
||||
["Coinbase of size 1"],
|
||||
["Note the input is just required to make the tester happy"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]],
|
||||
"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0151ffffffff010000000000000000015100000000", "BADTX"],
|
||||
|
||||
["Coinbase of size 101"],
|
||||
["Note the input is just required to make the tester happy"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]],
|
||||
"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff655151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151ffffffff010000000000000000015100000000", "BADTX"],
|
||||
|
||||
["Null txin, but without being a coinbase (because there are two inputs)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"]],
|
||||
"01000000020000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff00010000000000000000000000000000000000000000000000000000000000000000000000ffffffff010000000000000000015100000000", "BADTX"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"],
|
||||
["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]],
|
||||
"010000000200010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff010000000000000000015100000000", "BADTX"],
|
||||
|
||||
["Same as the transactions in valid with one input SIGHASH_ALL and one SIGHASH_ANYONECANPAY, but we set the _ANYONECANPAY sequence number, invalidating the SIGHASH_ALL signature"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"],
|
||||
["0000000000000000000000000000000000000000000000000000000000000200", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"]],
|
||||
"01000000020001000000000000000000000000000000000000000000000000000000000000000000004948304502203a0f5f0e1f2bdbcd04db3061d18f3af70e07f4f467cbc1b8116f267025f5360b022100c792b6e215afc5afc721a351ec413e714305cb749aae3d7fee76621313418df10101000000000200000000000000000000000000000000000000000000000000000000000000000000484730440220201dc2d030e380e8f9cfb41b442d930fa5a685bb2c8db5906671f865507d0670022018d9e7a8d4c8d86a73c2a724ee38ef983ec249827e0e464841735955c707ece98101000000010100000000000000015100000000", "NONE"],
|
||||
|
||||
["CHECKMULTISIG with incorrect signature order"],
|
||||
["Note the input is just required to make the tester happy"],
|
||||
[[["b3da01dd4aae683c7aee4d5d8b52a540a508e1115f77cd7fa9a291243f501223", 0, "HASH160 0x14 0xb1ce99298d5f07364b57b1e5c9cc00be0b04a954 EQUAL"]],
|
||||
"01000000012312503f2491a2a97fcd775f11e108a540a5528b5d4dee7a3c68ae4add01dab300000000fdfe000048304502207aacee820e08b0b174e248abd8d7a34ed63b5da3abedb99934df9fddd65c05c4022100dfe87896ab5ee3df476c2655f9fbe5bd089dccbef3e4ea05b5d121169fe7f5f401483045022100f6649b0eddfdfd4ad55426663385090d51ee86c3481bdc6b0c18ea6c0ece2c0b0220561c315b07cffa6f7dd9df96dbae9200c2dee09bf93cc35ca05e6cdf613340aa014c695221031d11db38972b712a9fe1fc023577c7ae3ddb4a3004187d41c45121eecfdbb5b7210207ec36911b6ad2382860d32989c7b8728e9489d7bbc94a6b5509ef0029be128821024ea9fac06f666a4adc3fc1357b7bec1fd0bdece2b9d08579226a8ebde53058e453aeffffffff0180380100000000001976a914c9b99cddf847d10685a4fabaa0baf505f7c3dfab88ac00000000", "P2SH"],
|
||||
|
||||
|
||||
["The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"],
|
||||
["It is an OP_CHECKMULTISIG with the dummy value missing"],
|
||||
[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]],
|
||||
"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004847304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "NONE"],
|
||||
|
||||
|
||||
["CHECKMULTISIG SCRIPT_VERIFY_NULLDUMMY tests:"],
|
||||
|
||||
["The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"],
|
||||
["It is an OP_CHECKMULTISIG with the dummy value set to something other than an empty string"],
|
||||
[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]],
|
||||
"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004a010047304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "NULLDUMMY"],
|
||||
|
||||
["As above, but using an OP_1"],
|
||||
[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]],
|
||||
"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000495147304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "NULLDUMMY"],
|
||||
|
||||
["As above, but using an OP_1NEGATE"],
|
||||
[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]],
|
||||
"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000494f47304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "NULLDUMMY"],
|
||||
|
||||
["As above, but with the dummy byte missing"],
|
||||
[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]],
|
||||
"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004847304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "NONE"],
|
||||
|
||||
|
||||
["Empty stack when we try to run CHECKSIG"],
|
||||
[[["ad503f72c18df5801ee64d76090afe4c607fb2b822e9b7b63c5826c50e22fc3b", 0, "0x21 0x027c3a97665bf283a102a587a62a30a0c102d4d3b141015e2cae6f64e2543113e5 CHECKSIG NOT"]],
|
||||
"01000000013bfc220ec526583cb6b7e922b8b27f604cfe0a09764de61e80f58dc1723f50ad0000000000ffffffff0101000000000000002321027c3a97665bf283a102a587a62a30a0c102d4d3b141015e2cae6f64e2543113e5ac00000000", "NONE"],
|
||||
|
||||
|
||||
["Inverted versions of tx_valid CODESEPARATOR IF block tests"],
|
||||
|
||||
["CODESEPARATOR in an unexecuted IF block does not change what is hashed"],
|
||||
[[["a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944", 0, "IF CODESEPARATOR ENDIF 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 CHECKSIGVERIFY CODESEPARATOR 1"]],
|
||||
"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a9000000004a48304502207a6974a77c591fa13dff60cabbb85a0de9e025c09c65a4b2285e47ce8e22f761022100f0efaac9ff8ac36b10721e0aae1fb975c90500b50c56e8a0cc52b0403f0425dd0151ffffffff010000000000000000016a00000000", "NONE"],
|
||||
|
||||
["As above, with the IF block executed"],
|
||||
[[["a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944", 0, "IF CODESEPARATOR ENDIF 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 CHECKSIGVERIFY CODESEPARATOR 1"]],
|
||||
"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a9000000004a483045022100fa4a74ba9fd59c59f46c3960cf90cbe0d2b743c471d24a3d5d6db6002af5eebb02204d70ec490fd0f7055a7c45f86514336e3a7f03503dacecabb247fc23f15c83510100ffffffff010000000000000000016a00000000", "NONE"],
|
||||
|
||||
["CHECKLOCKTIMEVERIFY tests"],
|
||||
|
||||
["By-height locks, with argument just beyond tx nLockTime"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1 CHECKLOCKTIMEVERIFY"]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "CHECKLOCKTIMEVERIFY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 CHECKLOCKTIMEVERIFY"]],
|
||||
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000fe64cd1d", "CHECKLOCKTIMEVERIFY"],
|
||||
|
||||
["By-time locks, with argument just beyond tx nLockTime (but within numerical boundaries)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000001 CHECKLOCKTIMEVERIFY"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "CHECKLOCKTIMEVERIFY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 CHECKLOCKTIMEVERIFY"]],
|
||||
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000feffffff", "CHECKLOCKTIMEVERIFY"],
|
||||
|
||||
["Argument missing"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "CHECKLOCKTIMEVERIFY 1"]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "CHECKLOCKTIMEVERIFY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000001b1010000000100000000000000000000000000", "CHECKLOCKTIMEVERIFY"],
|
||||
|
||||
["Argument negative with by-blockheight nLockTime=0"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "-1 CHECKLOCKTIMEVERIFY"]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "CHECKLOCKTIMEVERIFY"],
|
||||
|
||||
["Argument negative with by-blocktime nLockTime=500,000,000"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "-1 CHECKLOCKTIMEVERIFY"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "CHECKLOCKTIMEVERIFY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000004005194b1010000000100000000000000000002000000", "CHECKLOCKTIMEVERIFY"],
|
||||
|
||||
["Input locked"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKLOCKTIMEVERIFY 1"]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000", "CHECKLOCKTIMEVERIFY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000251b1ffffffff0100000000000000000002000000", "NONE"],
|
||||
|
||||
["Another input being unlocked isn't sufficient; the CHECKLOCKTIMEVERIFY-using input must be unlocked"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKLOCKTIMEVERIFY 1"] ,
|
||||
["0000000000000000000000000000000000000000000000000000000000000200", 1, "1"]],
|
||||
"010000000200010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00020000000000000000000000000000000000000000000000000000000000000100000000000000000100000000000000000000000000", "CHECKLOCKTIMEVERIFY"],
|
||||
|
||||
["Argument/tx height/time mismatch, both versions"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKLOCKTIMEVERIFY 1"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "CHECKLOCKTIMEVERIFY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000251b100000000010000000000000000000065cd1d", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 CHECKLOCKTIMEVERIFY"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "CHECKLOCKTIMEVERIFY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 CHECKLOCKTIMEVERIFY"]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "CHECKLOCKTIMEVERIFY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 CHECKLOCKTIMEVERIFY"]],
|
||||
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d", "CHECKLOCKTIMEVERIFY"],
|
||||
|
||||
["Argument 2^32 with nLockTime=2^32-1"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x050000000001 CHECKLOCKTIMEVERIFY"]],
|
||||
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff", "CHECKLOCKTIMEVERIFY"],
|
||||
|
||||
["Same, but with nLockTime=2^31-1"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483648 CHECKLOCKTIMEVERIFY"]],
|
||||
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffff7f", "CHECKLOCKTIMEVERIFY"],
|
||||
|
||||
["6 byte non-minimally-encoded arguments are invalid even if their contents are valid"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x06 0x000000000000 CHECKLOCKTIMEVERIFY 1"]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "CHECKLOCKTIMEVERIFY"],
|
||||
|
||||
["Failure due to failing CHECKLOCKTIMEVERIFY in scriptSig"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000251b1000000000100000000000000000000000000", "CHECKLOCKTIMEVERIFY"],
|
||||
|
||||
["Failure due to failing CHECKLOCKTIMEVERIFY in redeemScript"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xc5b93064159b3b2d6ab506a41b1f50463771b988 EQUAL"]],
|
||||
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000030251b1000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"],
|
||||
|
||||
["A transaction with a non-standard DER signature."],
|
||||
[[["b1dbc81696c8a9c0fccd0693ab66d7c368dbc38c0def4e800685560ddd1b2132", 0, "DUP HASH160 0x14 0x4b3bd7eba3bc0284fd3007be7f3be275e94f5826 EQUALVERIFY CHECKSIG"]],
|
||||
"010000000132211bdd0d568506804eef0d8cc3db68c3d766ab9306cdfcc0a9c89616c8dbb1000000006c493045022100c7bb0faea0522e74ff220c20c022d2cb6033f8d167fb89e75a50e237a35fd6d202203064713491b1f8ad5f79e623d0219ad32510bfaa1009ab30cbee77b59317d6e30001210237af13eb2d84e4545af287b919c2282019c9691cc509e78e196a9d8274ed1be0ffffffff0100000000000000001976a914f1b3ed2eda9a2ebe5a9374f692877cdf87c0f95b88ac00000000", "DERSIG"],
|
||||
|
||||
["CHECKSEQUENCEVERIFY tests"],
|
||||
|
||||
["By-height locks, with argument just beyond txin.nSequence"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4259839 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000feff40000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
|
||||
["By-time locks, with argument just beyond txin.nSequence (but within numerical boundaries)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4194305 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4259839 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000feff40000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
|
||||
["Argument missing"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "CHECKSEQUENCEVERIFY 1"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
|
||||
["Argument negative with by-blockheight txin.nSequence=0"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "-1 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
|
||||
["Argument negative with by-blocktime txin.nSequence=CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "-1 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
|
||||
["Argument/tx height/time mismatch, both versions"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKSEQUENCEVERIFY 1"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "65535 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4194304 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4259839 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
|
||||
["6 byte non-minimally-encoded arguments are invalid even if their contents are valid"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x06 0x000000000000 CHECKSEQUENCEVERIFY 1"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffff00000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
|
||||
["Failure due to failing CHECKSEQUENCEVERIFY in scriptSig"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"]],
|
||||
"02000000010001000000000000000000000000000000000000000000000000000000000000000000000251b2000000000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
|
||||
["Failure due to failing CHECKSEQUENCEVERIFY in redeemScript"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x7c17aff532f22beb54069942f9bf567a66133eaf EQUAL"]],
|
||||
"0200000001000100000000000000000000000000000000000000000000000000000000000000000000030251b2000000000100000000000000000000000000", "P2SH,CHECKSEQUENCEVERIFY"],
|
||||
|
||||
["Failure due to insufficient tx.nVersion (<2)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKSEQUENCEVERIFY 1"]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4194304 CHECKSEQUENCEVERIFY"]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000", "CHECKSEQUENCEVERIFY"],
|
||||
|
||||
["Unknown witness program version (with DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x60 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3000]],
|
||||
"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b00000000000001510002483045022100a3cec69b52cba2d2de623ffffffffff1606184ea55476c0f8189fda231bc9cbb022003181ad597f7c380a7d1c740286b1d022b8b04ded028b833282e055e03b8efef812103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "P2SH,WITNESS,DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM"],
|
||||
|
||||
["Unknown length for witness program v0"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x15 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3fff", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3000]],
|
||||
"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff04b60300000000000001519e070000000000000151860b0000000000000100960000000000000001510002473044022022fceb54f62f8feea77faac7083c3b56c4676a78f93745adc8a35800bc36adfa022026927df9abcf0a8777829bcfcce3ff0a385fa54c3f9df577405e3ef24ee56479022103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "P2SH,WITNESS"],
|
||||
|
||||
["Witness with SigHash Single|AnyoneCanPay (same index output value changed)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3000]],
|
||||
"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e80300000000000001516c070000000000000151b80b0000000000000151000248304502210092f4777a0f17bf5aeb8ae768dec5f2c14feabf9d1fe2c89c78dfed0f13fdb86902206da90a86042e252bcd1e80a168c719e4a1ddcc3cebea24b9812c5453c79107e9832103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "P2SH,WITNESS"],
|
||||
|
||||
["Witness with SigHash None|AnyoneCanPay (input sequence changed)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3000]],
|
||||
"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff000100000000000000000000000000000000000000000000000000000000000001000000000100000000010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b0000000000000151000248304502210091b32274295c2a3fa02f5bce92fb2789e3fc6ea947fbe1a76e52ea3f4ef2381a022079ad72aefa3837a2e0c033a8652a59731da05fa4a813f4fc48e87c075037256b822103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "P2SH,WITNESS"],
|
||||
|
||||
["Witness with SigHash All|AnyoneCanPay (third output value changed)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3000]],
|
||||
"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151540b00000000000001510002483045022100a3cec69b52cba2d2de623eeef89e0ba1606184ea55476c0f8189fda231bc9cbb022003181ad597f7c380a7d1c740286b1d022b8b04ded028b833282e055e03b8efef812103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "P2SH,WITNESS"],
|
||||
|
||||
["Witness with a push of 521 bytes"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x00 0x20 0x33198a9bfef674ebddb9ffaa52928017b8472791e54c609cb95f278ac6b1e349", 1000]],
|
||||
"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff010000000000000000015102fd0902000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002755100000000", "P2SH,WITNESS"],
|
||||
|
||||
["Witness with unknown version which push false on the stack should be invalid (even without DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x60 0x02 0x0000", 2000]],
|
||||
"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff010000000000000000015101010100000000", "NONE"],
|
||||
|
||||
["Witness program should leave clean stack"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x00 0x20 0x2f04a3aa051f1f60d695f6c44c0c3d383973dfd446ace8962664a76bb10e31a8", 2000]],
|
||||
"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01000000000000000001510102515100000000", "P2SH,WITNESS"],
|
||||
|
||||
["Witness v0 with a push of 2 bytes"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x00 0x02 0x0001", 2000]],
|
||||
"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff010000000000000000015101040002000100000000", "P2SH,WITNESS"],
|
||||
|
||||
["Unknown witness version with non empty scriptSig"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x60 0x02 0x0001", 2000]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000151ffffffff010000000000000000015100000000", "P2SH,WITNESS"],
|
||||
|
||||
["Non witness Single|AnyoneCanPay hash input's position (permutation)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x21 0x03596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71 CHECKSIG", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x21 0x03596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71 CHECKSIG", 1001]],
|
||||
"010000000200010000000000000000000000000000000000000000000000000000000000000100000049483045022100acb96cfdbda6dc94b489fd06f2d720983b5f350e31ba906cdbd800773e80b21c02200d74ea5bdf114212b4bbe9ed82c36d2e369e302dff57cb60d01c428f0bd3daab83ffffffff0001000000000000000000000000000000000000000000000000000000000000000000004847304402202a0b4b1294d70540235ae033d78e64b4897ec859c7b6f1b2b1d8a02e1d46006702201445e756d2254b0f1dfda9ab8e1e1bc26df9668077403204f32d16a49a36eb6983ffffffff02e9030000000000000151e803000000000000015100000000", "NONE"],
|
||||
|
||||
["P2WSH with a redeem representing a witness scriptPubKey should fail due to too many stack items"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x00 0x20 0x34b6c399093e06cf9f0f7f660a1abcfe78fcf7b576f43993208edd9518a0ae9b", 1000]],
|
||||
"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e803000000000000015101045102010100000000", "P2SH,WITNESS"],
|
||||
|
||||
["P2WSH with an empty redeem should fail due to empty stack"],
|
||||
[[["3d4da21b04a67a54c8a58df1c53a0534b0a7f0864fb3d19abd43b8f6934e785f", 0, "0x00 0x20 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", 1337]],
|
||||
"020000000001015f784e93f6b843bd9ad1b34f86f0a7b034053ac5f18da5c8547aa6041ba24d3d0000000000ffffffff013905000000000000220020e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855010000000000", "P2SH,WITNESS"],
|
||||
|
||||
["33 bytes push should be considered a witness scriptPubKey"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x60 0x21 0xff25429251b5a84f452230a3c75fd886b7fc5a7865ce4a7bb7a9d7c5be6da3dbff", 1000]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e803000000000000015100000000", "P2SH,WITNESS,DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM"],
|
||||
|
||||
["FindAndDelete tests"],
|
||||
["This is a test of FindAndDelete. The first tx is a spend of normal scriptPubKey and the second tx is a spend of bare P2WSH."],
|
||||
["The redeemScript/witnessScript is CHECKSIGVERIFY <0x30450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e01>."],
|
||||
["The signature is <0x30450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e01> <pubkey>,"],
|
||||
["where the pubkey is obtained through key recovery with sig and the wrong sighash."],
|
||||
["This is to show that FindAndDelete is applied only to non-segwit scripts"],
|
||||
["To show that the tests are 'correctly wrong', they should pass by modifying OP_CHECKSIG under interpreter.cpp"],
|
||||
["by replacing (sigversion == SigVersion::BASE) with (sigversion != SigVersion::BASE)"],
|
||||
["Non-segwit: wrong sighash (without FindAndDelete) = 1ba1fe3bc90c5d1265460e684ce6774e324f0fabdf67619eda729e64e8b6bc08"],
|
||||
[[["f18783ace138abac5d3a7a5cf08e88fe6912f267ef936452e0c27d090621c169", 7000, "HASH160 0x14 0x0c746489e2d83cdbb5b90b432773342ba809c134 EQUAL", 200000]],
|
||||
"010000000169c12106097dc2e0526493ef67f21269fe888ef05c7a3a5dacab38e1ac8387f1581b0000b64830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e012103b12a1ec8428fc74166926318c15e17408fea82dbb157575e16a8c365f546248f4aad4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e01ffffffff0101000000000000000000000000", "P2SH"],
|
||||
["BIP143: wrong sighash (with FindAndDelete) = 71c9cd9b2869b9c70b01b1f0360c148f42dee72297db312638df136f43311f23"],
|
||||
[[["f18783ace138abac5d3a7a5cf08e88fe6912f267ef936452e0c27d090621c169", 7500, "0x00 0x20 0x9e1be07558ea5cc8e02ed1d80c0911048afad949affa36d5c3951e3159dbea19", 200000]],
|
||||
"0100000000010169c12106097dc2e0526493ef67f21269fe888ef05c7a3a5dacab38e1ac8387f14c1d000000ffffffff01010000000000000000034830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e012102a9d7ed6e161f0e255c10bbfcca0128a9e2035c2c8da58899c54d22d3a31afdef4aad4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0100000000", "P2SH,WITNESS"],
|
||||
["This is multisig version of the FindAndDelete tests"],
|
||||
["Script is 2 CHECKMULTISIGVERIFY <sig1> <sig2> DROP"],
|
||||
["52af4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c0395960175"],
|
||||
["Signature is 0 <sig1> <sig2> 2 <key1> <key2>"],
|
||||
["Should pass by replacing (sigversion == SigVersion::BASE) with (sigversion != SigVersion::BASE) under OP_CHECKMULTISIG"],
|
||||
["Non-segwit: wrong sighash (without FindAndDelete) = 4bc6a53e8e16ef508c19e38bba08831daba85228b0211f323d4cb0999cf2a5e8"],
|
||||
[[["9628667ad48219a169b41b020800162287d2c0f713c04157e95c484a8dcb7592", 7000, "HASH160 0x14 0x5748407f5ca5cdca53ba30b79040260770c9ee1b EQUAL", 200000]],
|
||||
"01000000019275cb8d4a485ce95741c013f7c0d28722160008021bb469a11982d47a662896581b0000fd6f01004830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c039596015221023fd5dd42b44769c5653cbc5947ff30ab8871f240ad0c0e7432aefe84b5b4ff3421039d52178dbde360b83f19cf348deb04fa8360e1bf5634577be8e50fafc2b0e4ef4c9552af4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c0395960175ffffffff0101000000000000000000000000", "P2SH"],
|
||||
["BIP143: wrong sighash (with FindAndDelete) = 17c50ec2181ecdfdc85ca081174b248199ba81fff730794d4f69b8ec031f2dce"],
|
||||
[[["9628667ad48219a169b41b020800162287d2c0f713c04157e95c484a8dcb7592", 7500, "0x00 0x20 0x9b66c15b4e0b4eb49fa877982cafded24859fe5b0e2dbfbe4f0df1de7743fd52", 200000]],
|
||||
"010000000001019275cb8d4a485ce95741c013f7c0d28722160008021bb469a11982d47a6628964c1d000000ffffffff0101000000000000000007004830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c03959601010221023cb6055f4b57a1580c5a753e19610cafaedf7e0ff377731c77837fd666eae1712102c1b1db303ac232ffa8e5e7cc2cf5f96c6e40d3e6914061204c0541cb2043a0969552af4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c039596017500000000", "P2SH,WITNESS"],
|
||||
|
||||
["SCRIPT_VERIFY_CONST_SCRIPTCODE tests"],
|
||||
["All transactions are copied from OP_CODESEPARATOR tests in tx_valid.json"],
|
||||
|
||||
[[["bc7fd132fcf817918334822ee6d9bd95c889099c96e07ca2c1eb2cc70db63224", 0, "CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIG"]],
|
||||
"01000000012432b60dc72cebc1a27ce0969c0989c895bdd9e62e8234839117f8fc32d17fbc000000004a493046022100a576b52051962c25e642c0fd3d77ee6c92487048e5d90818bcf5b51abaccd7900221008204f8fb121be4ec3b24483b1f92d89b1b0548513a134e345c5442e86e8617a501ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE"],
|
||||
[[["83e194f90b6ef21fa2e3a365b63794fb5daa844bdc9b25de30899fcfe7b01047", 0, "CODESEPARATOR CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIG"]],
|
||||
"01000000014710b0e7cf9f8930de259bdc4b84aa5dfb9437b665a3e3a21ff26e0bf994e183000000004a493046022100a166121a61b4eeb19d8f922b978ff6ab58ead8a5a5552bf9be73dc9c156873ea02210092ad9bc43ee647da4f6652c320800debcf08ec20a094a0aaf085f63ecb37a17201ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE"],
|
||||
|
||||
[[["326882a7f22b5191f1a0cc9962ca4b878cd969cf3b3a70887aece4d801a0ba5e", 0, "0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CODESEPARATOR CHECKSIG"]],
|
||||
"01000000015ebaa001d8e4ec7a88703a3bcf69d98c874bca6299cca0f191512bf2a7826832000000004948304502203bf754d1c6732fbf87c5dcd81258aefd30f2060d7bd8ac4a5696f7927091dad1022100f5bcb726c4cf5ed0ed34cc13dadeedf628ae1045b7cb34421bc60b89f4cecae701ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE"],
|
||||
|
||||
[[["a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944", 0, "0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIGVERIFY CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIGVERIFY CODESEPARATOR 1"]],
|
||||
"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a900000000924830450221009c0a27f886a1d8cb87f6f595fbc3163d28f7a81ec3c4b252ee7f3ac77fd13ffa02203caa8dfa09713c8c4d7ef575c75ed97812072405d932bd11e6a1593a98b679370148304502201e3861ef39a526406bad1e20ecad06be7375ad40ddb582c9be42d26c3a0d7b240221009d0a3985e96522e59635d19cc4448547477396ce0ef17a58e7d74c3ef464292301ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE"],
|
||||
|
||||
["CODESEPARATOR in an unexecuted IF block is still invalid"],
|
||||
[[["a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944", 0, "IF CODESEPARATOR ENDIF 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 CHECKSIGVERIFY CODESEPARATOR 1"]],
|
||||
"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a9000000004a48304502207a6974a77c591fa13dff60cabbb85a0de9e025c09c65a4b2285e47ce8e22f761022100f0efaac9ff8ac36b10721e0aae1fb975c90500b50c56e8a0cc52b0403f0425dd0100ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE"],
|
||||
|
||||
["CODESEPARATOR in an executed IF block is invalid"],
|
||||
[[["a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944", 0, "IF CODESEPARATOR ENDIF 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 CHECKSIGVERIFY CODESEPARATOR 1"]],
|
||||
"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a9000000004a483045022100fa4a74ba9fd59c59f46c3960cf90cbe0d2b743c471d24a3d5d6db6002af5eebb02204d70ec490fd0f7055a7c45f86514336e3a7f03503dacecabb247fc23f15c83510151ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE"],
|
||||
|
||||
|
||||
["Using CHECKSIG with signatures in scriptSigs will trigger FindAndDelete, which is invalid"],
|
||||
[[["ccf7f4053a02e653c36ac75c891b7496d0dc5ce5214f6c913d9cf8f1329ebee0", 0, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]],
|
||||
"0100000001e0be9e32f1f89c3d916c4f21e55cdcd096741b895cc76ac353e6023a05f4f7cc00000000d86149304602210086e5f736a2c3622ebb62bd9d93d8e5d76508b98be922b97160edc3dcca6d8c47022100b23c312ac232a4473f19d2aeb95ab7bdf2b65518911a0d72d50e38b5dd31dc820121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac4730440220508fa761865c8abd81244a168392876ee1d94e8ed83897066b5e2df2400dad24022043f5ee7538e87e9c6aef7ef55133d3e51da7cc522830a9c4d736977a76ef755c0121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE"],
|
||||
|
||||
["OP_CODESEPARATOR in scriptSig is invalid"],
|
||||
[[["10c9f0effe83e97f80f067de2b11c6a00c3088a4bce42c5ae761519af9306f3c", 1, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]],
|
||||
"01000000013c6f30f99a5161e75a2ce4bca488300ca0c6112bde67f0807fe983feeff0c91001000000e608646561646265656675ab61493046022100ce18d384221a731c993939015e3d1bcebafb16e8c0b5b5d14097ec8177ae6f28022100bcab227af90bab33c3fe0a9abfee03ba976ee25dc6ce542526e9b2e56e14b7f10121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac493046022100c3b93edcc0fd6250eb32f2dd8a0bba1754b0f6c3be8ed4100ed582f3db73eba2022100bf75b5bd2eff4d6bf2bda2e34a40fcc07d4aa3cf862ceaa77b47b81eff829f9a01ab21038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE"],
|
||||
|
||||
["Again, FindAndDelete() in scriptSig"],
|
||||
[[["6056ebd549003b10cbbd915cea0d82209fe40b8617104be917a26fa92cbe3d6f", 0, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]],
|
||||
"01000000016f3dbe2ca96fa217e94b1017860be49f20820dea5c91bdcb103b0049d5eb566000000000fd1d0147304402203989ac8f9ad36b5d0919d97fa0a7f70c5272abee3b14477dc646288a8b976df5022027d19da84a066af9053ad3d1d7459d171b7e3a80bc6c4ef7a330677a6be548140147304402203989ac8f9ad36b5d0919d97fa0a7f70c5272abee3b14477dc646288a8b976df5022027d19da84a066af9053ad3d1d7459d171b7e3a80bc6c4ef7a330677a6be548140121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac47304402203757e937ba807e4a5da8534c17f9d121176056406a6465054bdd260457515c1a02200f02eccf1bec0f3a0d65df37889143c2e88ab7acec61a7b6f5aa264139141a2b0121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE"],
|
||||
|
||||
[[["5a6b0021a6042a686b6b94abc36b387bef9109847774e8b1e51eb8cc55c53921", 1, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]],
|
||||
"01000000012139c555ccb81ee5b1e87477840991ef7b386bc3ab946b6b682a04a621006b5a01000000fdb40148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f2204148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390175ac4830450220646b72c35beeec51f4d5bc1cbae01863825750d7f490864af354e6ea4f625e9c022100f04b98432df3a9641719dbced53393022e7249fb59db993af1118539830aab870148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a580039017521038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE"],
|
||||
|
||||
["FindAndDelete() in redeemScript"],
|
||||
[[["b5b598de91787439afd5938116654e0b16b7a0d0f82742ba37564219c5afcbf9", 0, "DUP HASH160 0x14 0xf6f365c40f0739b61de827a44751e5e99032ed8f EQUALVERIFY CHECKSIG"],
|
||||
["ab9805c6d57d7070d9a42c5176e47bb705023e6b67249fb6760880548298e742", 0, "HASH160 0x14 0xd8dacdadb7462ae15cd906f1878706d0da8660e6 EQUAL"]],
|
||||
"0100000002f9cbafc519425637ba4227f8d0a0b7160b4e65168193d5af39747891de98b5b5000000006b4830450221008dd619c563e527c47d9bd53534a770b102e40faa87f61433580e04e271ef2f960220029886434e18122b53d5decd25f1f4acb2480659fea20aabd856987ba3c3907e0121022b78b756e2258af13779c1a1f37ea6800259716ca4b7f0b87610e0bf3ab52a01ffffffff42e7988254800876b69f24676b3e0205b77be476512ca4d970707dd5c60598ab00000000fd260100483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a53034930460221008431bdfa72bc67f9d41fe72e94c88fb8f359ffa30b33c72c121c5a877d922e1002210089ef5fc22dd8bfc6bf9ffdb01a9862d27687d424d1fefbab9e9c7176844a187a014c9052483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303210378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71210378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c7153aeffffffff01a08601000000000017a914d8dacdadb7462ae15cd906f1878706d0da8660e68700000000", "P2SH,CONST_SCRIPTCODE"],
|
||||
|
||||
["FindAndDelete() in bare CHECKMULTISIG"],
|
||||
[[["ceafe58e0f6e7d67c0409fbbf673c84c166e3c5d3c24af58f7175b18df3bb3db", 0, "DUP HASH160 0x14 0xf6f365c40f0739b61de827a44751e5e99032ed8f EQUALVERIFY CHECKSIG"],
|
||||
["ceafe58e0f6e7d67c0409fbbf673c84c166e3c5d3c24af58f7175b18df3bb3db", 1, "2 0x48 0x3045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 3 CHECKMULTISIG"]],
|
||||
"0100000002dbb33bdf185b17f758af243c5d3c6e164cc873f6bb9f40c0677d6e0f8ee5afce000000006b4830450221009627444320dc5ef8d7f68f35010b4c050a6ed0d96b67a84db99fda9c9de58b1e02203e4b4aaa019e012e65d69b487fdf8719df72f488fa91506a80c49a33929f1fd50121022b78b756e2258af13779c1a1f37ea6800259716ca4b7f0b87610e0bf3ab52a01ffffffffdbb33bdf185b17f758af243c5d3c6e164cc873f6bb9f40c0677d6e0f8ee5afce010000009300483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303ffffffff01a0860100000000001976a9149bc0bbdd3024da4d0c38ed1aecf5c68dd1d3fa1288ac00000000", "CONST_SCRIPTCODE"],
|
||||
|
||||
["Make diffs cleaner by leaving a comment here without comma at the end"]
|
||||
]
|
||||
520
src/test/data/tx_valid.json
Normal file
520
src/test/data/tx_valid.json
Normal file
|
|
@ -0,0 +1,520 @@
|
|||
[
|
||||
["The following are deserialized transactions which are valid."],
|
||||
["They are in the form"],
|
||||
["[[[prevout hash, prevout index, prevout scriptPubKey, amount?], [input 2], ...],"],
|
||||
["serializedTransaction, excluded verifyFlags]"],
|
||||
["Objects that are only a single string (like this one) are ignored"],
|
||||
|
||||
["The following is 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"],
|
||||
["It is of particular interest because it contains an invalidly-encoded signature which OpenSSL accepts"],
|
||||
["See http://r6.ca/blog/20111119T211504Z.html"],
|
||||
["It is also the first OP_CHECKMULTISIG transaction in standard form"],
|
||||
[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]],
|
||||
"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000490047304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "DERSIG,LOW_S,STRICTENC"],
|
||||
|
||||
["The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"],
|
||||
["It is an OP_CHECKMULTISIG with an arbitrary extra byte stuffed into the signature at pos length - 2"],
|
||||
["The dummy byte is fine however, so the NULLDUMMY flag should be happy"],
|
||||
[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]],
|
||||
"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004a0048304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2bab01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "DERSIG,LOW_S,STRICTENC"],
|
||||
|
||||
["The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63"],
|
||||
["It is an OP_CHECKMULTISIG with the dummy value set to something other than an empty string"],
|
||||
[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]],
|
||||
"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004a01ff47304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "DERSIG,LOW_S,STRICTENC,NULLDUMMY"],
|
||||
|
||||
["As above, but using an OP_1"],
|
||||
[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]],
|
||||
"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000495147304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "DERSIG,LOW_S,STRICTENC,NULLDUMMY"],
|
||||
|
||||
["As above, but using an OP_1NEGATE"],
|
||||
[[["60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1", 0, "1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG"]],
|
||||
"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000494f47304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000", "DERSIG,LOW_S,STRICTENC,NULLDUMMY"],
|
||||
|
||||
["The following is c99c49da4c38af669dea436d3e73780dfdb6c1ecf9958baa52960e8baee30e73"],
|
||||
["It is of interest because it contains a 0-sequence as well as a signature of SIGHASH type 0 (which is not a real type)"],
|
||||
[[["406b2b06bcd34d3c8733e6b79f7a394c8a431fbf4ff5ac705c93f4076bb77602", 0, "DUP HASH160 0x14 0xdc44b1164188067c3a32d4780f5996fa14a4f2d9 EQUALVERIFY CHECKSIG"]],
|
||||
"01000000010276b76b07f4935c70acf54fbf1f438a4c397a9fb7e633873c4dd3bc062b6b40000000008c493046022100d23459d03ed7e9511a47d13292d3430a04627de6235b6e51a40f9cd386f2abe3022100e7d25b080f0bb8d8d5f878bba7d54ad2fda650ea8d158a33ee3cbd11768191fd004104b0e2c879e4daf7b9ab68350228c159766676a14f5815084ba166432aab46198d4cca98fa3e9981d0a90b2effc514b76279476550ba3663fdcaff94c38420e9d5000000000100093d00000000001976a9149a7b0f3b80c6baaeedce0a0842553800f832ba1f88ac00000000", "LOW_S,STRICTENC"],
|
||||
|
||||
["A nearly-standard transaction with CHECKSIGVERIFY 1 instead of CHECKSIG"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", "NONE"],
|
||||
|
||||
["Same as above, but with the signature duplicated in the scriptPubKey with the proper pushdata prefix"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a01"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000", "CLEANSTACK,CONST_SCRIPTCODE"],
|
||||
|
||||
["The following is f7fdd091fa6d8f5e7a8c2458f5c38faffff2d3f1406b6e4fe2c99dcc0d2d1cbb"],
|
||||
["It caught a bug in the workaround for 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63 in an overly simple implementation. In a signature, it contains an ASN1 integer which isn't strict-DER conformant due to being negative, which doesn't make sense in a signature. Before BIP66 activated, it was a valid signature. After it activated, it's not valid any more."],
|
||||
[[["b464e85df2a238416f8bdae11d120add610380ea07f4ef19c5f9dfd472f96c3d", 0, "DUP HASH160 0x14 0xbef80ecf3a44500fda1bc92176e442891662aed2 EQUALVERIFY CHECKSIG"],
|
||||
["b7978cc96e59a8b13e0865d3f95657561a7f725be952438637475920bac9eb21", 1, "DUP HASH160 0x14 0xbef80ecf3a44500fda1bc92176e442891662aed2 EQUALVERIFY CHECKSIG"]],
|
||||
"01000000023d6cf972d4dff9c519eff407ea800361dd0a121de1da8b6f4138a2f25de864b4000000008a4730440220ffda47bfc776bcd269da4832626ac332adfca6dd835e8ecd83cd1ebe7d709b0e022049cffa1cdc102a0b56e0e04913606c70af702a1149dc3b305ab9439288fee090014104266abb36d66eb4218a6dd31f09bb92cf3cfa803c7ea72c1fc80a50f919273e613f895b855fb7465ccbc8919ad1bd4a306c783f22cd3227327694c4fa4c1c439affffffff21ebc9ba20594737864352e95b727f1a565756f9d365083eb1a8596ec98c97b7010000008a4730440220503ff10e9f1e0de731407a4a245531c9ff17676eda461f8ceeb8c06049fa2c810220c008ac34694510298fa60b3f000df01caa244f165b727d4896eb84f81e46bcc4014104266abb36d66eb4218a6dd31f09bb92cf3cfa803c7ea72c1fc80a50f919273e613f895b855fb7465ccbc8919ad1bd4a306c783f22cd3227327694c4fa4c1c439affffffff01f0da5200000000001976a914857ccd42dded6df32949d4646dfa10a92458cfaa88ac00000000", "DERSIG,LOW_S,STRICTENC"],
|
||||
|
||||
["The following tests for the presence of a bug in the handling of SIGHASH_SINGLE"],
|
||||
["It results in signing the constant 1, instead of something generated based on the transaction,"],
|
||||
["when the input doing the signing has an index greater than the maximum output index"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000200", 0, "1"], ["0000000000000000000000000000000000000000000000000000000000000100", 0, "DUP HASH160 0x14 0xe52b482f2faa8ecbf0db344f93c84ac908557f33 EQUALVERIFY CHECKSIG"]],
|
||||
"01000000020002000000000000000000000000000000000000000000000000000000000000000000000151ffffffff0001000000000000000000000000000000000000000000000000000000000000000000006b483045022100c9cdd08798a28af9d1baf44a6c77bcc7e279f47dc487c8c899911bc48feaffcc0220503c5c50ae3998a733263c5c0f7061b483e2b56c4c41b456e7d2f5a78a74c077032102d5c25adb51b61339d2b05315791e21bbe80ea470a49db0135720983c905aace0ffffffff010000000000000000015100000000", "CLEANSTACK"],
|
||||
|
||||
["The following tests SIGHASH_SINGLE|SIGHASHANYONECANPAY inputs"],
|
||||
[[["437a1002eb125dec0f93f635763e0ae45f28ff8e81d82945753d0107611cd390", 1, "DUP HASH160 0x14 0x383fb81cb0a3fc724b5e08cf8bbd404336d711f6 EQUALVERIFY CHECKSIG"],
|
||||
["2d48d32ccad087bcda0ac5b31555bd58d1d2568184cbc8e752dd2be2684af03f", 1, "DUP HASH160 0x14 0x275ec2a233e5b23d43fa19e7bf9beb0cb3996117 EQUALVERIFY CHECKSIG"],
|
||||
["c76168ef1a272a4f176e55e73157ecfce040cfad16a5272f6296eb7089dca846", 1, "DUP HASH160 0x14 0x34fea2c5a75414fd945273ae2d029ce1f28dafcf EQUALVERIFY CHECKSIG"]],
|
||||
"010000000390d31c6107013d754529d8818eff285fe40a3e7635f6930fec5d12eb02107a43010000006b483045022100f40815ae3c81a0dd851cc8d376d6fd226c88416671346a9033468cca2cdcc6c202204f764623903e6c4bed1b734b75d82c40f1725e4471a55ad4f51218f86130ac038321033d710ab45bb54ac99618ad23b3c1da661631aa25f23bfe9d22b41876f1d46e4effffffff3ff04a68e22bdd52e7c8cb848156d2d158bd5515b3c50adabc87d0ca2cd3482d010000006a4730440220598d263c107004008e9e26baa1e770be30fd31ee55ded1898f7c00da05a75977022045536bead322ca246779698b9c3df3003377090f41afeca7fb2ce9e328ec4af2832102b738b531def73020bd637f32935924cc88549c8206976226d968edd3a42fc2d7ffffffff46a8dc8970eb96622f27a516adcf40e0fcec5731e7556e174f2a271aef6861c7010000006b483045022100c5b90a777a9fdc90c208dbef7290d1fc1be651f47151ee4ccff646872a454cf90220640cfbc4550446968fbbe9d12528f3adf7d87b31541569c59e790db8a220482583210391332546e22bbe8fe3af54addfad6f8b83d05fa4f5e047593d4c07ae938795beffffffff028036be26000000001976a914ddfb29efad43a667465ac59ff14dc6442a1adfca88ac3d5cba01000000001976a914b64dde7a505a13ca986c40e86e984a8dc81368b688ac00000000", "NONE"],
|
||||
|
||||
["A valid P2SH Transaction using the standard transaction type put forth in BIP 16"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x8febbed40483661de6958d957412f82deed8e2f7 EQUAL"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100c66c9cdf4c43609586d15424c54707156e316d88b0a1534c9e6b0d4f311406310221009c0fe51dbc9c4ab7cc25d3fdbeccf6679fe6827f08edf2b4a9f16ee3eb0e438a0123210338e8034509af564c62644c07691942e0c056752008a173c89f60ab2a88ac2ebfacffffffff010000000000000000015100000000", "LOW_S"],
|
||||
|
||||
["Tests for CheckTransaction()"],
|
||||
["MAX_MONEY output"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x32afac281462b822adbec5094b8d4d337dd5bd6a EQUAL"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100e1eadba00d9296c743cb6ecc703fd9ddc9b3cd12906176a226ae4c18d6b00796022100a71aef7d2874deff681ba6080f1b278bac7bb99c61b08a85f4311970ffe7f63f012321030c0588dc44d92bdcbf8e72093466766fdc265ead8db64517b0c542275b70fffbacffffffff010040075af0750700015100000000", "LOW_S"],
|
||||
|
||||
["MAX_MONEY output + 0 output"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xb558cbf4930954aa6a344363a15668d7477ae716 EQUAL"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022027deccc14aa6668e78a8c9da3484fbcd4f9dcc9bb7d1b85146314b21b9ae4d86022100d0b43dece8cfb07348de0ca8bc5b86276fa88f7f2138381128b7c36ab2e42264012321029bb13463ddd5d2cc05da6e84e37536cb9525703cfd8f43afdb414988987a92f6acffffffff020040075af075070001510000000000000000015100000000", "LOW_S"],
|
||||
|
||||
["Coinbase of size 2"],
|
||||
["Note the input is just required to make the tester happy"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]],
|
||||
"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025151ffffffff010000000000000000015100000000", "CLEANSTACK"],
|
||||
|
||||
["Coinbase of size 100"],
|
||||
["Note the input is just required to make the tester happy"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]],
|
||||
"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff6451515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151ffffffff010000000000000000015100000000", "CLEANSTACK"],
|
||||
|
||||
["Simple transaction with first input is signed with SIGHASH_ALL, second with SIGHASH_ANYONECANPAY"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"],
|
||||
["0000000000000000000000000000000000000000000000000000000000000200", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"]],
|
||||
"010000000200010000000000000000000000000000000000000000000000000000000000000000000049483045022100d180fd2eb9140aeb4210c9204d3f358766eb53842b2a9473db687fa24b12a3cc022079781799cd4f038b85135bbe49ec2b57f306b2bb17101b17f71f000fcab2b6fb01ffffffff0002000000000000000000000000000000000000000000000000000000000000000000004847304402205f7530653eea9b38699e476320ab135b74771e1c48b81a5d041e2ca84b9be7a802200ac8d1f40fb026674fe5a5edd3dea715c27baa9baca51ed45ea750ac9dc0a55e81ffffffff010100000000000000015100000000", "NONE"],
|
||||
|
||||
["Same as above, but we change the sequence number of the first input to check that SIGHASH_ANYONECANPAY is being followed"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"],
|
||||
["0000000000000000000000000000000000000000000000000000000000000200", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"]],
|
||||
"01000000020001000000000000000000000000000000000000000000000000000000000000000000004948304502203a0f5f0e1f2bdbcd04db3061d18f3af70e07f4f467cbc1b8116f267025f5360b022100c792b6e215afc5afc721a351ec413e714305cb749aae3d7fee76621313418df101010000000002000000000000000000000000000000000000000000000000000000000000000000004847304402205f7530653eea9b38699e476320ab135b74771e1c48b81a5d041e2ca84b9be7a802200ac8d1f40fb026674fe5a5edd3dea715c27baa9baca51ed45ea750ac9dc0a55e81ffffffff010100000000000000015100000000", "LOW_S"],
|
||||
|
||||
["afd9c17f8913577ec3509520bd6e5d63e9c0fd2a5f70c787993b097ba6ca9fae which has several SIGHASH_SINGLE signatures"],
|
||||
[[["63cfa5a09dc540bf63e53713b82d9ea3692ca97cd608c384f2aa88e51a0aac70", 0, "DUP HASH160 0x14 0xdcf72c4fd02f5a987cf9b02f2fabfcac3341a87d EQUALVERIFY CHECKSIG"],
|
||||
["04e8d0fcf3846c6734477b98f0f3d4badfb78f020ee097a0be5fe347645b817d", 1, "DUP HASH160 0x14 0xdcf72c4fd02f5a987cf9b02f2fabfcac3341a87d EQUALVERIFY CHECKSIG"],
|
||||
["ee1377aff5d0579909e11782e1d2f5f7b84d26537be7f5516dd4e43373091f3f", 1, "DUP HASH160 0x14 0xdcf72c4fd02f5a987cf9b02f2fabfcac3341a87d EQUALVERIFY CHECKSIG"]],
|
||||
"010000000370ac0a1ae588aaf284c308d67ca92c69a39e2db81337e563bf40c59da0a5cf63000000006a4730440220360d20baff382059040ba9be98947fd678fb08aab2bb0c172efa996fd8ece9b702201b4fb0de67f015c90e7ac8a193aeab486a1f587e0f54d0fb9552ef7f5ce6caec032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff7d815b6447e35fbea097e00e028fb7dfbad4f3f0987b4734676c84f3fcd0e804010000006b483045022100c714310be1e3a9ff1c5f7cacc65c2d8e781fc3a88ceb063c6153bf950650802102200b2d0979c76e12bb480da635f192cc8dc6f905380dd4ac1ff35a4f68f462fffd032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff3f1f097333e4d46d51f5e77b53264db8f7f5d2e18217e1099957d0f5af7713ee010000006c493046022100b663499ef73273a3788dea342717c2640ac43c5a1cf862c9e09b206fcb3f6bb8022100b09972e75972d9148f2bdd462e5cb69b57c1214b88fc55ca638676c07cfc10d8032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff0380841e00000000001976a914bfb282c70c4191f45b5a6665cad1682f2c9cfdfb88ac80841e00000000001976a9149857cc07bed33a5cf12b9c5e0500b675d500c81188ace0fd1c00000000001976a91443c52850606c872403c0601e69fa34b26f62db4a88ac00000000", "LOW_S"],
|
||||
|
||||
["ddc454a1c0c35c188c98976b17670f69e586d9c0f3593ea879928332f0a069e7, which spends an input that pushes using a PUSHDATA1 that is negative when read as signed"],
|
||||
[[["c5510a5dd97a25f43175af1fe649b707b1df8e1a41489bac33a23087027a2f48", 0, "0x4c 0xae 0x606563686f2022553246736447566b58312b5a536e587574356542793066794778625456415675534a6c376a6a334878416945325364667657734f53474f36633338584d7439435c6e543249584967306a486956304f376e775236644546673d3d22203e20743b206f70656e73736c20656e63202d7061737320706173733a5b314a564d7751432d707269766b65792d6865785d202d64202d6165732d3235362d636263202d61202d696e207460 DROP DUP HASH160 0x14 0xbfd7436b6265aa9de506f8a994f881ff08cc2872 EQUALVERIFY CHECKSIG"]],
|
||||
"0100000001482f7a028730a233ac9b48411a8edfb107b749e61faf7531f4257ad95d0a51c5000000008b483045022100bf0bbae9bde51ad2b222e87fbf67530fbafc25c903519a1e5dcc52a32ff5844e022028c4d9ad49b006dd59974372a54291d5764be541574bb0c4dc208ec51f80b7190141049dd4aad62741dc27d5f267f7b70682eee22e7e9c1923b9c0957bdae0b96374569b460eb8d5b40d972e8c7c0ad441de3d94c4a29864b212d56050acb980b72b2bffffffff0180969800000000001976a914e336d0017a9d28de99d16472f6ca6d5a3a8ebc9988ac00000000", "NONE"],
|
||||
|
||||
["Correct signature order"],
|
||||
["Note the input is just required to make the tester happy"],
|
||||
[[["b3da01dd4aae683c7aee4d5d8b52a540a508e1115f77cd7fa9a291243f501223", 0, "HASH160 0x14 0xb1ce99298d5f07364b57b1e5c9cc00be0b04a954 EQUAL"]],
|
||||
"01000000012312503f2491a2a97fcd775f11e108a540a5528b5d4dee7a3c68ae4add01dab300000000fdfe0000483045022100f6649b0eddfdfd4ad55426663385090d51ee86c3481bdc6b0c18ea6c0ece2c0b0220561c315b07cffa6f7dd9df96dbae9200c2dee09bf93cc35ca05e6cdf613340aa0148304502207aacee820e08b0b174e248abd8d7a34ed63b5da3abedb99934df9fddd65c05c4022100dfe87896ab5ee3df476c2655f9fbe5bd089dccbef3e4ea05b5d121169fe7f5f4014c695221031d11db38972b712a9fe1fc023577c7ae3ddb4a3004187d41c45121eecfdbb5b7210207ec36911b6ad2382860d32989c7b8728e9489d7bbc94a6b5509ef0029be128821024ea9fac06f666a4adc3fc1357b7bec1fd0bdece2b9d08579226a8ebde53058e453aeffffffff0180380100000000001976a914c9b99cddf847d10685a4fabaa0baf505f7c3dfab88ac00000000", "LOW_S"],
|
||||
|
||||
["cc60b1f899ec0a69b7c3f25ddf32c4524096a9c5b01cbd84c6d0312a0c478984, which is a fairly strange transaction which relies on OP_CHECKSIG returning 0 when checking a completely invalid sig of length 0"],
|
||||
[[["cbebc4da731e8995fe97f6fadcd731b36ad40e5ecb31e38e904f6e5982fa09f7", 0, "0x2102085c6600657566acc2d6382a47bc3f324008d2aa10940dd7705a48aa2a5a5e33ac7c2103f5d0fb955f95dd6be6115ce85661db412ec6a08abcbfce7da0ba8297c6cc0ec4ac7c5379a820d68df9e32a147cffa36193c6f7c43a1c8c69cda530e1c6db354bfabdcfefaf3c875379a820f531f3041d3136701ea09067c53e7159c8f9b2746a56c3d82966c54bbc553226879a5479827701200122a59a5379827701200122a59a6353798277537982778779679a68"]],
|
||||
"0100000001f709fa82596e4f908ee331cb5e0ed46ab331d7dcfaf697fe95891e73dac4ebcb000000008c20ca42095840735e89283fec298e62ac2ddea9b5f34a8cbb7097ad965b87568100201b1b01dc829177da4a14551d2fc96a9db00c6501edfa12f22cd9cefd335c227f483045022100a9df60536df5733dd0de6bc921fab0b3eee6426501b43a228afa2c90072eb5ca02201c78b74266fac7d1db5deff080d8a403743203f109fbcabf6d5a760bf87386d20100ffffffff01c075790000000000232103611f9a45c18f28f06f19076ad571c344c82ce8fcfe34464cf8085217a2d294a6ac00000000", "CLEANSTACK"],
|
||||
|
||||
["Empty pubkey"],
|
||||
[[["229257c295e7f555421c1bfec8538dd30a4b5c37c1c8810bbe83cafa7811652c", 0, "0x00 CHECKSIG NOT"]],
|
||||
"01000000012c651178faca83be0b81c8c1375c4b0ad38d53c8fe1b1c4255f5e795c25792220000000049483045022100d6044562284ac76c985018fc4a90127847708c9edb280996c507b28babdc4b2a02203d74eca3f1a4d1eea7ff77b528fde6d5dc324ec2dbfdb964ba885f643b9704cd01ffffffff010100000000000000232102c2410f8891ae918cab4ffc4bb4a3b0881be67c7a1e7faa8b5acf9ab8932ec30cac00000000", "STRICTENC,NULLFAIL"],
|
||||
|
||||
["Empty signature"],
|
||||
[[["9ca93cfd8e3806b9d9e2ba1cf64e3cc6946ee0119670b1796a09928d14ea25f7", 0, "0x21 0x028a1d66975dbdf97897e3a4aef450ebeb5b5293e4a0b4a6d3a2daaa0b2b110e02 CHECKSIG NOT"]],
|
||||
"0100000001f725ea148d92096a79b1709611e06e94c63c4ef61cbae2d9b906388efd3ca99c000000000100ffffffff0101000000000000002321028a1d66975dbdf97897e3a4aef450ebeb5b5293e4a0b4a6d3a2daaa0b2b110e02ac00000000", "NONE"],
|
||||
|
||||
[[["444e00ed7840d41f20ecd9c11d3f91982326c731a02f3c05748414a4fa9e59be", 0, "1 0x00 0x21 0x02136b04758b0b6e363e7a6fbe83aaf527a153db2b060d36cc29f7f8309ba6e458 2 CHECKMULTISIG"]],
|
||||
"0100000001be599efaa4148474053c2fa031c7262398913f1dc1d9ec201fd44078ed004e44000000004900473044022022b29706cb2ed9ef0cb3c97b72677ca2dfd7b4160f7b4beb3ba806aa856c401502202d1e52582412eba2ed474f1f437a427640306fd3838725fab173ade7fe4eae4a01ffffffff010100000000000000232103ac4bba7e7ca3e873eea49e08132ad30c7f03640b6539e9b59903cf14fd016bbbac00000000", "NONE"],
|
||||
|
||||
[[["e16abbe80bf30c080f63830c8dbf669deaef08957446e95940227d8c5e6db612", 0, "1 0x21 0x03905380c7013e36e6e19d305311c1b81fce6581f5ee1c86ef0627c68c9362fc9f 0x00 2 CHECKMULTISIG"]],
|
||||
"010000000112b66d5e8c7d224059e946749508efea9d66bf8d0c83630f080cf30be8bb6ae100000000490047304402206ffe3f14caf38ad5c1544428e99da76ffa5455675ec8d9780fac215ca17953520220779502985e194d84baa36b9bd40a0dbd981163fa191eb884ae83fc5bd1c86b1101ffffffff010100000000000000232103905380c7013e36e6e19d305311c1b81fce6581f5ee1c86ef0627c68c9362fc9fac00000000", "STRICTENC"],
|
||||
|
||||
[[["ebbcf4bfce13292bd791d6a65a2a858d59adbf737e387e40370d4e64cc70efb0", 0, "2 0x21 0x033bcaa0a602f0d44cc9d5637c6e515b0471db514c020883830b7cefd73af04194 0x21 0x03a88b326f8767f4f192ce252afe33c94d25ab1d24f27f159b3cb3aa691ffe1423 2 CHECKMULTISIG NOT"]],
|
||||
"0100000001b0ef70cc644e0d37407e387e73bfad598d852a5aa6d691d72b2913cebff4bceb000000004a00473044022068cd4851fc7f9a892ab910df7a24e616f293bcb5c5fbdfbc304a194b26b60fba022078e6da13d8cb881a22939b952c24f88b97afd06b4c47a47d7f804c9a352a6d6d0100ffffffff0101000000000000002321033bcaa0a602f0d44cc9d5637c6e515b0471db514c020883830b7cefd73af04194ac00000000", "NULLFAIL"],
|
||||
|
||||
[[["ba4cd7ae2ad4d4d13ebfc8ab1d93a63e4a6563f25089a18bf0fc68f282aa88c1", 0, "2 0x21 0x037c615d761e71d38903609bf4f46847266edc2fb37532047d747ba47eaae5ffe1 0x21 0x02edc823cd634f2c4033d94f5755207cb6b60c4b1f1f056ad7471c47de5f2e4d50 2 CHECKMULTISIG NOT"]],
|
||||
"0100000001c188aa82f268fcf08ba18950f263654a3ea6931dabc8bf3ed1d4d42aaed74cba000000004b0000483045022100940378576e069aca261a6b26fb38344e4497ca6751bb10905c76bb689f4222b002204833806b014c26fd801727b792b1260003c55710f87c5adbd7a9cb57446dbc9801ffffffff0101000000000000002321037c615d761e71d38903609bf4f46847266edc2fb37532047d747ba47eaae5ffe1ac00000000", "NULLFAIL"],
|
||||
|
||||
|
||||
["OP_CODESEPARATOR tests"],
|
||||
|
||||
["Test that SignatureHash() removes OP_CODESEPARATOR with FindAndDelete()"],
|
||||
[[["bc7fd132fcf817918334822ee6d9bd95c889099c96e07ca2c1eb2cc70db63224", 0, "CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIG"]],
|
||||
"01000000012432b60dc72cebc1a27ce0969c0989c895bdd9e62e8234839117f8fc32d17fbc000000004a493046022100a576b52051962c25e642c0fd3d77ee6c92487048e5d90818bcf5b51abaccd7900221008204f8fb121be4ec3b24483b1f92d89b1b0548513a134e345c5442e86e8617a501ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE,LOW_S"],
|
||||
[[["83e194f90b6ef21fa2e3a365b63794fb5daa844bdc9b25de30899fcfe7b01047", 0, "CODESEPARATOR CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIG"]],
|
||||
"01000000014710b0e7cf9f8930de259bdc4b84aa5dfb9437b665a3e3a21ff26e0bf994e183000000004a493046022100a166121a61b4eeb19d8f922b978ff6ab58ead8a5a5552bf9be73dc9c156873ea02210092ad9bc43ee647da4f6652c320800debcf08ec20a094a0aaf085f63ecb37a17201ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE,LOW_S"],
|
||||
|
||||
["Hashed data starts at the CODESEPARATOR"],
|
||||
[[["326882a7f22b5191f1a0cc9962ca4b878cd969cf3b3a70887aece4d801a0ba5e", 0, "0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CODESEPARATOR CHECKSIG"]],
|
||||
"01000000015ebaa001d8e4ec7a88703a3bcf69d98c874bca6299cca0f191512bf2a7826832000000004948304502203bf754d1c6732fbf87c5dcd81258aefd30f2060d7bd8ac4a5696f7927091dad1022100f5bcb726c4cf5ed0ed34cc13dadeedf628ae1045b7cb34421bc60b89f4cecae701ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE,LOW_S"],
|
||||
|
||||
["But only if execution has reached it"],
|
||||
[[["a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944", 0, "0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIGVERIFY CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIGVERIFY CODESEPARATOR 1"]],
|
||||
"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a900000000924830450221009c0a27f886a1d8cb87f6f595fbc3163d28f7a81ec3c4b252ee7f3ac77fd13ffa02203caa8dfa09713c8c4d7ef575c75ed97812072405d932bd11e6a1593a98b679370148304502201e3861ef39a526406bad1e20ecad06be7375ad40ddb582c9be42d26c3a0d7b240221009d0a3985e96522e59635d19cc4448547477396ce0ef17a58e7d74c3ef464292301ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE,LOW_S"],
|
||||
|
||||
["CODESEPARATOR in an unexecuted IF block does not change what is hashed"],
|
||||
[[["a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944", 0, "IF CODESEPARATOR ENDIF 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 CHECKSIGVERIFY CODESEPARATOR 1"]],
|
||||
"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a9000000004a48304502207a6974a77c591fa13dff60cabbb85a0de9e025c09c65a4b2285e47ce8e22f761022100f0efaac9ff8ac36b10721e0aae1fb975c90500b50c56e8a0cc52b0403f0425dd0100ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE,LOW_S"],
|
||||
|
||||
["As above, with the IF block executed"],
|
||||
[[["a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944", 0, "IF CODESEPARATOR ENDIF 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 CHECKSIGVERIFY CODESEPARATOR 1"]],
|
||||
"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a9000000004a483045022100fa4a74ba9fd59c59f46c3960cf90cbe0d2b743c471d24a3d5d6db6002af5eebb02204d70ec490fd0f7055a7c45f86514336e3a7f03503dacecabb247fc23f15c83510151ffffffff010000000000000000016a00000000", "CONST_SCRIPTCODE"],
|
||||
|
||||
|
||||
["CHECKSIG is legal in scriptSigs"],
|
||||
[[["ccf7f4053a02e653c36ac75c891b7496d0dc5ce5214f6c913d9cf8f1329ebee0", 0, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]],
|
||||
"0100000001e0be9e32f1f89c3d916c4f21e55cdcd096741b895cc76ac353e6023a05f4f7cc00000000d86149304602210086e5f736a2c3622ebb62bd9d93d8e5d76508b98be922b97160edc3dcca6d8c47022100b23c312ac232a4473f19d2aeb95ab7bdf2b65518911a0d72d50e38b5dd31dc820121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac4730440220508fa761865c8abd81244a168392876ee1d94e8ed83897066b5e2df2400dad24022043f5ee7538e87e9c6aef7ef55133d3e51da7cc522830a9c4d736977a76ef755c0121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "SIGPUSHONLY,CONST_SCRIPTCODE,LOW_S,CLEANSTACK"],
|
||||
|
||||
["Same semantics for OP_CODESEPARATOR"],
|
||||
[[["10c9f0effe83e97f80f067de2b11c6a00c3088a4bce42c5ae761519af9306f3c", 1, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]],
|
||||
"01000000013c6f30f99a5161e75a2ce4bca488300ca0c6112bde67f0807fe983feeff0c91001000000e608646561646265656675ab61493046022100ce18d384221a731c993939015e3d1bcebafb16e8c0b5b5d14097ec8177ae6f28022100bcab227af90bab33c3fe0a9abfee03ba976ee25dc6ce542526e9b2e56e14b7f10121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac493046022100c3b93edcc0fd6250eb32f2dd8a0bba1754b0f6c3be8ed4100ed582f3db73eba2022100bf75b5bd2eff4d6bf2bda2e34a40fcc07d4aa3cf862ceaa77b47b81eff829f9a01ab21038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "SIGPUSHONLY,CONST_SCRIPTCODE,LOW_S,CLEANSTACK"],
|
||||
|
||||
["Signatures are removed from the script they are in by FindAndDelete() in the CHECKSIG code; even multiple instances of one signature can be removed."],
|
||||
[[["6056ebd549003b10cbbd915cea0d82209fe40b8617104be917a26fa92cbe3d6f", 0, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]],
|
||||
"01000000016f3dbe2ca96fa217e94b1017860be49f20820dea5c91bdcb103b0049d5eb566000000000fd1d0147304402203989ac8f9ad36b5d0919d97fa0a7f70c5272abee3b14477dc646288a8b976df5022027d19da84a066af9053ad3d1d7459d171b7e3a80bc6c4ef7a330677a6be548140147304402203989ac8f9ad36b5d0919d97fa0a7f70c5272abee3b14477dc646288a8b976df5022027d19da84a066af9053ad3d1d7459d171b7e3a80bc6c4ef7a330677a6be548140121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac47304402203757e937ba807e4a5da8534c17f9d121176056406a6465054bdd260457515c1a02200f02eccf1bec0f3a0d65df37889143c2e88ab7acec61a7b6f5aa264139141a2b0121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "SIGPUSHONLY,CONST_SCRIPTCODE,CLEANSTACK"],
|
||||
|
||||
["That also includes ahead of the opcode being executed."],
|
||||
[[["5a6b0021a6042a686b6b94abc36b387bef9109847774e8b1e51eb8cc55c53921", 1, "DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG"]],
|
||||
"01000000012139c555ccb81ee5b1e87477840991ef7b386bc3ab946b6b682a04a621006b5a01000000fdb40148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f2204148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390175ac4830450220646b72c35beeec51f4d5bc1cbae01863825750d7f490864af354e6ea4f625e9c022100f04b98432df3a9641719dbced53393022e7249fb59db993af1118539830aab870148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a580039017521038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000", "SIGPUSHONLY,CONST_SCRIPTCODE,LOW_S,CLEANSTACK"],
|
||||
|
||||
["Finally CHECKMULTISIG removes all signatures prior to hashing the script containing those signatures. In conjunction with the SIGHASH_SINGLE bug this lets us test whether or not FindAndDelete() is actually present in scriptPubKey/redeemScript evaluation by including a signature of the digest 0x01 We can compute in advance for our pubkey, embed it in the scriptPubKey, and then also using a normal SIGHASH_ALL signature. If FindAndDelete() wasn't run, the 'bugged' signature would still be in the hashed script, and the normal signature would fail."],
|
||||
|
||||
["Here's an example on mainnet within a P2SH redeemScript. Remarkably it's a standard transaction in <0.9"],
|
||||
[[["b5b598de91787439afd5938116654e0b16b7a0d0f82742ba37564219c5afcbf9", 0, "DUP HASH160 0x14 0xf6f365c40f0739b61de827a44751e5e99032ed8f EQUALVERIFY CHECKSIG"],
|
||||
["ab9805c6d57d7070d9a42c5176e47bb705023e6b67249fb6760880548298e742", 0, "HASH160 0x14 0xd8dacdadb7462ae15cd906f1878706d0da8660e6 EQUAL"]],
|
||||
"0100000002f9cbafc519425637ba4227f8d0a0b7160b4e65168193d5af39747891de98b5b5000000006b4830450221008dd619c563e527c47d9bd53534a770b102e40faa87f61433580e04e271ef2f960220029886434e18122b53d5decd25f1f4acb2480659fea20aabd856987ba3c3907e0121022b78b756e2258af13779c1a1f37ea6800259716ca4b7f0b87610e0bf3ab52a01ffffffff42e7988254800876b69f24676b3e0205b77be476512ca4d970707dd5c60598ab00000000fd260100483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a53034930460221008431bdfa72bc67f9d41fe72e94c88fb8f359ffa30b33c72c121c5a877d922e1002210089ef5fc22dd8bfc6bf9ffdb01a9862d27687d424d1fefbab9e9c7176844a187a014c9052483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303210378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71210378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c7153aeffffffff01a08601000000000017a914d8dacdadb7462ae15cd906f1878706d0da8660e68700000000", "CONST_SCRIPTCODE,LOW_S"],
|
||||
|
||||
["Same idea, but with bare CHECKMULTISIG"],
|
||||
[[["ceafe58e0f6e7d67c0409fbbf673c84c166e3c5d3c24af58f7175b18df3bb3db", 0, "DUP HASH160 0x14 0xf6f365c40f0739b61de827a44751e5e99032ed8f EQUALVERIFY CHECKSIG"],
|
||||
["ceafe58e0f6e7d67c0409fbbf673c84c166e3c5d3c24af58f7175b18df3bb3db", 1, "2 0x48 0x3045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 3 CHECKMULTISIG"]],
|
||||
"0100000002dbb33bdf185b17f758af243c5d3c6e164cc873f6bb9f40c0677d6e0f8ee5afce000000006b4830450221009627444320dc5ef8d7f68f35010b4c050a6ed0d96b67a84db99fda9c9de58b1e02203e4b4aaa019e012e65d69b487fdf8719df72f488fa91506a80c49a33929f1fd50121022b78b756e2258af13779c1a1f37ea6800259716ca4b7f0b87610e0bf3ab52a01ffffffffdbb33bdf185b17f758af243c5d3c6e164cc873f6bb9f40c0677d6e0f8ee5afce010000009300483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303ffffffff01a0860100000000001976a9149bc0bbdd3024da4d0c38ed1aecf5c68dd1d3fa1288ac00000000", "CONST_SCRIPTCODE,LOW_S"],
|
||||
|
||||
|
||||
["CHECKLOCKTIMEVERIFY tests"],
|
||||
|
||||
["By-height locks, with argument == 0 and == tx nLockTime"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKLOCKTIMEVERIFY 1"]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "CLEANSTACK"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 CHECKLOCKTIMEVERIFY"]],
|
||||
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKLOCKTIMEVERIFY 1"]],
|
||||
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d", "CLEANSTACK"],
|
||||
|
||||
["By-time locks, with argument just beyond tx nLockTime (but within numerical boundaries)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 CHECKLOCKTIMEVERIFY"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 CHECKLOCKTIMEVERIFY"]],
|
||||
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 CHECKLOCKTIMEVERIFY"]],
|
||||
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff", "NONE"],
|
||||
|
||||
["Any non-maxint nSequence is fine"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKLOCKTIMEVERIFY 1"]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000feffffff0100000000000000000000000000", "CLEANSTACK"],
|
||||
|
||||
["The argument can be calculated rather than created directly by a PUSHDATA"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 1ADD CHECKLOCKTIMEVERIFY"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "NONE"],
|
||||
|
||||
["Perhaps even by an ADD producing a 5-byte result that is out of bounds for other opcodes"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483647 2147483647 ADD CHECKLOCKTIMEVERIFY"]],
|
||||
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000feffffff", "NONE"],
|
||||
|
||||
["5 byte non-minimally-encoded arguments are valid"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x05 0x0000000000 CHECKLOCKTIMEVERIFY 1"]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "CLEANSTACK,MINIMALDATA"],
|
||||
|
||||
["Valid CHECKLOCKTIMEVERIFY in scriptSig"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"]],
|
||||
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000251b1000000000100000000000000000001000000", "SIGPUSHONLY,CLEANSTACK"],
|
||||
|
||||
["Valid CHECKLOCKTIMEVERIFY in redeemScript"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xc5b93064159b3b2d6ab506a41b1f50463771b988 EQUAL"]],
|
||||
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000030251b1000000000100000000000000000001000000", "NONE"],
|
||||
|
||||
["A transaction with a non-standard DER signature."],
|
||||
[[["b1dbc81696c8a9c0fccd0693ab66d7c368dbc38c0def4e800685560ddd1b2132", 0, "DUP HASH160 0x14 0x4b3bd7eba3bc0284fd3007be7f3be275e94f5826 EQUALVERIFY CHECKSIG"]],
|
||||
"010000000132211bdd0d568506804eef0d8cc3db68c3d766ab9306cdfcc0a9c89616c8dbb1000000006c493045022100c7bb0faea0522e74ff220c20c022d2cb6033f8d167fb89e75a50e237a35fd6d202203064713491b1f8ad5f79e623d0219ad32510bfaa1009ab30cbee77b59317d6e30001210237af13eb2d84e4545af287b919c2282019c9691cc509e78e196a9d8274ed1be0ffffffff0100000000000000001976a914f1b3ed2eda9a2ebe5a9374f692877cdf87c0f95b88ac00000000", "DERSIG,LOW_S,STRICTENC"],
|
||||
|
||||
["CHECKSEQUENCEVERIFY tests"],
|
||||
|
||||
["By-height locks, with argument == 0 and == txin.nSequence"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKSEQUENCEVERIFY 1"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "CLEANSTACK"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "65535 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffff00000100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "65535 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffbf7f0100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKSEQUENCEVERIFY 1"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffbf7f0100000000000000000000000000", "CLEANSTACK"],
|
||||
|
||||
["By-time locks, with argument == 0 and == txin.nSequence"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4194304 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4259839 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffff40000100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4259839 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffff7f0100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4194304 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffff7f0100000000000000000000000000", "NONE"],
|
||||
|
||||
["Upper sequence with upper sequence is fine"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483648 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000800100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000800100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483648 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000feffffff0100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000feffffff0100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483648 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000", "NONE"],
|
||||
|
||||
["Argument 2^31 with various nSequence"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483648 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffbf7f0100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483648 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffff7f0100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483648 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000", "NONE"],
|
||||
|
||||
["Argument 2^32-1 with various nSequence"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffbf7f0100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffff7f0100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000", "NONE"],
|
||||
|
||||
["Argument 3<<31 with various nSequence"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x050000008001 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffbf7f0100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x050000008001 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffff7f0100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x050000008001 CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000", "NONE"],
|
||||
|
||||
["5 byte non-minimally-encoded operandss are valid"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x05 0x0000000000 CHECKSEQUENCEVERIFY 1"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "MINIMALDATA,CLEANSTACK"],
|
||||
|
||||
["The argument can be calculated rather than created directly by a PUSHDATA"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4194303 1ADD CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4194304 1SUB CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffff00000100000000000000000000000000", "NONE"],
|
||||
|
||||
["An ADD producing a 5-byte result that sets CTxIn::SEQUENCE_LOCKTIME_DISABLE_FLAG"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483647 65536 ADD CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "NONE"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483647 4259840 ADD CHECKSEQUENCEVERIFY"]],
|
||||
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000", "NONE"],
|
||||
|
||||
["Valid CHECKSEQUENCEVERIFY in scriptSig"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"]],
|
||||
"02000000010001000000000000000000000000000000000000000000000000000000000000000000000251b2010000000100000000000000000000000000", "SIGPUSHONLY,CLEANSTACK"],
|
||||
|
||||
["Valid CHECKSEQUENCEVERIFY in redeemScript"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x7c17aff532f22beb54069942f9bf567a66133eaf EQUAL"]],
|
||||
"0200000001000100000000000000000000000000000000000000000000000000000000000000000000030251b2010000000100000000000000000000000000", "NONE"],
|
||||
|
||||
["Valid P2WPKH (Private key of segwit tests is L5AQtV2HDm4xGsseLokK2VAT2EtYKcTm3c7HwqnJBFt9LdaQULsM)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 1000]],
|
||||
"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e8030000000000001976a9144c9c3dfac4207d5d8cb89df5722cb3d712385e3f88ac02483045022100cfb07164b36ba64c1b1e8c7720a56ad64d96f6ef332d3d37f9cb3c96477dc44502200a464cd7a9cf94cd70f66ce4f4f0625ef650052c7afcfe29d7d7e01830ff91ed012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc7100000000", "NONE"],
|
||||
|
||||
["Valid P2WSH"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x00 0x20 0xff25429251b5a84f452230a3c75fd886b7fc5a7865ce4a7bb7a9d7c5be6da3db", 1000]],
|
||||
"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e8030000000000001976a9144c9c3dfac4207d5d8cb89df5722cb3d712385e3f88ac02483045022100aa5d8aa40a90f23ce2c3d11bc845ca4a12acd99cbea37de6b9f6d86edebba8cb022022dedc2aa0a255f74d04c0b76ece2d7c691f9dd11a64a8ac49f62a99c3a05f9d01232103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ac00000000", "NONE"],
|
||||
|
||||
["Valid P2SH(P2WPKH)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xfe9c7dacc9fcfbf7e3b7d5ad06aa2b28c5a7b7e3 EQUAL", 1000]],
|
||||
"01000000000101000100000000000000000000000000000000000000000000000000000000000000000000171600144c9c3dfac4207d5d8cb89df5722cb3d712385e3fffffffff01e8030000000000001976a9144c9c3dfac4207d5d8cb89df5722cb3d712385e3f88ac02483045022100cfb07164b36ba64c1b1e8c7720a56ad64d96f6ef332d3d37f9cb3c96477dc44502200a464cd7a9cf94cd70f66ce4f4f0625ef650052c7afcfe29d7d7e01830ff91ed012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc7100000000", "NONE"],
|
||||
|
||||
["Valid P2SH(P2WSH)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x2135ab4f0981830311e35600eebc7376dce3a914 EQUAL", 1000]],
|
||||
"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000023220020ff25429251b5a84f452230a3c75fd886b7fc5a7865ce4a7bb7a9d7c5be6da3dbffffffff01e8030000000000001976a9144c9c3dfac4207d5d8cb89df5722cb3d712385e3f88ac02483045022100aa5d8aa40a90f23ce2c3d11bc845ca4a12acd99cbea37de6b9f6d86edebba8cb022022dedc2aa0a255f74d04c0b76ece2d7c691f9dd11a64a8ac49f62a99c3a05f9d01232103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ac00000000", "NONE"],
|
||||
|
||||
["Witness with SigHash Single|AnyoneCanPay"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3100],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1100],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 3, "0x51", 4100]],
|
||||
"0100000000010400010000000000000000000000000000000000000000000000000000000000000200000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000300000000ffffffff05540b0000000000000151d0070000000000000151840300000000000001513c0f00000000000001512c010000000000000151000248304502210092f4777a0f17bf5aeb8ae768dec5f2c14feabf9d1fe2c89c78dfed0f13fdb86902206da90a86042e252bcd1e80a168c719e4a1ddcc3cebea24b9812c5453c79107e9832103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71000000000000", "NONE"],
|
||||
|
||||
["Witness with SigHash Single|AnyoneCanPay (same signature as previous)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3000]],
|
||||
"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b0000000000000151000248304502210092f4777a0f17bf5aeb8ae768dec5f2c14feabf9d1fe2c89c78dfed0f13fdb86902206da90a86042e252bcd1e80a168c719e4a1ddcc3cebea24b9812c5453c79107e9832103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "NONE"],
|
||||
|
||||
["Witness with SigHash Single"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3000]],
|
||||
"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff0484030000000000000151d0070000000000000151540b0000000000000151c800000000000000015100024730440220699e6b0cfe015b64ca3283e6551440a34f901ba62dd4c72fe1cb815afb2e6761022021cc5e84db498b1479de14efda49093219441adc6c543e5534979605e273d80b032103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "NONE"],
|
||||
|
||||
["Witness with SigHash Single (same signature as previous)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3000]],
|
||||
"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b000000000000015100024730440220699e6b0cfe015b64ca3283e6551440a34f901ba62dd4c72fe1cb815afb2e6761022021cc5e84db498b1479de14efda49093219441adc6c543e5534979605e273d80b032103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "NONE"],
|
||||
|
||||
["Witness with SigHash None|AnyoneCanPay"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3100],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1100],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 3, "0x51", 4100]],
|
||||
"0100000000010400010000000000000000000000000000000000000000000000000000000000000200000000ffffffff00010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000300000000ffffffff04b60300000000000001519e070000000000000151860b00000000000001009600000000000000015100000248304502210091b32274295c2a3fa02f5bce92fb2789e3fc6ea947fbe1a76e52ea3f4ef2381a022079ad72aefa3837a2e0c033a8652a59731da05fa4a813f4fc48e87c075037256b822103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "NONE"],
|
||||
|
||||
["Witness with SigHash None|AnyoneCanPay (same signature as previous)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3000]],
|
||||
"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b0000000000000151000248304502210091b32274295c2a3fa02f5bce92fb2789e3fc6ea947fbe1a76e52ea3f4ef2381a022079ad72aefa3837a2e0c033a8652a59731da05fa4a813f4fc48e87c075037256b822103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "NONE"],
|
||||
|
||||
["Witness with SigHash None"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3000]],
|
||||
"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff04b60300000000000001519e070000000000000151860b0000000000000100960000000000000001510002473044022022fceb54f62f8feea77faac7083c3b56c4676a78f93745adc8a35800bc36adfa022026927df9abcf0a8777829bcfcce3ff0a385fa54c3f9df577405e3ef24ee56479022103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "NONE"],
|
||||
|
||||
["Witness with SigHash None (same signature as previous)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3000]],
|
||||
"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b00000000000001510002473044022022fceb54f62f8feea77faac7083c3b56c4676a78f93745adc8a35800bc36adfa022026927df9abcf0a8777829bcfcce3ff0a385fa54c3f9df577405e3ef24ee56479022103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "NONE"],
|
||||
|
||||
["Witness with SigHash None (same signature, only sequences changed)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3000]],
|
||||
"01000000000103000100000000000000000000000000000000000000000000000000000000000000000000000200000000010000000000000000000000000000000000000000000000000000000000000100000000ffffffff000100000000000000000000000000000000000000000000000000000000000002000000000200000003e8030000000000000151d0070000000000000151b80b00000000000001510002473044022022fceb54f62f8feea77faac7083c3b56c4676a78f93745adc8a35800bc36adfa022026927df9abcf0a8777829bcfcce3ff0a385fa54c3f9df577405e3ef24ee56479022103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "NONE"],
|
||||
|
||||
["Witness with SigHash All|AnyoneCanPay"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3100],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1100],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 3, "0x51", 4100]],
|
||||
"0100000000010400010000000000000000000000000000000000000000000000000000000000000200000000ffffffff00010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000300000000ffffffff03e8030000000000000151d0070000000000000151b80b0000000000000151000002483045022100a3cec69b52cba2d2de623eeef89e0ba1606184ea55476c0f8189fda231bc9cbb022003181ad597f7c380a7d1c740286b1d022b8b04ded028b833282e055e03b8efef812103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "NONE"],
|
||||
|
||||
["Witness with SigHash All|AnyoneCanPay (same signature as previous)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3000]],
|
||||
"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b00000000000001510002483045022100a3cec69b52cba2d2de623eeef89e0ba1606184ea55476c0f8189fda231bc9cbb022003181ad597f7c380a7d1c740286b1d022b8b04ded028b833282e055e03b8efef812103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "NONE"],
|
||||
|
||||
["Unknown witness program version (without DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x60 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 2000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "0x51", 3000]],
|
||||
"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b00000000000001510002483045022100a3cec69b52cba2d2de623ffffffffff1606184ea55476c0f8189fda231bc9cbb022003181ad597f7c380a7d1c740286b1d022b8b04ded028b833282e055e03b8efef812103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM"],
|
||||
|
||||
["Witness with a push of 520 bytes"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x00 0x20 0x33198a9bfef674ebddb9ffaa52928017b8472791e54c609cb95f278ac6b1e349", 1000]],
|
||||
"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff010000000000000000015102fd08020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002755100000000", "NONE"],
|
||||
|
||||
["Transaction mixing all SigHash, segwit and normal inputs"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 1001],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 2, "DUP HASH160 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f EQUALVERIFY CHECKSIG", 1002],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 3, "DUP HASH160 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f EQUALVERIFY CHECKSIG", 1003],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 4, "DUP HASH160 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f EQUALVERIFY CHECKSIG", 1004],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 5, "DUP HASH160 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f EQUALVERIFY CHECKSIG", 1005],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 6, "DUP HASH160 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f EQUALVERIFY CHECKSIG", 1006],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 7, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 1007],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 8, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 1008],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 9, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 1009],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 10, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 1010],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 11, "DUP HASH160 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f EQUALVERIFY CHECKSIG", 1011]],
|
||||
"0100000000010c00010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff0001000000000000000000000000000000000000000000000000000000000000020000006a473044022026c2e65b33fcd03b2a3b0f25030f0244bd23cc45ae4dec0f48ae62255b1998a00220463aa3982b718d593a6b9e0044513fd67a5009c2fdccc59992cffc2b167889f4012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ffffffff0001000000000000000000000000000000000000000000000000000000000000030000006a4730440220008bd8382911218dcb4c9f2e75bf5c5c3635f2f2df49b36994fde85b0be21a1a02205a539ef10fb4c778b522c1be852352ea06c67ab74200977c722b0bc68972575a012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ffffffff0001000000000000000000000000000000000000000000000000000000000000040000006b483045022100d9436c32ff065127d71e1a20e319e4fe0a103ba0272743dbd8580be4659ab5d302203fd62571ee1fe790b182d078ecfd092a509eac112bea558d122974ef9cc012c7012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ffffffff0001000000000000000000000000000000000000000000000000000000000000050000006a47304402200e2c149b114ec546015c13b2b464bbcb0cdc5872e6775787527af6cbc4830b6c02207e9396c6979fb15a9a2b96ca08a633866eaf20dc0ff3c03e512c1d5a1654f148012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ffffffff0001000000000000000000000000000000000000000000000000000000000000060000006b483045022100b20e70d897dc15420bccb5e0d3e208d27bdd676af109abbd3f88dbdb7721e6d6022005836e663173fbdfe069f54cde3c2decd3d0ea84378092a5d9d85ec8642e8a41012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ffffffff00010000000000000000000000000000000000000000000000000000000000000700000000ffffffff00010000000000000000000000000000000000000000000000000000000000000800000000ffffffff00010000000000000000000000000000000000000000000000000000000000000900000000ffffffff00010000000000000000000000000000000000000000000000000000000000000a00000000ffffffff00010000000000000000000000000000000000000000000000000000000000000b0000006a47304402206639c6e05e3b9d2675a7f3876286bdf7584fe2bbd15e0ce52dd4e02c0092cdc60220757d60b0a61fc95ada79d23746744c72bac1545a75ff6c2c7cdb6ae04e7e9592012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ffffffff0ce8030000000000000151e9030000000000000151ea030000000000000151eb030000000000000151ec030000000000000151ed030000000000000151ee030000000000000151ef030000000000000151f0030000000000000151f1030000000000000151f2030000000000000151f30300000000000001510248304502210082219a54f61bf126bfc3fa068c6e33831222d1d7138c6faa9d33ca87fd4202d6022063f9902519624254d7c2c8ea7ba2d66ae975e4e229ae38043973ec707d5d4a83012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc7102473044022017fb58502475848c1b09f162cb1688d0920ff7f142bed0ef904da2ccc88b168f02201798afa61850c65e77889cbcd648a5703b487895517c88f85cdd18b021ee246a012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc7100000000000247304402202830b7926e488da75782c81a54cd281720890d1af064629ebf2e31bf9f5435f30220089afaa8b455bbeb7d9b9c3fe1ed37d07685ade8455c76472cda424d93e4074a012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc7102473044022026326fcdae9207b596c2b05921dbac11d81040c4d40378513670f19d9f4af893022034ecd7a282c0163b89aaa62c22ec202cef4736c58cd251649bad0d8139bcbf55012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71024730440220214978daeb2f38cd426ee6e2f44131a33d6b191af1c216247f1dd7d74c16d84a02205fdc05529b0bc0c430b4d5987264d9d075351c4f4484c16e91662e90a72aab24012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710247304402204a6e9f199dc9672cf2ff8094aaa784363be1eb62b679f7ff2df361124f1dca3302205eeb11f70fab5355c9c8ad1a0700ea355d315e334822fa182227e9815308ee8f012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000", "NONE"],
|
||||
|
||||
["Unknown version witness program with empty witness"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x60 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 1000]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e803000000000000015100000000", "DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM"],
|
||||
|
||||
["Witness SIGHASH_SINGLE with output out of bound"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x51", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x20 0x4d6c2a32c87821d68fc016fca70797abdb80df6cd84651d40a9300c6bad79e62", 1000]],
|
||||
"0100000000010200010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff01d00700000000000001510003483045022100e078de4e96a0e05dcdc0a414124dd8475782b5f3f0ed3f607919e9a5eeeb22bf02201de309b3a3109adb3de8074b3610d4cf454c49b61247a2779a0bcbf31c889333032103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc711976a9144c9c3dfac4207d5d8cb89df5722cb3d712385e3f88ac00000000", "NONE"],
|
||||
|
||||
["1 byte push should not be considered a witness scriptPubKey"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x60 0x01 0x01", 1000]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e803000000000000015100000000", "MINIMALDATA,CLEANSTACK"],
|
||||
|
||||
["41 bytes push should not be considered a witness scriptPubKey"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x60 0x29 0xff25429251b5a84f452230a3c75fd886b7fc5a7865ce4a7bb7a9d7c5be6da3dbff0000000000000000", 1000]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e803000000000000015100000000", "CLEANSTACK"],
|
||||
|
||||
["The witness version must use OP_1 to OP_16 only"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x01 0x10 0x02 0x0001", 1000]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e803000000000000015100000000", "MINIMALDATA,CLEANSTACK"],
|
||||
|
||||
["The witness program push must be canonical"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x60 0x4c02 0x0001", 1000]],
|
||||
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e803000000000000015100000000", "MINIMALDATA,CLEANSTACK"],
|
||||
|
||||
["Witness Single|AnyoneCanPay does not hash input's position"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 1001]],
|
||||
"0100000000010200010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff02e8030000000000000151e90300000000000001510247304402206d59682663faab5e4cb733c562e22cdae59294895929ec38d7c016621ff90da0022063ef0af5f970afe8a45ea836e3509b8847ed39463253106ac17d19c437d3d56b832103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710248304502210085001a820bfcbc9f9de0298af714493f8a37b3b354bfd21a7097c3e009f2018c022050a8b4dbc8155d4d04da2f5cdd575dcf8dd0108de8bec759bd897ea01ecb3af7832103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc7100000000", "NONE"],
|
||||
|
||||
["Witness Single|AnyoneCanPay does not hash input's position (permutation)"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 1001],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 1000]],
|
||||
"0100000000010200010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000000000000ffffffff02e9030000000000000151e80300000000000001510248304502210085001a820bfcbc9f9de0298af714493f8a37b3b354bfd21a7097c3e009f2018c022050a8b4dbc8155d4d04da2f5cdd575dcf8dd0108de8bec759bd897ea01ecb3af7832103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710247304402206d59682663faab5e4cb733c562e22cdae59294895929ec38d7c016621ff90da0022063ef0af5f970afe8a45ea836e3509b8847ed39463253106ac17d19c437d3d56b832103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc7100000000", "NONE"],
|
||||
|
||||
["Non witness Single|AnyoneCanPay hash input's position"],
|
||||
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x21 0x03596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71 CHECKSIG", 1000],
|
||||
["0000000000000000000000000000000000000000000000000000000000000100", 1, "0x21 0x03596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71 CHECKSIG", 1001]],
|
||||
"01000000020001000000000000000000000000000000000000000000000000000000000000000000004847304402202a0b4b1294d70540235ae033d78e64b4897ec859c7b6f1b2b1d8a02e1d46006702201445e756d2254b0f1dfda9ab8e1e1bc26df9668077403204f32d16a49a36eb6983ffffffff00010000000000000000000000000000000000000000000000000000000000000100000049483045022100acb96cfdbda6dc94b489fd06f2d720983b5f350e31ba906cdbd800773e80b21c02200d74ea5bdf114212b4bbe9ed82c36d2e369e302dff57cb60d01c428f0bd3daab83ffffffff02e8030000000000000151e903000000000000015100000000", "NONE"],
|
||||
|
||||
["BIP143 examples: details and private keys are available in BIP143"],
|
||||
["BIP143 example: P2WSH with OP_CODESEPARATOR and out-of-range SIGHASH_SINGLE."],
|
||||
[[["6eb316926b1c5d567cd6f5e6a84fec606fc53d7b474526d1fff3948020c93dfe", 0, "0x21 0x036d5c20fa14fb2f635474c1dc4ef5909d4568e5569b79fc94d3448486e14685f8 CHECKSIG", 156250000],
|
||||
["f825690aee1b3dc247da796cacb12687a5e802429fd291cfd63e010f02cf1508", 0, "0x00 0x20 0x5d1b56b63d714eebe542309525f484b7e9d6f686b3781b6f61ef925d66d6f6a0", 4900000000]],
|
||||
"01000000000102fe3dc9208094f3ffd12645477b3dc56f60ec4fa8e6f5d67c565d1c6b9216b36e000000004847304402200af4e47c9b9629dbecc21f73af989bdaa911f7e6f6c2e9394588a3aa68f81e9902204f3fcf6ade7e5abb1295b6774c8e0abd94ae62217367096bc02ee5e435b67da201ffffffff0815cf020f013ed6cf91d29f4202e8a58726b1ac6c79da47c23d1bee0a6925f80000000000ffffffff0100f2052a010000001976a914a30741f8145e5acadf23f751864167f32e0963f788ac000347304402200de66acf4527789bfda55fc5459e214fa6083f936b430a762c629656216805ac0220396f550692cd347171cbc1ef1f51e15282e837bb2b30860dc77c8f78bc8501e503473044022027dc95ad6b740fe5129e7e62a75dd00f291a2aeb1200b84b09d9e3789406b6c002201a9ecd315dd6a0e632ab20bbb98948bc0c6fb204f2c286963bb48517a7058e27034721026dccc749adc2a9d0d89497ac511f760f45c47dc5ed9cf352a58ac706453880aeadab210255a9626aebf5e29c0e6538428ba0d1dcf6ca98ffdf086aa8ced5e0d0215ea465ac00000000", "NONE"],
|
||||
|
||||
["BIP143 example: P2WSH with unexecuted OP_CODESEPARATOR and SINGLE|ANYONECANPAY"],
|
||||
[[["01c0cf7fba650638e55eb91261b183251fbb466f90dff17f10086817c542b5e9", 0, "0x00 0x20 0xba468eea561b26301e4cf69fa34bde4ad60c81e70f059f045ca9a79931004a4d", 16777215],
|
||||
["1b2a9a426ba603ba357ce7773cb5805cb9c7c2b386d100d1fc9263513188e680", 0, "0x00 0x20 0xd9bbfbe56af7c4b7f960a70d7ea107156913d9e5a26b0a71429df5e097ca6537", 16777215]],
|
||||
"01000000000102e9b542c5176808107ff1df906f46bb1f2583b16112b95ee5380665ba7fcfc0010000000000ffffffff80e68831516392fcd100d186b3c2c7b95c80b53c77e77c35ba03a66b429a2a1b0000000000ffffffff0280969800000000001976a914de4b231626ef508c9a74a8517e6783c0546d6b2888ac80969800000000001976a9146648a8cd4531e1ec47f35916de8e259237294d1e88ac02483045022100f6a10b8604e6dc910194b79ccfc93e1bc0ec7c03453caaa8987f7d6c3413566002206216229ede9b4d6ec2d325be245c5b508ff0339bf1794078e20bfe0babc7ffe683270063ab68210392972e2eb617b2388771abe27235fd5ac44af8e61693261550447a4c3e39da98ac024730440220032521802a76ad7bf74d0e2c218b72cf0cbc867066e2e53db905ba37f130397e02207709e2188ed7f08f4c952d9d13986da504502b8c3be59617e043552f506c46ff83275163ab68210392972e2eb617b2388771abe27235fd5ac44af8e61693261550447a4c3e39da98ac00000000", "NONE"],
|
||||
|
||||
["BIP143 example: Same as the previous example with input-output pairs swapped"],
|
||||
[[["1b2a9a426ba603ba357ce7773cb5805cb9c7c2b386d100d1fc9263513188e680", 0, "0x00 0x20 0xd9bbfbe56af7c4b7f960a70d7ea107156913d9e5a26b0a71429df5e097ca6537", 16777215],
|
||||
["01c0cf7fba650638e55eb91261b183251fbb466f90dff17f10086817c542b5e9", 0, "0x00 0x20 0xba468eea561b26301e4cf69fa34bde4ad60c81e70f059f045ca9a79931004a4d", 16777215]],
|
||||
"0100000000010280e68831516392fcd100d186b3c2c7b95c80b53c77e77c35ba03a66b429a2a1b0000000000ffffffffe9b542c5176808107ff1df906f46bb1f2583b16112b95ee5380665ba7fcfc0010000000000ffffffff0280969800000000001976a9146648a8cd4531e1ec47f35916de8e259237294d1e88ac80969800000000001976a914de4b231626ef508c9a74a8517e6783c0546d6b2888ac024730440220032521802a76ad7bf74d0e2c218b72cf0cbc867066e2e53db905ba37f130397e02207709e2188ed7f08f4c952d9d13986da504502b8c3be59617e043552f506c46ff83275163ab68210392972e2eb617b2388771abe27235fd5ac44af8e61693261550447a4c3e39da98ac02483045022100f6a10b8604e6dc910194b79ccfc93e1bc0ec7c03453caaa8987f7d6c3413566002206216229ede9b4d6ec2d325be245c5b508ff0339bf1794078e20bfe0babc7ffe683270063ab68210392972e2eb617b2388771abe27235fd5ac44af8e61693261550447a4c3e39da98ac00000000", "NONE"],
|
||||
|
||||
["BIP143 example: P2SH-P2WSH 6-of-6 multisig signed with 6 different SIGHASH types"],
|
||||
[[["6eb98797a21c6c10aa74edf29d618be109f48a8e94c694f3701e08ca69186436", 1, "HASH160 0x14 0x9993a429037b5d912407a71c252019287b8d27a5 EQUAL", 987654321]],
|
||||
"0100000000010136641869ca081e70f394c6948e8af409e18b619df2ed74aa106c1ca29787b96e0100000023220020a16b5755f7f6f96dbd65f5f0d6ab9418b89af4b1f14a1bb8a09062c35f0dcb54ffffffff0200e9a435000000001976a914389ffce9cd9ae88dcc0631e88a821ffdbe9bfe2688acc0832f05000000001976a9147480a33f950689af511e6e84c138dbbd3c3ee41588ac080047304402206ac44d672dac41f9b00e28f4df20c52eeb087207e8d758d76d92c6fab3b73e2b0220367750dbbe19290069cba53d096f44530e4f98acaa594810388cf7409a1870ce01473044022068c7946a43232757cbdf9176f009a928e1cd9a1a8c212f15c1e11ac9f2925d9002205b75f937ff2f9f3c1246e547e54f62e027f64eefa2695578cc6432cdabce271502473044022059ebf56d98010a932cf8ecfec54c48e6139ed6adb0728c09cbe1e4fa0915302e022007cd986c8fa870ff5d2b3a89139c9fe7e499259875357e20fcbb15571c76795403483045022100fbefd94bd0a488d50b79102b5dad4ab6ced30c4069f1eaa69a4b5a763414067e02203156c6a5c9cf88f91265f5a942e96213afae16d83321c8b31bb342142a14d16381483045022100a5263ea0553ba89221984bd7f0b13613db16e7a70c549a86de0cc0444141a407022005c360ef0ae5a5d4f9f2f87a56c1546cc8268cab08c73501d6b3be2e1e1a8a08824730440220525406a1482936d5a21888260dc165497a90a15669636d8edca6b9fe490d309c022032af0c646a34a44d1f4576bf6a4a74b67940f8faa84c7df9abe12a01a11e2b4783cf56210307b8ae49ac90a048e9b53357a2354b3334e9c8bee813ecb98e99a7e07e8c3ba32103b28f0c28bfab54554ae8c658ac5c3e0ce6e79ad336331f78c428dd43eea8449b21034b8113d703413d57761b8b9781957b8c0ac1dfe69f492580ca4195f50376ba4a21033400f6afecb833092a9a21cfdf1ed1376e58c5d1f47de74683123987e967a8f42103a6d48b1131e94ba04d9737d61acdaa1322008af9602b3b14862c07a1789aac162102d8b661b0b3302ee2f162b09e07a55ad5dfbe673a9f01d9f0c19617681024306b56ae00000000", "NONE"],
|
||||
|
||||
["FindAndDelete tests"],
|
||||
["This is a test of FindAndDelete. The first tx is a spend of normal P2SH and the second tx is a spend of bare P2WSH."],
|
||||
["The redeemScript/witnessScript is CHECKSIGVERIFY <0x30450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e01>."],
|
||||
["The signature is <0x30450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e01> <pubkey>,"],
|
||||
["where the pubkey is obtained through key recovery with sig and correct sighash."],
|
||||
["This is to show that FindAndDelete is applied only to non-segwit scripts"],
|
||||
["Non-segwit: correct sighash (with FindAndDelete) = 1ba1fe3bc90c5d1265460e684ce6774e324f0fabdf67619eda729e64e8b6bc08"],
|
||||
[[["f18783ace138abac5d3a7a5cf08e88fe6912f267ef936452e0c27d090621c169", 7000, "HASH160 0x14 0x0c746489e2d83cdbb5b90b432773342ba809c134 EQUAL", 200000]],
|
||||
"010000000169c12106097dc2e0526493ef67f21269fe888ef05c7a3a5dacab38e1ac8387f1581b0000b64830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0121037a3fb04bcdb09eba90f69961ba1692a3528e45e67c85b200df820212d7594d334aad4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e01ffffffff0101000000000000000000000000", "CONST_SCRIPTCODE,LOW_S"],
|
||||
["BIP143: correct sighash (without FindAndDelete) = 71c9cd9b2869b9c70b01b1f0360c148f42dee72297db312638df136f43311f23"],
|
||||
[[["f18783ace138abac5d3a7a5cf08e88fe6912f267ef936452e0c27d090621c169", 7500, "0x00 0x20 0x9e1be07558ea5cc8e02ed1d80c0911048afad949affa36d5c3951e3159dbea19", 200000]],
|
||||
"0100000000010169c12106097dc2e0526493ef67f21269fe888ef05c7a3a5dacab38e1ac8387f14c1d000000ffffffff01010000000000000000034830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e012102a9781d66b61fb5a7ef00ac5ad5bc6ffc78be7b44a566e3c87870e1079368df4c4aad4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0100000000", "LOW_S"],
|
||||
["This is multisig version of the FindAndDelete tests"],
|
||||
["Script is 2 CHECKMULTISIGVERIFY <sig1> <sig2> DROP"],
|
||||
["52af4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c0395960175"],
|
||||
["Signature is 0 <sig1> <sig2> 2 <key1> <key2>"],
|
||||
["Non-segwit: correct sighash (with FindAndDelete) = 1d50f00ba4db2917b903b0ec5002e017343bb38876398c9510570f5dce099295"],
|
||||
[[["9628667ad48219a169b41b020800162287d2c0f713c04157e95c484a8dcb7592", 7000, "HASH160 0x14 0x5748407f5ca5cdca53ba30b79040260770c9ee1b EQUAL", 200000]],
|
||||
"01000000019275cb8d4a485ce95741c013f7c0d28722160008021bb469a11982d47a662896581b0000fd6f01004830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c03959601522102cd74a2809ffeeed0092bc124fd79836706e41f048db3f6ae9df8708cefb83a1c2102e615999372426e46fd107b76eaf007156a507584aa2cc21de9eee3bdbd26d36c4c9552af4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c0395960175ffffffff0101000000000000000000000000", "CONST_SCRIPTCODE,LOW_S"],
|
||||
["BIP143: correct sighash (without FindAndDelete) = c1628a1e7c67f14ca0c27c06e4fdeec2e6d1a73c7a91d7c046ff83e835aebb72"],
|
||||
[[["9628667ad48219a169b41b020800162287d2c0f713c04157e95c484a8dcb7592", 7500, "0x00 0x20 0x9b66c15b4e0b4eb49fa877982cafded24859fe5b0e2dbfbe4f0df1de7743fd52", 200000]],
|
||||
"010000000001019275cb8d4a485ce95741c013f7c0d28722160008021bb469a11982d47a6628964c1d000000ffffffff0101000000000000000007004830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c0395960101022102966f109c54e85d3aee8321301136cedeb9fc710fdef58a9de8a73942f8e567c021034ffc99dd9a79dd3cb31e2ab3e0b09e0e67db41ac068c625cd1f491576016c84e9552af4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c039596017500000000", "LOW_S"],
|
||||
|
||||
["Test long outputs, which are streamed using length-prefixed digibyte strings. This might be surprising."],
|
||||
[[["1111111111111111111111111111111111111111111111111111111111111111", 0, "0x00 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6", 5000000]],
|
||||
"0100000000010111111111111111111111111111111111111111111111111111111111111111110000000000ffffffff0130244c0000000000fd02014cdc1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111175210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac02483045022100c1a4a6581996a7fdfea77d58d537955a5655c1d619b6f3ab6874f28bb2e19708022056402db6fede03caae045a3be616a1a2d0919a475ed4be828dc9ff21f24063aa01210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179800000000", "NONE"],
|
||||
|
||||
["Make diffs cleaner by leaving a comment here without comma at the end"]
|
||||
]
|
||||
416
src/test/dbwrapper_tests.cpp
Normal file
416
src/test/dbwrapper_tests.cpp
Normal file
|
|
@ -0,0 +1,416 @@
|
|||
// Copyright (c) 2009-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <dbwrapper.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <uint256.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
// Test if a string consists entirely of null characters
|
||||
static bool is_null_key(const std::vector<unsigned char>& key) {
|
||||
bool isnull = true;
|
||||
|
||||
for (unsigned int i = 0; i < key.size(); i++)
|
||||
isnull &= (key[i] == '\x00');
|
||||
|
||||
return isnull;
|
||||
}
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(dbwrapper_tests, BasicTestingSetup)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(dbwrapper)
|
||||
{
|
||||
// Perform tests both obfuscated and non-obfuscated.
|
||||
for (const bool obfuscate : {false, true}) {
|
||||
fs::path ph = m_args.GetDataDirBase() / (obfuscate ? "dbwrapper_obfuscate_true" : "dbwrapper_obfuscate_false");
|
||||
CDBWrapper dbw(ph, (1 << 20), true, false, obfuscate);
|
||||
uint8_t key{'k'};
|
||||
uint256 in = InsecureRand256();
|
||||
uint256 res;
|
||||
|
||||
// Ensure that we're doing real obfuscation when obfuscate=true
|
||||
BOOST_CHECK(obfuscate != is_null_key(dbwrapper_private::GetObfuscateKey(dbw)));
|
||||
|
||||
BOOST_CHECK(dbw.Write(key, in));
|
||||
BOOST_CHECK(dbw.Read(key, res));
|
||||
BOOST_CHECK_EQUAL(res.ToString(), in.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(dbwrapper_basic_data)
|
||||
{
|
||||
// Perform tests both obfuscated and non-obfuscated.
|
||||
for (bool obfuscate : {false, true}) {
|
||||
fs::path ph = m_args.GetDataDirBase() / (obfuscate ? "dbwrapper_1_obfuscate_true" : "dbwrapper_1_obfuscate_false");
|
||||
CDBWrapper dbw(ph, (1 << 20), false, true, obfuscate);
|
||||
|
||||
uint256 res;
|
||||
uint32_t res_uint_32;
|
||||
bool res_bool;
|
||||
|
||||
// Ensure that we're doing real obfuscation when obfuscate=true
|
||||
BOOST_CHECK(obfuscate != is_null_key(dbwrapper_private::GetObfuscateKey(dbw)));
|
||||
|
||||
//Simulate block raw data - "b + block hash"
|
||||
std::string key_block = "b" + InsecureRand256().ToString();
|
||||
|
||||
uint256 in_block = InsecureRand256();
|
||||
BOOST_CHECK(dbw.Write(key_block, in_block));
|
||||
BOOST_CHECK(dbw.Read(key_block, res));
|
||||
BOOST_CHECK_EQUAL(res.ToString(), in_block.ToString());
|
||||
|
||||
//Simulate file raw data - "f + file_number"
|
||||
std::string key_file = strprintf("f%04x", InsecureRand32());
|
||||
|
||||
uint256 in_file_info = InsecureRand256();
|
||||
BOOST_CHECK(dbw.Write(key_file, in_file_info));
|
||||
BOOST_CHECK(dbw.Read(key_file, res));
|
||||
BOOST_CHECK_EQUAL(res.ToString(), in_file_info.ToString());
|
||||
|
||||
//Simulate transaction raw data - "t + transaction hash"
|
||||
std::string key_transaction = "t" + InsecureRand256().ToString();
|
||||
|
||||
uint256 in_transaction = InsecureRand256();
|
||||
BOOST_CHECK(dbw.Write(key_transaction, in_transaction));
|
||||
BOOST_CHECK(dbw.Read(key_transaction, res));
|
||||
BOOST_CHECK_EQUAL(res.ToString(), in_transaction.ToString());
|
||||
|
||||
//Simulate UTXO raw data - "c + transaction hash"
|
||||
std::string key_utxo = "c" + InsecureRand256().ToString();
|
||||
|
||||
uint256 in_utxo = InsecureRand256();
|
||||
BOOST_CHECK(dbw.Write(key_utxo, in_utxo));
|
||||
BOOST_CHECK(dbw.Read(key_utxo, res));
|
||||
BOOST_CHECK_EQUAL(res.ToString(), in_utxo.ToString());
|
||||
|
||||
//Simulate last block file number - "l"
|
||||
uint8_t key_last_blockfile_number{'l'};
|
||||
uint32_t lastblockfilenumber = InsecureRand32();
|
||||
BOOST_CHECK(dbw.Write(key_last_blockfile_number, lastblockfilenumber));
|
||||
BOOST_CHECK(dbw.Read(key_last_blockfile_number, res_uint_32));
|
||||
BOOST_CHECK_EQUAL(lastblockfilenumber, res_uint_32);
|
||||
|
||||
//Simulate Is Reindexing - "R"
|
||||
uint8_t key_IsReindexing{'R'};
|
||||
bool isInReindexing = InsecureRandBool();
|
||||
BOOST_CHECK(dbw.Write(key_IsReindexing, isInReindexing));
|
||||
BOOST_CHECK(dbw.Read(key_IsReindexing, res_bool));
|
||||
BOOST_CHECK_EQUAL(isInReindexing, res_bool);
|
||||
|
||||
//Simulate last block hash up to which UXTO covers - 'B'
|
||||
uint8_t key_lastblockhash_uxto{'B'};
|
||||
uint256 lastblock_hash = InsecureRand256();
|
||||
BOOST_CHECK(dbw.Write(key_lastblockhash_uxto, lastblock_hash));
|
||||
BOOST_CHECK(dbw.Read(key_lastblockhash_uxto, res));
|
||||
BOOST_CHECK_EQUAL(lastblock_hash, res);
|
||||
|
||||
//Simulate file raw data - "F + filename_number + filename"
|
||||
std::string file_option_tag = "F";
|
||||
uint8_t filename_length = InsecureRandBits(8);
|
||||
std::string filename = "randomfilename";
|
||||
std::string key_file_option = strprintf("%s%01x%s", file_option_tag,filename_length,filename);
|
||||
|
||||
bool in_file_bool = InsecureRandBool();
|
||||
BOOST_CHECK(dbw.Write(key_file_option, in_file_bool));
|
||||
BOOST_CHECK(dbw.Read(key_file_option, res_bool));
|
||||
BOOST_CHECK_EQUAL(res_bool, in_file_bool);
|
||||
}
|
||||
}
|
||||
|
||||
// Test batch operations
|
||||
BOOST_AUTO_TEST_CASE(dbwrapper_batch)
|
||||
{
|
||||
// Perform tests both obfuscated and non-obfuscated.
|
||||
for (const bool obfuscate : {false, true}) {
|
||||
fs::path ph = m_args.GetDataDirBase() / (obfuscate ? "dbwrapper_batch_obfuscate_true" : "dbwrapper_batch_obfuscate_false");
|
||||
CDBWrapper dbw(ph, (1 << 20), true, false, obfuscate);
|
||||
|
||||
uint8_t key{'i'};
|
||||
uint256 in = InsecureRand256();
|
||||
uint8_t key2{'j'};
|
||||
uint256 in2 = InsecureRand256();
|
||||
uint8_t key3{'k'};
|
||||
uint256 in3 = InsecureRand256();
|
||||
|
||||
uint256 res;
|
||||
CDBBatch batch(dbw);
|
||||
|
||||
batch.Write(key, in);
|
||||
batch.Write(key2, in2);
|
||||
batch.Write(key3, in3);
|
||||
|
||||
// Remove key3 before it's even been written
|
||||
batch.Erase(key3);
|
||||
|
||||
BOOST_CHECK(dbw.WriteBatch(batch));
|
||||
|
||||
BOOST_CHECK(dbw.Read(key, res));
|
||||
BOOST_CHECK_EQUAL(res.ToString(), in.ToString());
|
||||
BOOST_CHECK(dbw.Read(key2, res));
|
||||
BOOST_CHECK_EQUAL(res.ToString(), in2.ToString());
|
||||
|
||||
// key3 should've never been written
|
||||
BOOST_CHECK(dbw.Read(key3, res) == false);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(dbwrapper_iterator)
|
||||
{
|
||||
// Perform tests both obfuscated and non-obfuscated.
|
||||
for (const bool obfuscate : {false, true}) {
|
||||
fs::path ph = m_args.GetDataDirBase() / (obfuscate ? "dbwrapper_iterator_obfuscate_true" : "dbwrapper_iterator_obfuscate_false");
|
||||
CDBWrapper dbw(ph, (1 << 20), true, false, obfuscate);
|
||||
|
||||
// The two keys are intentionally chosen for ordering
|
||||
uint8_t key{'j'};
|
||||
uint256 in = InsecureRand256();
|
||||
BOOST_CHECK(dbw.Write(key, in));
|
||||
uint8_t key2{'k'};
|
||||
uint256 in2 = InsecureRand256();
|
||||
BOOST_CHECK(dbw.Write(key2, in2));
|
||||
|
||||
std::unique_ptr<CDBIterator> it(const_cast<CDBWrapper&>(dbw).NewIterator());
|
||||
|
||||
// Be sure to seek past the obfuscation key (if it exists)
|
||||
it->Seek(key);
|
||||
|
||||
uint8_t key_res;
|
||||
uint256 val_res;
|
||||
|
||||
BOOST_REQUIRE(it->GetKey(key_res));
|
||||
BOOST_REQUIRE(it->GetValue(val_res));
|
||||
BOOST_CHECK_EQUAL(key_res, key);
|
||||
BOOST_CHECK_EQUAL(val_res.ToString(), in.ToString());
|
||||
|
||||
it->Next();
|
||||
|
||||
BOOST_REQUIRE(it->GetKey(key_res));
|
||||
BOOST_REQUIRE(it->GetValue(val_res));
|
||||
BOOST_CHECK_EQUAL(key_res, key2);
|
||||
BOOST_CHECK_EQUAL(val_res.ToString(), in2.ToString());
|
||||
|
||||
it->Next();
|
||||
BOOST_CHECK_EQUAL(it->Valid(), false);
|
||||
}
|
||||
}
|
||||
|
||||
// Test that we do not obfuscation if there is existing data.
|
||||
BOOST_AUTO_TEST_CASE(existing_data_no_obfuscate)
|
||||
{
|
||||
// We're going to share this fs::path between two wrappers
|
||||
fs::path ph = m_args.GetDataDirBase() / "existing_data_no_obfuscate";
|
||||
create_directories(ph);
|
||||
|
||||
// Set up a non-obfuscated wrapper to write some initial data.
|
||||
std::unique_ptr<CDBWrapper> dbw = std::make_unique<CDBWrapper>(ph, (1 << 10), false, false, false);
|
||||
uint8_t key{'k'};
|
||||
uint256 in = InsecureRand256();
|
||||
uint256 res;
|
||||
|
||||
BOOST_CHECK(dbw->Write(key, in));
|
||||
BOOST_CHECK(dbw->Read(key, res));
|
||||
BOOST_CHECK_EQUAL(res.ToString(), in.ToString());
|
||||
|
||||
// Call the destructor to free leveldb LOCK
|
||||
dbw.reset();
|
||||
|
||||
// Now, set up another wrapper that wants to obfuscate the same directory
|
||||
CDBWrapper odbw(ph, (1 << 10), false, false, true);
|
||||
|
||||
// Check that the key/val we wrote with unobfuscated wrapper exists and
|
||||
// is readable.
|
||||
uint256 res2;
|
||||
BOOST_CHECK(odbw.Read(key, res2));
|
||||
BOOST_CHECK_EQUAL(res2.ToString(), in.ToString());
|
||||
|
||||
BOOST_CHECK(!odbw.IsEmpty()); // There should be existing data
|
||||
BOOST_CHECK(is_null_key(dbwrapper_private::GetObfuscateKey(odbw))); // The key should be an empty string
|
||||
|
||||
uint256 in2 = InsecureRand256();
|
||||
uint256 res3;
|
||||
|
||||
// Check that we can write successfully
|
||||
BOOST_CHECK(odbw.Write(key, in2));
|
||||
BOOST_CHECK(odbw.Read(key, res3));
|
||||
BOOST_CHECK_EQUAL(res3.ToString(), in2.ToString());
|
||||
}
|
||||
|
||||
// Ensure that we start obfuscating during a reindex.
|
||||
BOOST_AUTO_TEST_CASE(existing_data_reindex)
|
||||
{
|
||||
// We're going to share this fs::path between two wrappers
|
||||
fs::path ph = m_args.GetDataDirBase() / "existing_data_reindex";
|
||||
create_directories(ph);
|
||||
|
||||
// Set up a non-obfuscated wrapper to write some initial data.
|
||||
std::unique_ptr<CDBWrapper> dbw = std::make_unique<CDBWrapper>(ph, (1 << 10), false, false, false);
|
||||
uint8_t key{'k'};
|
||||
uint256 in = InsecureRand256();
|
||||
uint256 res;
|
||||
|
||||
BOOST_CHECK(dbw->Write(key, in));
|
||||
BOOST_CHECK(dbw->Read(key, res));
|
||||
BOOST_CHECK_EQUAL(res.ToString(), in.ToString());
|
||||
|
||||
// Call the destructor to free leveldb LOCK
|
||||
dbw.reset();
|
||||
|
||||
// Simulate a -reindex by wiping the existing data store
|
||||
CDBWrapper odbw(ph, (1 << 10), false, true, true);
|
||||
|
||||
// Check that the key/val we wrote with unobfuscated wrapper doesn't exist
|
||||
uint256 res2;
|
||||
BOOST_CHECK(!odbw.Read(key, res2));
|
||||
BOOST_CHECK(!is_null_key(dbwrapper_private::GetObfuscateKey(odbw)));
|
||||
|
||||
uint256 in2 = InsecureRand256();
|
||||
uint256 res3;
|
||||
|
||||
// Check that we can write successfully
|
||||
BOOST_CHECK(odbw.Write(key, in2));
|
||||
BOOST_CHECK(odbw.Read(key, res3));
|
||||
BOOST_CHECK_EQUAL(res3.ToString(), in2.ToString());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(iterator_ordering)
|
||||
{
|
||||
fs::path ph = m_args.GetDataDirBase() / "iterator_ordering";
|
||||
CDBWrapper dbw(ph, (1 << 20), true, false, false);
|
||||
for (int x=0x00; x<256; ++x) {
|
||||
uint8_t key = x;
|
||||
uint32_t value = x*x;
|
||||
if (!(x & 1)) BOOST_CHECK(dbw.Write(key, value));
|
||||
}
|
||||
|
||||
// Check that creating an iterator creates a snapshot
|
||||
std::unique_ptr<CDBIterator> it(const_cast<CDBWrapper&>(dbw).NewIterator());
|
||||
|
||||
for (unsigned int x=0x00; x<256; ++x) {
|
||||
uint8_t key = x;
|
||||
uint32_t value = x*x;
|
||||
if (x & 1) BOOST_CHECK(dbw.Write(key, value));
|
||||
}
|
||||
|
||||
for (const int seek_start : {0x00, 0x80}) {
|
||||
it->Seek((uint8_t)seek_start);
|
||||
for (unsigned int x=seek_start; x<255; ++x) {
|
||||
uint8_t key;
|
||||
uint32_t value;
|
||||
BOOST_CHECK(it->Valid());
|
||||
if (!it->Valid()) // Avoid spurious errors about invalid iterator's key and value in case of failure
|
||||
break;
|
||||
BOOST_CHECK(it->GetKey(key));
|
||||
if (x & 1) {
|
||||
BOOST_CHECK_EQUAL(key, x + 1);
|
||||
continue;
|
||||
}
|
||||
BOOST_CHECK(it->GetValue(value));
|
||||
BOOST_CHECK_EQUAL(key, x);
|
||||
BOOST_CHECK_EQUAL(value, x*x);
|
||||
it->Next();
|
||||
}
|
||||
BOOST_CHECK(!it->Valid());
|
||||
}
|
||||
}
|
||||
|
||||
struct StringContentsSerializer {
|
||||
// Used to make two serialized objects the same while letting them have different lengths
|
||||
// This is a terrible idea
|
||||
std::string str;
|
||||
StringContentsSerializer() {}
|
||||
explicit StringContentsSerializer(const std::string& inp) : str(inp) {}
|
||||
|
||||
StringContentsSerializer& operator+=(const std::string& s) {
|
||||
str += s;
|
||||
return *this;
|
||||
}
|
||||
StringContentsSerializer& operator+=(const StringContentsSerializer& s) { return *this += s.str; }
|
||||
|
||||
template<typename Stream>
|
||||
void Serialize(Stream& s) const
|
||||
{
|
||||
for (size_t i = 0; i < str.size(); i++) {
|
||||
s << uint8_t(str[i]);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Stream>
|
||||
void Unserialize(Stream& s)
|
||||
{
|
||||
str.clear();
|
||||
uint8_t c{0};
|
||||
while (true) {
|
||||
try {
|
||||
s >> c;
|
||||
str.push_back(c);
|
||||
} catch (const std::ios_base::failure&) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
BOOST_AUTO_TEST_CASE(iterator_string_ordering)
|
||||
{
|
||||
char buf[10];
|
||||
|
||||
fs::path ph = m_args.GetDataDirBase() / "iterator_string_ordering";
|
||||
CDBWrapper dbw(ph, (1 << 20), true, false, false);
|
||||
for (int x=0x00; x<10; ++x) {
|
||||
for (int y = 0; y < 10; y++) {
|
||||
snprintf(buf, sizeof(buf), "%d", x);
|
||||
StringContentsSerializer key(buf);
|
||||
for (int z = 0; z < y; z++)
|
||||
key += key;
|
||||
uint32_t value = x*x;
|
||||
BOOST_CHECK(dbw.Write(key, value));
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<CDBIterator> it(const_cast<CDBWrapper&>(dbw).NewIterator());
|
||||
for (const int seek_start : {0, 5}) {
|
||||
snprintf(buf, sizeof(buf), "%d", seek_start);
|
||||
StringContentsSerializer seek_key(buf);
|
||||
it->Seek(seek_key);
|
||||
for (unsigned int x=seek_start; x<10; ++x) {
|
||||
for (int y = 0; y < 10; y++) {
|
||||
snprintf(buf, sizeof(buf), "%d", x);
|
||||
std::string exp_key(buf);
|
||||
for (int z = 0; z < y; z++)
|
||||
exp_key += exp_key;
|
||||
StringContentsSerializer key;
|
||||
uint32_t value;
|
||||
BOOST_CHECK(it->Valid());
|
||||
if (!it->Valid()) // Avoid spurious errors about invalid iterator's key and value in case of failure
|
||||
break;
|
||||
BOOST_CHECK(it->GetKey(key));
|
||||
BOOST_CHECK(it->GetValue(value));
|
||||
BOOST_CHECK_EQUAL(key.str, exp_key);
|
||||
BOOST_CHECK_EQUAL(value, x*x);
|
||||
it->Next();
|
||||
}
|
||||
}
|
||||
BOOST_CHECK(!it->Valid());
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(unicodepath)
|
||||
{
|
||||
// Attempt to create a database with a UTF8 character in the path.
|
||||
// On Windows this test will fail if the directory is created using
|
||||
// the ANSI CreateDirectoryA call and the code page isn't UTF8.
|
||||
// It will succeed if created with CreateDirectoryW.
|
||||
fs::path ph = m_args.GetDataDirBase() / "test_runner_₿_🏃_20191128_104644";
|
||||
CDBWrapper dbw(ph, (1 << 20));
|
||||
|
||||
fs::path lockPath = ph / "LOCK";
|
||||
BOOST_CHECK(fs::exists(lockPath));
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
433
src/test/denialofservice_tests.cpp
Normal file
433
src/test/denialofservice_tests.cpp
Normal file
|
|
@ -0,0 +1,433 @@
|
|||
// Copyright (c) 2009-2021 The Bitcoin Core developers
|
||||
// Copyright (c) 2014-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
// Unit tests for denial-of-service detection/prevention code
|
||||
|
||||
#include <arith_uint256.h>
|
||||
#include <banman.h>
|
||||
#include <chainparams.h>
|
||||
#include <net.h>
|
||||
#include <net_processing.h>
|
||||
#include <pubkey.h>
|
||||
#include <script/sign.h>
|
||||
#include <script/signingprovider.h>
|
||||
#include <script/standard.h>
|
||||
#include <serialize.h>
|
||||
#include <test/util/net.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <txorphanage.h>
|
||||
#include <util/string.h>
|
||||
#include <util/system.h>
|
||||
#include <util/time.h>
|
||||
#include <validation.h>
|
||||
|
||||
#include <array>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
static CService ip(uint32_t i)
|
||||
{
|
||||
struct in_addr s;
|
||||
s.s_addr = i;
|
||||
return CService(CNetAddr(s), Params().GetDefaultPort());
|
||||
}
|
||||
|
||||
static NodeId id = 0;
|
||||
|
||||
void UpdateLastBlockAnnounceTime(NodeId node, int64_t time_in_seconds);
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(denialofservice_tests, TestingSetup)
|
||||
|
||||
// Test eviction of an outbound peer whose chain never advances
|
||||
// Mock a node connection, and use mocktime to simulate a peer
|
||||
// which never sends any headers messages. PeerLogic should
|
||||
// decide to evict that outbound peer, after the appropriate timeouts.
|
||||
// Note that we protect 4 outbound nodes from being subject to
|
||||
// this logic; this test takes advantage of that protection only
|
||||
// being applied to nodes which send headers with sufficient
|
||||
// work.
|
||||
BOOST_AUTO_TEST_CASE(outbound_slow_chain_eviction)
|
||||
{
|
||||
const CChainParams& chainparams = Params();
|
||||
auto connman = std::make_unique<CConnman>(0x1337, 0x1337, *m_node.addrman);
|
||||
auto peerLogic = PeerManager::make(chainparams, *connman, *m_node.addrman, nullptr,
|
||||
*m_node.scheduler, *m_node.chainman, *m_node.mempool, *m_node.stempool, false);
|
||||
|
||||
// Mock an outbound peer
|
||||
CAddress addr1(ip(0xa0b0c001), NODE_NONE);
|
||||
CNode dummyNode1(id++, ServiceFlags(NODE_NETWORK | NODE_WITNESS), INVALID_SOCKET, addr1, /* nKeyedNetGroupIn */ 0, /* nLocalHostNonceIn */ 0, CAddress(), /* pszDest */ "", ConnectionType::OUTBOUND_FULL_RELAY, /* inbound_onion */ false);
|
||||
dummyNode1.SetCommonVersion(PROTOCOL_VERSION);
|
||||
|
||||
peerLogic->InitializeNode(&dummyNode1);
|
||||
dummyNode1.fSuccessfullyConnected = true;
|
||||
|
||||
// This test requires that we have a chain with non-zero work.
|
||||
{
|
||||
LOCK(cs_main);
|
||||
BOOST_CHECK(m_node.chainman->ActiveChain().Tip() != nullptr);
|
||||
BOOST_CHECK(m_node.chainman->ActiveChain().Tip()->nChainWork > 0);
|
||||
}
|
||||
|
||||
// Test starts here
|
||||
{
|
||||
LOCK(dummyNode1.cs_sendProcessing);
|
||||
BOOST_CHECK(peerLogic->SendMessages(&dummyNode1)); // should result in getheaders
|
||||
}
|
||||
{
|
||||
LOCK(dummyNode1.cs_vSend);
|
||||
BOOST_CHECK(dummyNode1.vSendMsg.size() > 0);
|
||||
dummyNode1.vSendMsg.clear();
|
||||
}
|
||||
|
||||
int64_t nStartTime = GetTime();
|
||||
// Wait 21 minutes
|
||||
SetMockTime(nStartTime+21*60); // Overrides future calls to GetTime()
|
||||
{
|
||||
LOCK(dummyNode1.cs_sendProcessing);
|
||||
BOOST_CHECK(peerLogic->SendMessages(&dummyNode1)); // should result in getheaders
|
||||
}
|
||||
{
|
||||
LOCK(dummyNode1.cs_vSend);
|
||||
BOOST_CHECK(dummyNode1.vSendMsg.size() > 0);
|
||||
}
|
||||
// Wait 3 more minutes
|
||||
SetMockTime(nStartTime+24*60); // Overrides future calls to GetTime()
|
||||
{
|
||||
LOCK(dummyNode1.cs_sendProcessing);
|
||||
BOOST_CHECK(peerLogic->SendMessages(&dummyNode1)); // should result in disconnect
|
||||
}
|
||||
BOOST_CHECK(dummyNode1.fDisconnect == true);
|
||||
|
||||
peerLogic->FinalizeNode(dummyNode1);
|
||||
}
|
||||
|
||||
static void AddRandomOutboundPeer(std::vector<CNode*>& vNodes, PeerManager& peerLogic, ConnmanTestMsg& connman)
|
||||
{
|
||||
CAddress addr(ip(g_insecure_rand_ctx.randbits(32)), NODE_NONE);
|
||||
vNodes.emplace_back(new CNode(id++, ServiceFlags(NODE_NETWORK | NODE_WITNESS), INVALID_SOCKET, addr, /* nKeyedNetGroupIn */ 0, /* nLocalHostNonceIn */ 0, CAddress(), /* pszDest */ "", ConnectionType::OUTBOUND_FULL_RELAY, /* inbound_onion */ false));
|
||||
CNode &node = *vNodes.back();
|
||||
node.SetCommonVersion(PROTOCOL_VERSION);
|
||||
|
||||
peerLogic.InitializeNode(&node);
|
||||
node.fSuccessfullyConnected = true;
|
||||
|
||||
connman.AddTestNode(node);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(stale_tip_peer_management)
|
||||
{
|
||||
const CChainParams& chainparams = Params();
|
||||
auto connman = std::make_unique<ConnmanTestMsg>(0x1337, 0x1337, *m_node.addrman);
|
||||
auto peerLogic = PeerManager::make(chainparams, *connman, *m_node.addrman, nullptr,
|
||||
*m_node.scheduler, *m_node.chainman, *m_node.mempool, *m_node.stempool, false);
|
||||
|
||||
constexpr int max_outbound_full_relay = MAX_OUTBOUND_FULL_RELAY_CONNECTIONS;
|
||||
CConnman::Options options;
|
||||
options.nMaxConnections = DEFAULT_MAX_PEER_CONNECTIONS;
|
||||
options.m_max_outbound_full_relay = max_outbound_full_relay;
|
||||
options.nMaxFeeler = MAX_FEELER_CONNECTIONS;
|
||||
|
||||
connman->Init(options);
|
||||
std::vector<CNode *> vNodes;
|
||||
|
||||
// Mock some outbound peers
|
||||
for (int i = 0; i < max_outbound_full_relay; ++i) {
|
||||
AddRandomOutboundPeer(vNodes, *peerLogic, *connman);
|
||||
}
|
||||
|
||||
peerLogic->CheckForStaleTipAndEvictPeers();
|
||||
|
||||
// No nodes should be marked for disconnection while we have no extra peers
|
||||
for (const CNode *node : vNodes) {
|
||||
BOOST_CHECK(node->fDisconnect == false);
|
||||
}
|
||||
|
||||
int64_t STALE_CHECK_INTERVAL = 60; // Must be equal to STALE_CHECK_INTERVAL in net_processing.cpp
|
||||
auto WAIT = std::max(3 * chainparams.GetConsensus().nPowTargetSpacing, STALE_CHECK_INTERVAL) + 1;
|
||||
SetMockTime(GetTime() + WAIT + 1);
|
||||
|
||||
// Now tip should definitely be stale, and we should look for an extra
|
||||
// outbound peer
|
||||
peerLogic->CheckForStaleTipAndEvictPeers();
|
||||
BOOST_CHECK(connman->GetTryNewOutboundPeer());
|
||||
|
||||
// Still no peers should be marked for disconnection
|
||||
for (const CNode *node : vNodes) {
|
||||
BOOST_CHECK(node->fDisconnect == false);
|
||||
}
|
||||
|
||||
// If we add one more peer, something should get marked for eviction
|
||||
// on the next check (since we're mocking the time to be in the future, the
|
||||
// required time connected check should be satisfied).
|
||||
AddRandomOutboundPeer(vNodes, *peerLogic, *connman);
|
||||
|
||||
peerLogic->CheckForStaleTipAndEvictPeers();
|
||||
for (int i = 0; i < max_outbound_full_relay; ++i) {
|
||||
BOOST_CHECK(vNodes[i]->fDisconnect == false);
|
||||
}
|
||||
// Last added node should get marked for eviction
|
||||
BOOST_CHECK(vNodes.back()->fDisconnect == true);
|
||||
|
||||
vNodes.back()->fDisconnect = false;
|
||||
|
||||
// Update the last announced block time for the last
|
||||
// peer, and check that the next newest node gets evicted.
|
||||
UpdateLastBlockAnnounceTime(vNodes.back()->GetId(), GetTime());
|
||||
|
||||
peerLogic->CheckForStaleTipAndEvictPeers();
|
||||
for (int i = 0; i < max_outbound_full_relay - 1; ++i) {
|
||||
BOOST_CHECK(vNodes[i]->fDisconnect == false);
|
||||
}
|
||||
BOOST_CHECK(vNodes[max_outbound_full_relay-1]->fDisconnect == true);
|
||||
BOOST_CHECK(vNodes.back()->fDisconnect == false);
|
||||
|
||||
for (const CNode *node : vNodes) {
|
||||
peerLogic->FinalizeNode(*node);
|
||||
}
|
||||
|
||||
connman->ClearTestNodes();
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(peer_discouragement)
|
||||
{
|
||||
const CChainParams& chainparams = Params();
|
||||
auto banman = std::make_unique<BanMan>(m_args.GetDataDirBase() / "banlist", nullptr, DEFAULT_MISBEHAVING_BANTIME);
|
||||
auto connman = std::make_unique<ConnmanTestMsg>(0x1337, 0x1337, *m_node.addrman);
|
||||
auto peerLogic = PeerManager::make(chainparams, *connman, *m_node.addrman, banman.get(),
|
||||
*m_node.scheduler, *m_node.chainman, *m_node.mempool, *m_node.stempool, false);
|
||||
|
||||
CNetAddr tor_netaddr;
|
||||
BOOST_REQUIRE(
|
||||
tor_netaddr.SetSpecial("pg6mmjiyjmcrsslvykfwnntlaru7p5svn6y2ymmju6nubxndf4pscryd.onion"));
|
||||
const CService tor_service{tor_netaddr, Params().GetDefaultPort()};
|
||||
|
||||
const std::array<CAddress, 3> addr{CAddress{ip(0xa0b0c001), NODE_NONE},
|
||||
CAddress{ip(0xa0b0c002), NODE_NONE},
|
||||
CAddress{tor_service, NODE_NONE}};
|
||||
|
||||
const CNetAddr other_addr{ip(0xa0b0ff01)}; // Not any of addr[].
|
||||
|
||||
std::array<CNode*, 3> nodes;
|
||||
|
||||
banman->ClearBanned();
|
||||
nodes[0] = new CNode{id++, NODE_NETWORK, INVALID_SOCKET, addr[0], /* nKeyedNetGroupIn */ 0,
|
||||
/* nLocalHostNonceIn */ 0, CAddress(), /* pszDest */ "",
|
||||
ConnectionType::INBOUND, /* inbound_onion */ false};
|
||||
nodes[0]->SetCommonVersion(PROTOCOL_VERSION);
|
||||
peerLogic->InitializeNode(nodes[0]);
|
||||
nodes[0]->fSuccessfullyConnected = true;
|
||||
connman->AddTestNode(*nodes[0]);
|
||||
peerLogic->Misbehaving(nodes[0]->GetId(), DISCOURAGEMENT_THRESHOLD, /* message */ ""); // Should be discouraged
|
||||
{
|
||||
LOCK(nodes[0]->cs_sendProcessing);
|
||||
BOOST_CHECK(peerLogic->SendMessages(nodes[0]));
|
||||
}
|
||||
BOOST_CHECK(banman->IsDiscouraged(addr[0]));
|
||||
BOOST_CHECK(nodes[0]->fDisconnect);
|
||||
BOOST_CHECK(!banman->IsDiscouraged(other_addr)); // Different address, not discouraged
|
||||
|
||||
nodes[1] = new CNode{id++, NODE_NETWORK, INVALID_SOCKET, addr[1], /* nKeyedNetGroupIn */ 1,
|
||||
/* nLocalHostNonceIn */ 1, CAddress(), /* pszDest */ "",
|
||||
ConnectionType::INBOUND, /* inbound_onion */ false};
|
||||
nodes[1]->SetCommonVersion(PROTOCOL_VERSION);
|
||||
peerLogic->InitializeNode(nodes[1]);
|
||||
nodes[1]->fSuccessfullyConnected = true;
|
||||
connman->AddTestNode(*nodes[1]);
|
||||
peerLogic->Misbehaving(nodes[1]->GetId(), DISCOURAGEMENT_THRESHOLD - 1, /* message */ "");
|
||||
{
|
||||
LOCK(nodes[1]->cs_sendProcessing);
|
||||
BOOST_CHECK(peerLogic->SendMessages(nodes[1]));
|
||||
}
|
||||
// [0] is still discouraged/disconnected.
|
||||
BOOST_CHECK(banman->IsDiscouraged(addr[0]));
|
||||
BOOST_CHECK(nodes[0]->fDisconnect);
|
||||
// [1] is not discouraged/disconnected yet.
|
||||
BOOST_CHECK(!banman->IsDiscouraged(addr[1]));
|
||||
BOOST_CHECK(!nodes[1]->fDisconnect);
|
||||
peerLogic->Misbehaving(nodes[1]->GetId(), 1, /* message */ ""); // [1] reaches discouragement threshold
|
||||
{
|
||||
LOCK(nodes[1]->cs_sendProcessing);
|
||||
BOOST_CHECK(peerLogic->SendMessages(nodes[1]));
|
||||
}
|
||||
// Expect both [0] and [1] to be discouraged/disconnected now.
|
||||
BOOST_CHECK(banman->IsDiscouraged(addr[0]));
|
||||
BOOST_CHECK(nodes[0]->fDisconnect);
|
||||
BOOST_CHECK(banman->IsDiscouraged(addr[1]));
|
||||
BOOST_CHECK(nodes[1]->fDisconnect);
|
||||
|
||||
// Make sure non-IP peers are discouraged and disconnected properly.
|
||||
|
||||
nodes[2] = new CNode{id++, NODE_NETWORK, INVALID_SOCKET, addr[2], /* nKeyedNetGroupIn */ 1,
|
||||
/* nLocalHostNonceIn */ 1, CAddress(), /* pszDest */ "",
|
||||
ConnectionType::OUTBOUND_FULL_RELAY, /* inbound_onion */ false};
|
||||
nodes[2]->SetCommonVersion(PROTOCOL_VERSION);
|
||||
peerLogic->InitializeNode(nodes[2]);
|
||||
nodes[2]->fSuccessfullyConnected = true;
|
||||
connman->AddTestNode(*nodes[2]);
|
||||
peerLogic->Misbehaving(nodes[2]->GetId(), DISCOURAGEMENT_THRESHOLD, /* message */ "");
|
||||
{
|
||||
LOCK(nodes[2]->cs_sendProcessing);
|
||||
BOOST_CHECK(peerLogic->SendMessages(nodes[2]));
|
||||
}
|
||||
BOOST_CHECK(banman->IsDiscouraged(addr[0]));
|
||||
BOOST_CHECK(banman->IsDiscouraged(addr[1]));
|
||||
BOOST_CHECK(banman->IsDiscouraged(addr[2]));
|
||||
BOOST_CHECK(nodes[0]->fDisconnect);
|
||||
BOOST_CHECK(nodes[1]->fDisconnect);
|
||||
BOOST_CHECK(nodes[2]->fDisconnect);
|
||||
|
||||
for (CNode* node : nodes) {
|
||||
peerLogic->FinalizeNode(*node);
|
||||
}
|
||||
connman->ClearTestNodes();
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(DoS_bantime)
|
||||
{
|
||||
const CChainParams& chainparams = Params();
|
||||
auto banman = std::make_unique<BanMan>(m_args.GetDataDirBase() / "banlist", nullptr, DEFAULT_MISBEHAVING_BANTIME);
|
||||
auto connman = std::make_unique<CConnman>(0x1337, 0x1337, *m_node.addrman);
|
||||
auto peerLogic = PeerManager::make(chainparams, *connman, *m_node.addrman, banman.get(),
|
||||
*m_node.scheduler, *m_node.chainman, *m_node.mempool, *m_node.stempool, false);
|
||||
|
||||
banman->ClearBanned();
|
||||
int64_t nStartTime = GetTime();
|
||||
SetMockTime(nStartTime); // Overrides future calls to GetTime()
|
||||
|
||||
CAddress addr(ip(0xa0b0c001), NODE_NONE);
|
||||
CNode dummyNode(id++, NODE_NETWORK, INVALID_SOCKET, addr, /* nKeyedNetGroupIn */ 4, /* nLocalHostNonceIn */ 4, CAddress(), /* pszDest */ "", ConnectionType::INBOUND, /* inbound_onion */ false);
|
||||
dummyNode.SetCommonVersion(PROTOCOL_VERSION);
|
||||
peerLogic->InitializeNode(&dummyNode);
|
||||
dummyNode.fSuccessfullyConnected = true;
|
||||
|
||||
peerLogic->Misbehaving(dummyNode.GetId(), DISCOURAGEMENT_THRESHOLD, /* message */ "");
|
||||
{
|
||||
LOCK(dummyNode.cs_sendProcessing);
|
||||
BOOST_CHECK(peerLogic->SendMessages(&dummyNode));
|
||||
}
|
||||
BOOST_CHECK(banman->IsDiscouraged(addr));
|
||||
|
||||
peerLogic->FinalizeNode(dummyNode);
|
||||
}
|
||||
|
||||
class TxOrphanageTest : public TxOrphanage
|
||||
{
|
||||
public:
|
||||
inline size_t CountOrphans() const EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans)
|
||||
{
|
||||
return m_orphans.size();
|
||||
}
|
||||
|
||||
CTransactionRef RandomOrphan() EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans)
|
||||
{
|
||||
std::map<uint256, OrphanTx>::iterator it;
|
||||
it = m_orphans.lower_bound(InsecureRand256());
|
||||
if (it == m_orphans.end())
|
||||
it = m_orphans.begin();
|
||||
return it->second.tx;
|
||||
}
|
||||
};
|
||||
|
||||
static void MakeNewKeyWithFastRandomContext(CKey& key)
|
||||
{
|
||||
std::vector<unsigned char> keydata;
|
||||
keydata = g_insecure_rand_ctx.randbytes(32);
|
||||
key.Set(keydata.data(), keydata.data() + keydata.size(), /*fCompressedIn*/ true);
|
||||
assert(key.IsValid());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(DoS_mapOrphans)
|
||||
{
|
||||
// This test had non-deterministic coverage due to
|
||||
// randomly selected seeds.
|
||||
// This seed is chosen so that all branches of the function
|
||||
// ecdsa_signature_parse_der_lax are executed during this test.
|
||||
// Specifically branches that run only when an ECDSA
|
||||
// signature's R and S values have leading zeros.
|
||||
g_insecure_rand_ctx = FastRandomContext(ArithToUint256(arith_uint256(33)));
|
||||
|
||||
TxOrphanageTest orphanage;
|
||||
CKey key;
|
||||
MakeNewKeyWithFastRandomContext(key);
|
||||
FillableSigningProvider keystore;
|
||||
BOOST_CHECK(keystore.AddKey(key));
|
||||
|
||||
LOCK(g_cs_orphans);
|
||||
|
||||
// 50 orphan transactions:
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
CMutableTransaction tx;
|
||||
tx.vin.resize(1);
|
||||
tx.vin[0].prevout.n = 0;
|
||||
tx.vin[0].prevout.hash = InsecureRand256();
|
||||
tx.vin[0].scriptSig << OP_1;
|
||||
tx.vout.resize(1);
|
||||
tx.vout[0].nValue = 1*CENT;
|
||||
tx.vout[0].scriptPubKey = GetScriptForDestination(PKHash(key.GetPubKey()));
|
||||
|
||||
orphanage.AddTx(MakeTransactionRef(tx), i);
|
||||
}
|
||||
|
||||
// ... and 50 that depend on other orphans:
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
CTransactionRef txPrev = orphanage.RandomOrphan();
|
||||
|
||||
CMutableTransaction tx;
|
||||
tx.vin.resize(1);
|
||||
tx.vin[0].prevout.n = 0;
|
||||
tx.vin[0].prevout.hash = txPrev->GetHash();
|
||||
tx.vout.resize(1);
|
||||
tx.vout[0].nValue = 1*CENT;
|
||||
tx.vout[0].scriptPubKey = GetScriptForDestination(PKHash(key.GetPubKey()));
|
||||
BOOST_CHECK(SignSignature(keystore, *txPrev, tx, 0, SIGHASH_ALL));
|
||||
|
||||
orphanage.AddTx(MakeTransactionRef(tx), i);
|
||||
}
|
||||
|
||||
// This really-big orphan should be ignored:
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
CTransactionRef txPrev = orphanage.RandomOrphan();
|
||||
|
||||
CMutableTransaction tx;
|
||||
tx.vout.resize(1);
|
||||
tx.vout[0].nValue = 1*CENT;
|
||||
tx.vout[0].scriptPubKey = GetScriptForDestination(PKHash(key.GetPubKey()));
|
||||
tx.vin.resize(2777);
|
||||
for (unsigned int j = 0; j < tx.vin.size(); j++)
|
||||
{
|
||||
tx.vin[j].prevout.n = j;
|
||||
tx.vin[j].prevout.hash = txPrev->GetHash();
|
||||
}
|
||||
BOOST_CHECK(SignSignature(keystore, *txPrev, tx, 0, SIGHASH_ALL));
|
||||
// Re-use same signature for other inputs
|
||||
// (they don't have to be valid for this test)
|
||||
for (unsigned int j = 1; j < tx.vin.size(); j++)
|
||||
tx.vin[j].scriptSig = tx.vin[0].scriptSig;
|
||||
|
||||
BOOST_CHECK(!orphanage.AddTx(MakeTransactionRef(tx), i));
|
||||
}
|
||||
|
||||
// Test EraseOrphansFor:
|
||||
for (NodeId i = 0; i < 3; i++)
|
||||
{
|
||||
size_t sizeBefore = orphanage.CountOrphans();
|
||||
orphanage.EraseForPeer(i);
|
||||
BOOST_CHECK(orphanage.CountOrphans() < sizeBefore);
|
||||
}
|
||||
|
||||
// Test LimitOrphanTxSize() function:
|
||||
orphanage.LimitOrphans(40);
|
||||
BOOST_CHECK(orphanage.CountOrphans() <= 40);
|
||||
orphanage.LimitOrphans(10);
|
||||
BOOST_CHECK(orphanage.CountOrphans() <= 10);
|
||||
orphanage.LimitOrphans(0);
|
||||
BOOST_CHECK(orphanage.CountOrphans() == 0);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
409
src/test/descriptor_tests.cpp
Normal file
409
src/test/descriptor_tests.cpp
Normal file
File diff suppressed because one or more lines are too long
45
src/test/digibyte-util-test.py
Executable file
45
src/test/digibyte-util-test.py
Executable file
|
|
@ -0,0 +1,45 @@
|
|||
#!/usr/bin/env python
|
||||
# Copyright 2014 BitPay Inc.
|
||||
# Copyright 2016 The DigiByte Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
from __future__ import division,print_function,unicode_literals
|
||||
import os
|
||||
import bctest
|
||||
import buildenv
|
||||
import argparse
|
||||
import logging
|
||||
|
||||
help_text="""Test framework for digibyte utils.
|
||||
|
||||
Runs automatically during `make check`.
|
||||
|
||||
Can also be run manually from the src directory by specifying the source directory:
|
||||
|
||||
test/digibyte-util-test.py --srcdir='srcdir' [--verbose]
|
||||
"""
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Try to get the source directory from the environment variables. This will
|
||||
# be set for `make check` automated runs. If environment variable is not set,
|
||||
# then get the source directory from command line args.
|
||||
try:
|
||||
srcdir = os.environ["srcdir"]
|
||||
verbose = False
|
||||
except:
|
||||
parser = argparse.ArgumentParser(description=help_text)
|
||||
parser.add_argument('-s', '--srcdir')
|
||||
parser.add_argument('-v', '--verbose', action='store_true')
|
||||
args = parser.parse_args()
|
||||
srcdir = args.srcdir
|
||||
verbose = args.verbose
|
||||
|
||||
if verbose:
|
||||
level = logging.DEBUG
|
||||
else:
|
||||
level = logging.ERROR
|
||||
formatter = '%(asctime)s - %(levelname)s - %(message)s'
|
||||
# Add the format/level to the logger
|
||||
logging.basicConfig(format = formatter, level=level)
|
||||
|
||||
bctest.bctester(srcdir + "/test/data", "digibyte-util-test.json", buildenv)
|
||||
126
src/test/flatfile_tests.cpp
Normal file
126
src/test/flatfile_tests.cpp
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
// Copyright (c) 2019-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <clientversion.h>
|
||||
#include <flatfile.h>
|
||||
#include <streams.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <util/system.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(flatfile_tests, BasicTestingSetup)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(flatfile_filename)
|
||||
{
|
||||
const auto data_dir = m_args.GetDataDirBase();
|
||||
|
||||
FlatFilePos pos(456, 789);
|
||||
|
||||
FlatFileSeq seq1(data_dir, "a", 16 * 1024);
|
||||
BOOST_CHECK_EQUAL(seq1.FileName(pos), data_dir / "a00456.dat");
|
||||
|
||||
FlatFileSeq seq2(data_dir / "a", "b", 16 * 1024);
|
||||
BOOST_CHECK_EQUAL(seq2.FileName(pos), data_dir / "a" / "b00456.dat");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(flatfile_open)
|
||||
{
|
||||
const auto data_dir = m_args.GetDataDirBase();
|
||||
FlatFileSeq seq(data_dir, "a", 16 * 1024);
|
||||
|
||||
std::string line1("A purely peer-to-peer version of electronic cash would allow online "
|
||||
"payments to be sent directly from one party to another without going "
|
||||
"through a financial institution.");
|
||||
std::string line2("Digital signatures provide part of the solution, but the main benefits are "
|
||||
"lost if a trusted third party is still required to prevent double-spending.");
|
||||
|
||||
size_t pos1 = 0;
|
||||
size_t pos2 = pos1 + GetSerializeSize(line1, CLIENT_VERSION);
|
||||
|
||||
// Write first line to file.
|
||||
{
|
||||
CAutoFile file(seq.Open(FlatFilePos(0, pos1)), SER_DISK, CLIENT_VERSION);
|
||||
file << LIMITED_STRING(line1, 256);
|
||||
}
|
||||
|
||||
// Attempt to append to file opened in read-only mode.
|
||||
{
|
||||
CAutoFile file(seq.Open(FlatFilePos(0, pos2), true), SER_DISK, CLIENT_VERSION);
|
||||
BOOST_CHECK_THROW(file << LIMITED_STRING(line2, 256), std::ios_base::failure);
|
||||
}
|
||||
|
||||
// Append second line to file.
|
||||
{
|
||||
CAutoFile file(seq.Open(FlatFilePos(0, pos2)), SER_DISK, CLIENT_VERSION);
|
||||
file << LIMITED_STRING(line2, 256);
|
||||
}
|
||||
|
||||
// Read text from file in read-only mode.
|
||||
{
|
||||
std::string text;
|
||||
CAutoFile file(seq.Open(FlatFilePos(0, pos1), true), SER_DISK, CLIENT_VERSION);
|
||||
|
||||
file >> LIMITED_STRING(text, 256);
|
||||
BOOST_CHECK_EQUAL(text, line1);
|
||||
|
||||
file >> LIMITED_STRING(text, 256);
|
||||
BOOST_CHECK_EQUAL(text, line2);
|
||||
}
|
||||
|
||||
// Read text from file with position offset.
|
||||
{
|
||||
std::string text;
|
||||
CAutoFile file(seq.Open(FlatFilePos(0, pos2)), SER_DISK, CLIENT_VERSION);
|
||||
|
||||
file >> LIMITED_STRING(text, 256);
|
||||
BOOST_CHECK_EQUAL(text, line2);
|
||||
}
|
||||
|
||||
// Ensure another file in the sequence has no data.
|
||||
{
|
||||
std::string text;
|
||||
CAutoFile file(seq.Open(FlatFilePos(1, pos2)), SER_DISK, CLIENT_VERSION);
|
||||
BOOST_CHECK_THROW(file >> LIMITED_STRING(text, 256), std::ios_base::failure);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(flatfile_allocate)
|
||||
{
|
||||
const auto data_dir = m_args.GetDataDirBase();
|
||||
FlatFileSeq seq(data_dir, "a", 100);
|
||||
|
||||
bool out_of_space;
|
||||
|
||||
BOOST_CHECK_EQUAL(seq.Allocate(FlatFilePos(0, 0), 1, out_of_space), 100U);
|
||||
BOOST_CHECK_EQUAL(fs::file_size(seq.FileName(FlatFilePos(0, 0))), 100U);
|
||||
BOOST_CHECK(!out_of_space);
|
||||
|
||||
BOOST_CHECK_EQUAL(seq.Allocate(FlatFilePos(0, 99), 1, out_of_space), 0U);
|
||||
BOOST_CHECK_EQUAL(fs::file_size(seq.FileName(FlatFilePos(0, 99))), 100U);
|
||||
BOOST_CHECK(!out_of_space);
|
||||
|
||||
BOOST_CHECK_EQUAL(seq.Allocate(FlatFilePos(0, 99), 2, out_of_space), 101U);
|
||||
BOOST_CHECK_EQUAL(fs::file_size(seq.FileName(FlatFilePos(0, 99))), 200U);
|
||||
BOOST_CHECK(!out_of_space);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(flatfile_flush)
|
||||
{
|
||||
const auto data_dir = m_args.GetDataDirBase();
|
||||
FlatFileSeq seq(data_dir, "a", 100);
|
||||
|
||||
bool out_of_space;
|
||||
seq.Allocate(FlatFilePos(0, 0), 1, out_of_space);
|
||||
|
||||
// Flush without finalize should not truncate file.
|
||||
seq.Flush(FlatFilePos(0, 1));
|
||||
BOOST_CHECK_EQUAL(fs::file_size(seq.FileName(FlatFilePos(0, 1))), 100U);
|
||||
|
||||
// Flush with finalize should truncate file.
|
||||
seq.Flush(FlatFilePos(0, 1), true);
|
||||
BOOST_CHECK_EQUAL(fs::file_size(seq.FileName(FlatFilePos(0, 1))), 1U);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
90
src/test/fs_tests.cpp
Normal file
90
src/test/fs_tests.cpp
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
// Copyright (c) 2011-2019 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
//
|
||||
#include <fs.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <util/system.h>
|
||||
#include <util/getuniquepath.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(fs_tests, BasicTestingSetup)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(fsbridge_fstream)
|
||||
{
|
||||
fs::path tmpfolder = m_args.GetDataDirBase();
|
||||
// tmpfile1 should be the same as tmpfile2
|
||||
fs::path tmpfile1 = tmpfolder / "fs_tests_₿_🏃";
|
||||
fs::path tmpfile2 = tmpfolder / "fs_tests_₿_🏃";
|
||||
{
|
||||
fsbridge::ofstream file(tmpfile1);
|
||||
file << "digibyte";
|
||||
}
|
||||
{
|
||||
fsbridge::ifstream file(tmpfile2);
|
||||
std::string input_buffer;
|
||||
file >> input_buffer;
|
||||
BOOST_CHECK_EQUAL(input_buffer, "digibyte");
|
||||
}
|
||||
{
|
||||
fsbridge::ifstream file(tmpfile1, std::ios_base::in | std::ios_base::ate);
|
||||
std::string input_buffer;
|
||||
file >> input_buffer;
|
||||
BOOST_CHECK_EQUAL(input_buffer, "");
|
||||
}
|
||||
{
|
||||
fsbridge::ofstream file(tmpfile2, std::ios_base::out | std::ios_base::app);
|
||||
file << "tests";
|
||||
}
|
||||
{
|
||||
fsbridge::ifstream file(tmpfile1);
|
||||
std::string input_buffer;
|
||||
file >> input_buffer;
|
||||
BOOST_CHECK_EQUAL(input_buffer, "digibytetests");
|
||||
}
|
||||
{
|
||||
fsbridge::ofstream file(tmpfile2, std::ios_base::out | std::ios_base::trunc);
|
||||
file << "digibyte";
|
||||
}
|
||||
{
|
||||
fsbridge::ifstream file(tmpfile1);
|
||||
std::string input_buffer;
|
||||
file >> input_buffer;
|
||||
BOOST_CHECK_EQUAL(input_buffer, "digibyte");
|
||||
}
|
||||
{
|
||||
// Join an absolute path and a relative path.
|
||||
fs::path p = fsbridge::AbsPathJoin(tmpfolder, "fs_tests_₿_🏃");
|
||||
BOOST_CHECK(p.is_absolute());
|
||||
BOOST_CHECK_EQUAL(tmpfile1, p);
|
||||
}
|
||||
{
|
||||
// Join two absolute paths.
|
||||
fs::path p = fsbridge::AbsPathJoin(tmpfile1, tmpfile2);
|
||||
BOOST_CHECK(p.is_absolute());
|
||||
BOOST_CHECK_EQUAL(tmpfile2, p);
|
||||
}
|
||||
{
|
||||
// Ensure joining with empty paths does not add trailing path components.
|
||||
BOOST_CHECK_EQUAL(tmpfile1, fsbridge::AbsPathJoin(tmpfile1, ""));
|
||||
BOOST_CHECK_EQUAL(tmpfile1, fsbridge::AbsPathJoin(tmpfile1, {}));
|
||||
}
|
||||
{
|
||||
fs::path p1 = GetUniquePath(tmpfolder);
|
||||
fs::path p2 = GetUniquePath(tmpfolder);
|
||||
fs::path p3 = GetUniquePath(tmpfolder);
|
||||
|
||||
// Ensure that the parent path is always the same.
|
||||
BOOST_CHECK_EQUAL(tmpfolder, p1.parent_path());
|
||||
BOOST_CHECK_EQUAL(tmpfolder, p2.parent_path());
|
||||
BOOST_CHECK_EQUAL(tmpfolder, p3.parent_path());
|
||||
|
||||
// Ensure that generated paths are actually different.
|
||||
BOOST_CHECK(p1 != p2);
|
||||
BOOST_CHECK(p2 != p3);
|
||||
BOOST_CHECK(p1 != p3);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
397
src/test/fuzz/FuzzedDataProvider.h
Normal file
397
src/test/fuzz/FuzzedDataProvider.h
Normal file
|
|
@ -0,0 +1,397 @@
|
|||
//===- FuzzedDataProvider.h - Utility header for fuzz targets ---*- C++ -* ===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
// A single header library providing an utility class to break up an array of
|
||||
// bytes. Whenever run on the same input, provides the same output, as long as
|
||||
// its methods are called in the same order, with the same arguments.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_FUZZER_FUZZED_DATA_PROVIDER_H_
|
||||
#define LLVM_FUZZER_FUZZED_DATA_PROVIDER_H_
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <climits>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <initializer_list>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
// In addition to the comments below, the API is also briefly documented at
|
||||
// https://github.com/google/fuzzing/blob/master/docs/split-inputs.md#fuzzed-data-provider
|
||||
class FuzzedDataProvider {
|
||||
public:
|
||||
// |data| is an array of length |size| that the FuzzedDataProvider wraps to
|
||||
// provide more granular access. |data| must outlive the FuzzedDataProvider.
|
||||
FuzzedDataProvider(const uint8_t *data, size_t size)
|
||||
: data_ptr_(data), remaining_bytes_(size) {}
|
||||
~FuzzedDataProvider() = default;
|
||||
|
||||
// See the implementation below (after the class definition) for more verbose
|
||||
// comments for each of the methods.
|
||||
|
||||
// Methods returning std::vector of bytes. These are the most popular choice
|
||||
// when splitting fuzzing input into pieces, as every piece is put into a
|
||||
// separate buffer (i.e. ASan would catch any under-/overflow) and the memory
|
||||
// will be released automatically.
|
||||
template <typename T> std::vector<T> ConsumeBytes(size_t num_bytes);
|
||||
template <typename T>
|
||||
std::vector<T> ConsumeBytesWithTerminator(size_t num_bytes, T terminator = 0);
|
||||
template <typename T> std::vector<T> ConsumeRemainingBytes();
|
||||
|
||||
// Methods returning strings. Use only when you need a std::string or a null
|
||||
// terminated C-string. Otherwise, prefer the methods returning std::vector.
|
||||
std::string ConsumeBytesAsString(size_t num_bytes);
|
||||
std::string ConsumeRandomLengthString(size_t max_length);
|
||||
std::string ConsumeRandomLengthString();
|
||||
std::string ConsumeRemainingBytesAsString();
|
||||
|
||||
// Methods returning integer values.
|
||||
template <typename T> T ConsumeIntegral();
|
||||
template <typename T> T ConsumeIntegralInRange(T min, T max);
|
||||
|
||||
// Methods returning floating point values.
|
||||
template <typename T> T ConsumeFloatingPoint();
|
||||
template <typename T> T ConsumeFloatingPointInRange(T min, T max);
|
||||
|
||||
// 0 <= return value <= 1.
|
||||
template <typename T> T ConsumeProbability();
|
||||
|
||||
bool ConsumeBool();
|
||||
|
||||
// Returns a value chosen from the given enum.
|
||||
template <typename T> T ConsumeEnum();
|
||||
|
||||
// Returns a value from the given array.
|
||||
template <typename T, size_t size> T PickValueInArray(const T (&array)[size]);
|
||||
template <typename T, size_t size>
|
||||
T PickValueInArray(const std::array<T, size> &array);
|
||||
template <typename T> T PickValueInArray(std::initializer_list<const T> list);
|
||||
|
||||
// Writes data to the given destination and returns number of bytes written.
|
||||
size_t ConsumeData(void *destination, size_t num_bytes);
|
||||
|
||||
// Reports the remaining bytes available for fuzzed input.
|
||||
size_t remaining_bytes() { return remaining_bytes_; }
|
||||
|
||||
private:
|
||||
FuzzedDataProvider(const FuzzedDataProvider &) = delete;
|
||||
FuzzedDataProvider &operator=(const FuzzedDataProvider &) = delete;
|
||||
|
||||
void CopyAndAdvance(void *destination, size_t num_bytes);
|
||||
|
||||
void Advance(size_t num_bytes);
|
||||
|
||||
template <typename T>
|
||||
std::vector<T> ConsumeBytes(size_t size, size_t num_bytes);
|
||||
|
||||
template <typename TS, typename TU> TS ConvertUnsignedToSigned(TU value);
|
||||
|
||||
const uint8_t *data_ptr_;
|
||||
size_t remaining_bytes_;
|
||||
};
|
||||
|
||||
// Returns a std::vector containing |num_bytes| of input data. If fewer than
|
||||
// |num_bytes| of data remain, returns a shorter std::vector containing all
|
||||
// of the data that's left. Can be used with any byte sized type, such as
|
||||
// char, unsigned char, uint8_t, etc.
|
||||
template <typename T>
|
||||
std::vector<T> FuzzedDataProvider::ConsumeBytes(size_t num_bytes) {
|
||||
num_bytes = std::min(num_bytes, remaining_bytes_);
|
||||
return ConsumeBytes<T>(num_bytes, num_bytes);
|
||||
}
|
||||
|
||||
// Similar to |ConsumeBytes|, but also appends the terminator value at the end
|
||||
// of the resulting vector. Useful, when a mutable null-terminated C-string is
|
||||
// needed, for example. But that is a rare case. Better avoid it, if possible,
|
||||
// and prefer using |ConsumeBytes| or |ConsumeBytesAsString| methods.
|
||||
template <typename T>
|
||||
std::vector<T> FuzzedDataProvider::ConsumeBytesWithTerminator(size_t num_bytes,
|
||||
T terminator) {
|
||||
num_bytes = std::min(num_bytes, remaining_bytes_);
|
||||
std::vector<T> result = ConsumeBytes<T>(num_bytes + 1, num_bytes);
|
||||
result.back() = terminator;
|
||||
return result;
|
||||
}
|
||||
|
||||
// Returns a std::vector containing all remaining bytes of the input data.
|
||||
template <typename T>
|
||||
std::vector<T> FuzzedDataProvider::ConsumeRemainingBytes() {
|
||||
return ConsumeBytes<T>(remaining_bytes_);
|
||||
}
|
||||
|
||||
// Returns a std::string containing |num_bytes| of input data. Using this and
|
||||
// |.c_str()| on the resulting string is the best way to get an immutable
|
||||
// null-terminated C string. If fewer than |num_bytes| of data remain, returns
|
||||
// a shorter std::string containing all of the data that's left.
|
||||
inline std::string FuzzedDataProvider::ConsumeBytesAsString(size_t num_bytes) {
|
||||
static_assert(sizeof(std::string::value_type) == sizeof(uint8_t),
|
||||
"ConsumeBytesAsString cannot convert the data to a string.");
|
||||
|
||||
num_bytes = std::min(num_bytes, remaining_bytes_);
|
||||
std::string result(
|
||||
reinterpret_cast<const std::string::value_type *>(data_ptr_), num_bytes);
|
||||
Advance(num_bytes);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Returns a std::string of length from 0 to |max_length|. When it runs out of
|
||||
// input data, returns what remains of the input. Designed to be more stable
|
||||
// with respect to a fuzzer inserting characters than just picking a random
|
||||
// length and then consuming that many bytes with |ConsumeBytes|.
|
||||
inline std::string
|
||||
FuzzedDataProvider::ConsumeRandomLengthString(size_t max_length) {
|
||||
// Reads bytes from the start of |data_ptr_|. Maps "\\" to "\", and maps "\"
|
||||
// followed by anything else to the end of the string. As a result of this
|
||||
// logic, a fuzzer can insert characters into the string, and the string
|
||||
// will be lengthened to include those new characters, resulting in a more
|
||||
// stable fuzzer than picking the length of a string independently from
|
||||
// picking its contents.
|
||||
std::string result;
|
||||
|
||||
// Reserve the anticipated capaticity to prevent several reallocations.
|
||||
result.reserve(std::min(max_length, remaining_bytes_));
|
||||
for (size_t i = 0; i < max_length && remaining_bytes_ != 0; ++i) {
|
||||
char next = ConvertUnsignedToSigned<char>(data_ptr_[0]);
|
||||
Advance(1);
|
||||
if (next == '\\' && remaining_bytes_ != 0) {
|
||||
next = ConvertUnsignedToSigned<char>(data_ptr_[0]);
|
||||
Advance(1);
|
||||
if (next != '\\')
|
||||
break;
|
||||
}
|
||||
result += next;
|
||||
}
|
||||
|
||||
result.shrink_to_fit();
|
||||
return result;
|
||||
}
|
||||
|
||||
// Returns a std::string of length from 0 to |remaining_bytes_|.
|
||||
inline std::string FuzzedDataProvider::ConsumeRandomLengthString() {
|
||||
return ConsumeRandomLengthString(remaining_bytes_);
|
||||
}
|
||||
|
||||
// Returns a std::string containing all remaining bytes of the input data.
|
||||
// Prefer using |ConsumeRemainingBytes| unless you actually need a std::string
|
||||
// object.
|
||||
inline std::string FuzzedDataProvider::ConsumeRemainingBytesAsString() {
|
||||
return ConsumeBytesAsString(remaining_bytes_);
|
||||
}
|
||||
|
||||
// Returns a number in the range [Type's min, Type's max]. The value might
|
||||
// not be uniformly distributed in the given range. If there's no input data
|
||||
// left, always returns |min|.
|
||||
template <typename T> T FuzzedDataProvider::ConsumeIntegral() {
|
||||
return ConsumeIntegralInRange(std::numeric_limits<T>::min(),
|
||||
std::numeric_limits<T>::max());
|
||||
}
|
||||
|
||||
// Returns a number in the range [min, max] by consuming bytes from the
|
||||
// input data. The value might not be uniformly distributed in the given
|
||||
// range. If there's no input data left, always returns |min|. |min| must
|
||||
// be less than or equal to |max|.
|
||||
template <typename T>
|
||||
T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
|
||||
static_assert(std::is_integral<T>::value, "An integral type is required.");
|
||||
static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
|
||||
|
||||
if (min > max)
|
||||
abort();
|
||||
|
||||
// Use the biggest type possible to hold the range and the result.
|
||||
uint64_t range = static_cast<uint64_t>(max) - min;
|
||||
uint64_t result = 0;
|
||||
size_t offset = 0;
|
||||
|
||||
while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
|
||||
remaining_bytes_ != 0) {
|
||||
// Pull bytes off the end of the seed data. Experimentally, this seems to
|
||||
// allow the fuzzer to more easily explore the input space. This makes
|
||||
// sense, since it works by modifying inputs that caused new code to run,
|
||||
// and this data is often used to encode length of data read by
|
||||
// |ConsumeBytes|. Separating out read lengths makes it easier modify the
|
||||
// contents of the data that is actually read.
|
||||
--remaining_bytes_;
|
||||
result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
|
||||
offset += CHAR_BIT;
|
||||
}
|
||||
|
||||
// Avoid division by 0, in case |range + 1| results in overflow.
|
||||
if (range != std::numeric_limits<decltype(range)>::max())
|
||||
result = result % (range + 1);
|
||||
|
||||
return static_cast<T>(min + result);
|
||||
}
|
||||
|
||||
// Returns a floating point value in the range [Type's lowest, Type's max] by
|
||||
// consuming bytes from the input data. If there's no input data left, always
|
||||
// returns approximately 0.
|
||||
template <typename T> T FuzzedDataProvider::ConsumeFloatingPoint() {
|
||||
return ConsumeFloatingPointInRange<T>(std::numeric_limits<T>::lowest(),
|
||||
std::numeric_limits<T>::max());
|
||||
}
|
||||
|
||||
// Returns a floating point value in the given range by consuming bytes from
|
||||
// the input data. If there's no input data left, returns |min|. Note that
|
||||
// |min| must be less than or equal to |max|.
|
||||
template <typename T>
|
||||
T FuzzedDataProvider::ConsumeFloatingPointInRange(T min, T max) {
|
||||
if (min > max)
|
||||
abort();
|
||||
|
||||
T range = .0;
|
||||
T result = min;
|
||||
constexpr T zero(.0);
|
||||
if (max > zero && min < zero && max > min + std::numeric_limits<T>::max()) {
|
||||
// The diff |max - min| would overflow the given floating point type. Use
|
||||
// the half of the diff as the range and consume a bool to decide whether
|
||||
// the result is in the first of the second part of the diff.
|
||||
range = (max / 2.0) - (min / 2.0);
|
||||
if (ConsumeBool()) {
|
||||
result += range;
|
||||
}
|
||||
} else {
|
||||
range = max - min;
|
||||
}
|
||||
|
||||
return result + range * ConsumeProbability<T>();
|
||||
}
|
||||
|
||||
// Returns a floating point number in the range [0.0, 1.0]. If there's no
|
||||
// input data left, always returns 0.
|
||||
template <typename T> T FuzzedDataProvider::ConsumeProbability() {
|
||||
static_assert(std::is_floating_point<T>::value,
|
||||
"A floating point type is required.");
|
||||
|
||||
// Use different integral types for different floating point types in order
|
||||
// to provide better density of the resulting values.
|
||||
using IntegralType =
|
||||
typename std::conditional<(sizeof(T) <= sizeof(uint32_t)), uint32_t,
|
||||
uint64_t>::type;
|
||||
|
||||
T result = static_cast<T>(ConsumeIntegral<IntegralType>());
|
||||
result /= static_cast<T>(std::numeric_limits<IntegralType>::max());
|
||||
return result;
|
||||
}
|
||||
|
||||
// Reads one byte and returns a bool, or false when no data remains.
|
||||
inline bool FuzzedDataProvider::ConsumeBool() {
|
||||
return 1 & ConsumeIntegral<uint8_t>();
|
||||
}
|
||||
|
||||
// Returns an enum value. The enum must start at 0 and be contiguous. It must
|
||||
// also contain |kMaxValue| aliased to its largest (inclusive) value. Such as:
|
||||
// enum class Foo { SomeValue, OtherValue, kMaxValue = OtherValue };
|
||||
template <typename T> T FuzzedDataProvider::ConsumeEnum() {
|
||||
static_assert(std::is_enum<T>::value, "|T| must be an enum type.");
|
||||
return static_cast<T>(
|
||||
ConsumeIntegralInRange<uint32_t>(0, static_cast<uint32_t>(T::kMaxValue)));
|
||||
}
|
||||
|
||||
// Returns a copy of the value selected from the given fixed-size |array|.
|
||||
template <typename T, size_t size>
|
||||
T FuzzedDataProvider::PickValueInArray(const T (&array)[size]) {
|
||||
static_assert(size > 0, "The array must be non empty.");
|
||||
return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
|
||||
}
|
||||
|
||||
template <typename T, size_t size>
|
||||
T FuzzedDataProvider::PickValueInArray(const std::array<T, size> &array) {
|
||||
static_assert(size > 0, "The array must be non empty.");
|
||||
return array[ConsumeIntegralInRange<size_t>(0, size - 1)];
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T FuzzedDataProvider::PickValueInArray(std::initializer_list<const T> list) {
|
||||
// TODO(Dor1s): switch to static_assert once C++14 is allowed.
|
||||
if (!list.size())
|
||||
abort();
|
||||
|
||||
return *(list.begin() + ConsumeIntegralInRange<size_t>(0, list.size() - 1));
|
||||
}
|
||||
|
||||
// Writes |num_bytes| of input data to the given destination pointer. If there
|
||||
// is not enough data left, writes all remaining bytes. Return value is the
|
||||
// number of bytes written.
|
||||
// In general, it's better to avoid using this function, but it may be useful
|
||||
// in cases when it's necessary to fill a certain buffer or object with
|
||||
// fuzzing data.
|
||||
inline size_t FuzzedDataProvider::ConsumeData(void *destination,
|
||||
size_t num_bytes) {
|
||||
num_bytes = std::min(num_bytes, remaining_bytes_);
|
||||
CopyAndAdvance(destination, num_bytes);
|
||||
return num_bytes;
|
||||
}
|
||||
|
||||
// Private methods.
|
||||
inline void FuzzedDataProvider::CopyAndAdvance(void *destination,
|
||||
size_t num_bytes) {
|
||||
std::memcpy(destination, data_ptr_, num_bytes);
|
||||
Advance(num_bytes);
|
||||
}
|
||||
|
||||
inline void FuzzedDataProvider::Advance(size_t num_bytes) {
|
||||
if (num_bytes > remaining_bytes_)
|
||||
abort();
|
||||
|
||||
data_ptr_ += num_bytes;
|
||||
remaining_bytes_ -= num_bytes;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
std::vector<T> FuzzedDataProvider::ConsumeBytes(size_t size, size_t num_bytes) {
|
||||
static_assert(sizeof(T) == sizeof(uint8_t), "Incompatible data type.");
|
||||
|
||||
// The point of using the size-based constructor below is to increase the
|
||||
// odds of having a vector object with capacity being equal to the length.
|
||||
// That part is always implementation specific, but at least both libc++ and
|
||||
// libstdc++ allocate the requested number of bytes in that constructor,
|
||||
// which seems to be a natural choice for other implementations as well.
|
||||
// To increase the odds even more, we also call |shrink_to_fit| below.
|
||||
std::vector<T> result(size);
|
||||
if (size == 0) {
|
||||
if (num_bytes != 0)
|
||||
abort();
|
||||
return result;
|
||||
}
|
||||
|
||||
CopyAndAdvance(result.data(), num_bytes);
|
||||
|
||||
// Even though |shrink_to_fit| is also implementation specific, we expect it
|
||||
// to provide an additional assurance in case vector's constructor allocated
|
||||
// a buffer which is larger than the actual amount of data we put inside it.
|
||||
result.shrink_to_fit();
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename TS, typename TU>
|
||||
TS FuzzedDataProvider::ConvertUnsignedToSigned(TU value) {
|
||||
static_assert(sizeof(TS) == sizeof(TU), "Incompatible data types.");
|
||||
static_assert(!std::numeric_limits<TU>::is_signed,
|
||||
"Source type must be unsigned.");
|
||||
|
||||
// TODO(Dor1s): change to `if constexpr` once C++17 becomes mainstream.
|
||||
if (std::numeric_limits<TS>::is_modulo)
|
||||
return static_cast<TS>(value);
|
||||
|
||||
// Avoid using implementation-defined unsigned to signed conversions.
|
||||
// To learn more, see https://stackoverflow.com/questions/13150449.
|
||||
if (value <= std::numeric_limits<TS>::max()) {
|
||||
return static_cast<TS>(value);
|
||||
} else {
|
||||
constexpr auto TS_min = std::numeric_limits<TS>::min();
|
||||
return TS_min + static_cast<char>(value - TS_min);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // LLVM_FUZZER_FUZZED_DATA_PROVIDER_H_
|
||||
55
src/test/fuzz/addition_overflow.cpp
Normal file
55
src/test/fuzz/addition_overflow.cpp
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#if defined(__has_builtin)
|
||||
#if __has_builtin(__builtin_add_overflow)
|
||||
#define HAVE_BUILTIN_ADD_OVERFLOW
|
||||
#endif
|
||||
#elif defined(__GNUC__)
|
||||
#define HAVE_BUILTIN_ADD_OVERFLOW
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
template <typename T>
|
||||
void TestAdditionOverflow(FuzzedDataProvider& fuzzed_data_provider)
|
||||
{
|
||||
const T i = fuzzed_data_provider.ConsumeIntegral<T>();
|
||||
const T j = fuzzed_data_provider.ConsumeIntegral<T>();
|
||||
const bool is_addition_overflow_custom = AdditionOverflow(i, j);
|
||||
#if defined(HAVE_BUILTIN_ADD_OVERFLOW)
|
||||
T result_builtin;
|
||||
const bool is_addition_overflow_builtin = __builtin_add_overflow(i, j, &result_builtin);
|
||||
assert(is_addition_overflow_custom == is_addition_overflow_builtin);
|
||||
if (!is_addition_overflow_custom) {
|
||||
assert(i + j == result_builtin);
|
||||
}
|
||||
#else
|
||||
if (!is_addition_overflow_custom) {
|
||||
(void)(i + j);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
} // namespace
|
||||
|
||||
FUZZ_TARGET(addition_overflow)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
TestAdditionOverflow<int64_t>(fuzzed_data_provider);
|
||||
TestAdditionOverflow<uint64_t>(fuzzed_data_provider);
|
||||
TestAdditionOverflow<int32_t>(fuzzed_data_provider);
|
||||
TestAdditionOverflow<uint32_t>(fuzzed_data_provider);
|
||||
TestAdditionOverflow<int16_t>(fuzzed_data_provider);
|
||||
TestAdditionOverflow<uint16_t>(fuzzed_data_provider);
|
||||
TestAdditionOverflow<char>(fuzzed_data_provider);
|
||||
TestAdditionOverflow<unsigned char>(fuzzed_data_provider);
|
||||
TestAdditionOverflow<signed char>(fuzzed_data_provider);
|
||||
}
|
||||
37
src/test/fuzz/addrdb.cpp
Normal file
37
src/test/fuzz/addrdb.cpp
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <addrdb.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(addrdb)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
|
||||
// The point of this code is to exercise all CBanEntry constructors.
|
||||
const CBanEntry ban_entry = [&] {
|
||||
switch (fuzzed_data_provider.ConsumeIntegralInRange<int>(0, 2)) {
|
||||
case 0:
|
||||
return CBanEntry{fuzzed_data_provider.ConsumeIntegral<int64_t>()};
|
||||
break;
|
||||
case 1: {
|
||||
const std::optional<CBanEntry> ban_entry = ConsumeDeserializable<CBanEntry>(fuzzed_data_provider);
|
||||
if (ban_entry) {
|
||||
return *ban_entry;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return CBanEntry{};
|
||||
}();
|
||||
(void)ban_entry; // currently unused
|
||||
}
|
||||
114
src/test/fuzz/addrman.cpp
Normal file
114
src/test/fuzz/addrman.cpp
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <addrdb.h>
|
||||
#include <addrman.h>
|
||||
#include <chainparams.h>
|
||||
#include <merkleblock.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <time.h>
|
||||
#include <util/asmap.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
void initialize_addrman()
|
||||
{
|
||||
SelectParams(CBaseChainParams::REGTEST);
|
||||
}
|
||||
|
||||
class CAddrManDeterministic : public CAddrMan
|
||||
{
|
||||
public:
|
||||
void MakeDeterministic(const uint256& random_seed)
|
||||
{
|
||||
insecure_rand = FastRandomContext{random_seed};
|
||||
Clear();
|
||||
}
|
||||
};
|
||||
|
||||
FUZZ_TARGET_INIT(addrman, initialize_addrman)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
SetMockTime(ConsumeTime(fuzzed_data_provider));
|
||||
CAddrManDeterministic addr_man;
|
||||
addr_man.MakeDeterministic(ConsumeUInt256(fuzzed_data_provider));
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
addr_man.m_asmap = ConsumeRandomLengthBitVector(fuzzed_data_provider);
|
||||
if (!SanityCheckASMap(addr_man.m_asmap)) {
|
||||
addr_man.m_asmap.clear();
|
||||
}
|
||||
}
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
addr_man.Clear();
|
||||
},
|
||||
[&] {
|
||||
addr_man.ResolveCollisions();
|
||||
},
|
||||
[&] {
|
||||
(void)addr_man.SelectTriedCollision();
|
||||
},
|
||||
[&] {
|
||||
const std::optional<CAddress> opt_address = ConsumeDeserializable<CAddress>(fuzzed_data_provider);
|
||||
const std::optional<CNetAddr> opt_net_addr = ConsumeDeserializable<CNetAddr>(fuzzed_data_provider);
|
||||
if (opt_address && opt_net_addr) {
|
||||
addr_man.Add(*opt_address, *opt_net_addr, fuzzed_data_provider.ConsumeIntegralInRange<int64_t>(0, 100000000));
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
std::vector<CAddress> addresses;
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
const std::optional<CAddress> opt_address = ConsumeDeserializable<CAddress>(fuzzed_data_provider);
|
||||
if (!opt_address) {
|
||||
break;
|
||||
}
|
||||
addresses.push_back(*opt_address);
|
||||
}
|
||||
const std::optional<CNetAddr> opt_net_addr = ConsumeDeserializable<CNetAddr>(fuzzed_data_provider);
|
||||
if (opt_net_addr) {
|
||||
addr_man.Add(addresses, *opt_net_addr, fuzzed_data_provider.ConsumeIntegralInRange<int64_t>(0, 100000000));
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
const std::optional<CService> opt_service = ConsumeDeserializable<CService>(fuzzed_data_provider);
|
||||
if (opt_service) {
|
||||
addr_man.Good(*opt_service, fuzzed_data_provider.ConsumeBool(), ConsumeTime(fuzzed_data_provider));
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
const std::optional<CService> opt_service = ConsumeDeserializable<CService>(fuzzed_data_provider);
|
||||
if (opt_service) {
|
||||
addr_man.Attempt(*opt_service, fuzzed_data_provider.ConsumeBool(), ConsumeTime(fuzzed_data_provider));
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
const std::optional<CService> opt_service = ConsumeDeserializable<CService>(fuzzed_data_provider);
|
||||
if (opt_service) {
|
||||
addr_man.Connected(*opt_service, ConsumeTime(fuzzed_data_provider));
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
const std::optional<CService> opt_service = ConsumeDeserializable<CService>(fuzzed_data_provider);
|
||||
if (opt_service) {
|
||||
addr_man.SetServices(*opt_service, ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS));
|
||||
}
|
||||
});
|
||||
}
|
||||
const CAddrMan& const_addr_man{addr_man};
|
||||
(void)/*const_*/addr_man.GetAddr(
|
||||
/* max_addresses */ fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096),
|
||||
/* max_pct */ fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096),
|
||||
/* network */ std::nullopt);
|
||||
(void)/*const_*/addr_man.Select(fuzzed_data_provider.ConsumeBool());
|
||||
(void)const_addr_man.size();
|
||||
CDataStream data_stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
data_stream << const_addr_man;
|
||||
}
|
||||
59
src/test/fuzz/asmap.cpp
Normal file
59
src/test/fuzz/asmap.cpp
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <netaddress.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
//! asmap code that consumes nothing
|
||||
static const std::vector<bool> IPV6_PREFIX_ASMAP = {};
|
||||
|
||||
//! asmap code that consumes the 96 prefix bits of ::ffff:0/96 (IPv4-in-IPv6 map)
|
||||
static const std::vector<bool> IPV4_PREFIX_ASMAP = {
|
||||
true, true, false, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, // Match 0x00
|
||||
true, true, false, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, // Match 0x00
|
||||
true, true, false, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, // Match 0x00
|
||||
true, true, false, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, // Match 0x00
|
||||
true, true, false, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, // Match 0x00
|
||||
true, true, false, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, // Match 0x00
|
||||
true, true, false, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, // Match 0x00
|
||||
true, true, false, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, // Match 0x00
|
||||
true, true, false, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, // Match 0x00
|
||||
true, true, false, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, // Match 0x00
|
||||
true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, // Match 0xFF
|
||||
true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true // Match 0xFF
|
||||
};
|
||||
|
||||
FUZZ_TARGET(asmap)
|
||||
{
|
||||
// Encoding: [7 bits: asmap size] [1 bit: ipv6?] [3-130 bytes: asmap] [4 or 16 bytes: addr]
|
||||
if (buffer.size() < 1 + 3 + 4) return;
|
||||
int asmap_size = 3 + (buffer[0] & 127);
|
||||
bool ipv6 = buffer[0] & 128;
|
||||
const size_t addr_size = ipv6 ? ADDR_IPV6_SIZE : ADDR_IPV4_SIZE;
|
||||
if (buffer.size() < size_t(1 + asmap_size + addr_size)) return;
|
||||
std::vector<bool> asmap = ipv6 ? IPV6_PREFIX_ASMAP : IPV4_PREFIX_ASMAP;
|
||||
asmap.reserve(asmap.size() + 8 * asmap_size);
|
||||
for (int i = 0; i < asmap_size; ++i) {
|
||||
for (int j = 0; j < 8; ++j) {
|
||||
asmap.push_back((buffer[1 + i] >> j) & 1);
|
||||
}
|
||||
}
|
||||
if (!SanityCheckASMap(asmap)) return;
|
||||
|
||||
const uint8_t* addr_data = buffer.data() + 1 + asmap_size;
|
||||
CNetAddr net_addr;
|
||||
if (ipv6) {
|
||||
assert(addr_size == ADDR_IPV6_SIZE);
|
||||
net_addr.SetLegacyIPv6(Span<const uint8_t>(addr_data, addr_size));
|
||||
} else {
|
||||
assert(addr_size == ADDR_IPV4_SIZE);
|
||||
in_addr ipv4;
|
||||
memcpy(&ipv4, addr_data, addr_size);
|
||||
net_addr.SetIP(CNetAddr{ipv4});
|
||||
}
|
||||
(void)net_addr.GetMappedAS(asmap);
|
||||
}
|
||||
49
src/test/fuzz/asmap_direct.cpp
Normal file
49
src/test/fuzz/asmap_direct.cpp
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <netaddress.h>
|
||||
#include <util/asmap.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
FUZZ_TARGET(asmap_direct)
|
||||
{
|
||||
// Encoding: [asmap using 1 bit / byte] 0xFF [addr using 1 bit / byte]
|
||||
std::optional<size_t> sep_pos_opt;
|
||||
for (size_t pos = 0; pos < buffer.size(); ++pos) {
|
||||
uint8_t x = buffer[pos];
|
||||
if ((x & 0xFE) == 0) continue;
|
||||
if (x == 0xFF) {
|
||||
if (sep_pos_opt) return;
|
||||
sep_pos_opt = pos;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!sep_pos_opt) return; // Needs exactly 1 separator
|
||||
const size_t sep_pos{sep_pos_opt.value()};
|
||||
if (buffer.size() - sep_pos - 1 > 128) return; // At most 128 bits in IP address
|
||||
|
||||
// Checks on asmap
|
||||
std::vector<bool> asmap(buffer.begin(), buffer.begin() + sep_pos);
|
||||
if (SanityCheckASMap(asmap, buffer.size() - 1 - sep_pos)) {
|
||||
// Verify that for valid asmaps, no prefix (except up to 7 zero padding bits) is valid.
|
||||
std::vector<bool> asmap_prefix = asmap;
|
||||
while (!asmap_prefix.empty() && asmap_prefix.size() + 7 > asmap.size() && asmap_prefix.back() == false) {
|
||||
asmap_prefix.pop_back();
|
||||
}
|
||||
while (!asmap_prefix.empty()) {
|
||||
asmap_prefix.pop_back();
|
||||
assert(!SanityCheckASMap(asmap_prefix, buffer.size() - 1 - sep_pos));
|
||||
}
|
||||
// No address input should trigger assertions in interpreter
|
||||
std::vector<bool> addr(buffer.begin() + sep_pos + 1, buffer.end());
|
||||
(void)Interpret(asmap, addr);
|
||||
}
|
||||
}
|
||||
65
src/test/fuzz/autofile.cpp
Normal file
65
src/test/fuzz/autofile.cpp
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <streams.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(autofile)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
FuzzedAutoFileProvider fuzzed_auto_file_provider = ConsumeAutoFile(fuzzed_data_provider);
|
||||
CAutoFile auto_file = fuzzed_auto_file_provider.open();
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
std::array<uint8_t, 4096> arr{};
|
||||
try {
|
||||
auto_file.read((char*)arr.data(), fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096));
|
||||
} catch (const std::ios_base::failure&) {
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
const std::array<uint8_t, 4096> arr{};
|
||||
try {
|
||||
auto_file.write((const char*)arr.data(), fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096));
|
||||
} catch (const std::ios_base::failure&) {
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
try {
|
||||
auto_file.ignore(fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096));
|
||||
} catch (const std::ios_base::failure&) {
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
auto_file.fclose();
|
||||
},
|
||||
[&] {
|
||||
ReadFromStream(fuzzed_data_provider, auto_file);
|
||||
},
|
||||
[&] {
|
||||
WriteToStream(fuzzed_data_provider, auto_file);
|
||||
});
|
||||
}
|
||||
(void)auto_file.Get();
|
||||
(void)auto_file.GetType();
|
||||
(void)auto_file.GetVersion();
|
||||
(void)auto_file.IsNull();
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
FILE* f = auto_file.release();
|
||||
if (f != nullptr) {
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
117
src/test/fuzz/banman.cpp
Normal file
117
src/test/fuzz/banman.cpp
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <banman.h>
|
||||
#include <fs.h>
|
||||
#include <netaddress.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <util/readwritefile.h>
|
||||
#include <util/system.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
int64_t ConsumeBanTimeOffset(FuzzedDataProvider& fuzzed_data_provider) noexcept
|
||||
{
|
||||
// Avoid signed integer overflow by capping to int32_t max:
|
||||
// banman.cpp:137:73: runtime error: signed integer overflow: 1591700817 + 9223372036854775807 cannot be represented in type 'long'
|
||||
return fuzzed_data_provider.ConsumeIntegralInRange<int64_t>(std::numeric_limits<int64_t>::min(), std::numeric_limits<int32_t>::max());
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void initialize_banman()
|
||||
{
|
||||
static const auto testing_setup = MakeNoLogFileContext<>();
|
||||
}
|
||||
|
||||
static bool operator==(const CBanEntry& lhs, const CBanEntry& rhs)
|
||||
{
|
||||
return lhs.nVersion == rhs.nVersion &&
|
||||
lhs.nCreateTime == rhs.nCreateTime &&
|
||||
lhs.nBanUntil == rhs.nBanUntil;
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(banman, initialize_banman)
|
||||
{
|
||||
// The complexity is O(N^2), where N is the input size, because each call
|
||||
// might call DumpBanlist (or other methods that are at least linear
|
||||
// complexity of the input size).
|
||||
int limit_max_ops{300};
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
SetMockTime(ConsumeTime(fuzzed_data_provider));
|
||||
fs::path banlist_file = gArgs.GetDataDirNet() / "fuzzed_banlist";
|
||||
|
||||
const bool start_with_corrupted_banlist{fuzzed_data_provider.ConsumeBool()};
|
||||
bool force_read_and_write_to_err{false};
|
||||
if (start_with_corrupted_banlist) {
|
||||
const std::string sfx{fuzzed_data_provider.ConsumeBool() ? ".dat" : ".json"};
|
||||
assert(WriteBinaryFile(banlist_file.string() + sfx,
|
||||
fuzzed_data_provider.ConsumeRandomLengthString()));
|
||||
} else {
|
||||
force_read_and_write_to_err = fuzzed_data_provider.ConsumeBool();
|
||||
if (force_read_and_write_to_err) {
|
||||
banlist_file = fs::path{"path"} / "to" / "inaccessible" / "fuzzed_banlist";
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
BanMan ban_man{banlist_file, /* client_interface */ nullptr, /* default_ban_time */ ConsumeBanTimeOffset(fuzzed_data_provider)};
|
||||
while (--limit_max_ops >= 0 && fuzzed_data_provider.ConsumeBool()) {
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
ban_man.Ban(ConsumeNetAddr(fuzzed_data_provider),
|
||||
ConsumeBanTimeOffset(fuzzed_data_provider), fuzzed_data_provider.ConsumeBool());
|
||||
},
|
||||
[&] {
|
||||
ban_man.Ban(ConsumeSubNet(fuzzed_data_provider),
|
||||
ConsumeBanTimeOffset(fuzzed_data_provider), fuzzed_data_provider.ConsumeBool());
|
||||
},
|
||||
[&] {
|
||||
ban_man.ClearBanned();
|
||||
},
|
||||
[&] {
|
||||
ban_man.IsBanned(ConsumeNetAddr(fuzzed_data_provider));
|
||||
},
|
||||
[&] {
|
||||
ban_man.IsBanned(ConsumeSubNet(fuzzed_data_provider));
|
||||
},
|
||||
[&] {
|
||||
ban_man.Unban(ConsumeNetAddr(fuzzed_data_provider));
|
||||
},
|
||||
[&] {
|
||||
ban_man.Unban(ConsumeSubNet(fuzzed_data_provider));
|
||||
},
|
||||
[&] {
|
||||
banmap_t banmap;
|
||||
ban_man.GetBanned(banmap);
|
||||
},
|
||||
[&] {
|
||||
ban_man.DumpBanlist();
|
||||
},
|
||||
[&] {
|
||||
ban_man.Discourage(ConsumeNetAddr(fuzzed_data_provider));
|
||||
});
|
||||
}
|
||||
if (!force_read_and_write_to_err) {
|
||||
ban_man.DumpBanlist();
|
||||
SetMockTime(ConsumeTime(fuzzed_data_provider));
|
||||
banmap_t banmap;
|
||||
ban_man.GetBanned(banmap);
|
||||
BanMan ban_man_read{banlist_file, /* client_interface */ nullptr, /* default_ban_time */ 0};
|
||||
banmap_t banmap_read;
|
||||
ban_man_read.GetBanned(banmap_read);
|
||||
assert(banmap == banmap_read);
|
||||
}
|
||||
}
|
||||
fs::remove(banlist_file.string() + ".dat");
|
||||
fs::remove(banlist_file.string() + ".json");
|
||||
}
|
||||
57
src/test/fuzz/base_encode_decode.cpp
Normal file
57
src/test/fuzz/base_encode_decode.cpp
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
// Copyright (c) 2019-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <test/fuzz/fuzz.h>
|
||||
|
||||
#include <base58.h>
|
||||
#include <psbt.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/string.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
void initialize_base_encode_decode()
|
||||
{
|
||||
static const ECCVerifyHandle verify_handle;
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(base_encode_decode, initialize_base_encode_decode)
|
||||
{
|
||||
const std::string random_encoded_string(buffer.begin(), buffer.end());
|
||||
|
||||
std::vector<unsigned char> decoded;
|
||||
if (DecodeBase58(random_encoded_string, decoded, 100)) {
|
||||
const std::string encoded_string = EncodeBase58(decoded);
|
||||
assert(encoded_string == TrimString(encoded_string));
|
||||
assert(ToLower(encoded_string) == ToLower(TrimString(random_encoded_string)));
|
||||
}
|
||||
|
||||
if (DecodeBase58Check(random_encoded_string, decoded, 100)) {
|
||||
const std::string encoded_string = EncodeBase58Check(decoded);
|
||||
assert(encoded_string == TrimString(encoded_string));
|
||||
assert(ToLower(encoded_string) == ToLower(TrimString(random_encoded_string)));
|
||||
}
|
||||
|
||||
bool pf_invalid;
|
||||
std::string decoded_string = DecodeBase32(random_encoded_string, &pf_invalid);
|
||||
if (!pf_invalid) {
|
||||
const std::string encoded_string = EncodeBase32(decoded_string);
|
||||
assert(encoded_string == TrimString(encoded_string));
|
||||
assert(ToLower(encoded_string) == ToLower(TrimString(random_encoded_string)));
|
||||
}
|
||||
|
||||
decoded_string = DecodeBase64(random_encoded_string, &pf_invalid);
|
||||
if (!pf_invalid) {
|
||||
const std::string encoded_string = EncodeBase64(decoded_string);
|
||||
assert(encoded_string == TrimString(encoded_string));
|
||||
assert(ToLower(encoded_string) == ToLower(TrimString(random_encoded_string)));
|
||||
}
|
||||
|
||||
PartiallySignedTransaction psbt;
|
||||
std::string error;
|
||||
(void)DecodeBase64PSBT(psbt, random_encoded_string, error);
|
||||
}
|
||||
43
src/test/fuzz/bech32.cpp
Normal file
43
src/test/fuzz/bech32.cpp
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
// Copyright (c) 2019-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <bech32.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/util/str.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(bech32)
|
||||
{
|
||||
const std::string random_string(buffer.begin(), buffer.end());
|
||||
const auto r1 = bech32::Decode(random_string);
|
||||
if (r1.hrp.empty()) {
|
||||
assert(r1.encoding == bech32::Encoding::INVALID);
|
||||
assert(r1.data.empty());
|
||||
} else {
|
||||
assert(r1.encoding != bech32::Encoding::INVALID);
|
||||
const std::string reencoded = bech32::Encode(r1.encoding, r1.hrp, r1.data);
|
||||
assert(CaseInsensitiveEqual(random_string, reencoded));
|
||||
}
|
||||
|
||||
std::vector<unsigned char> input;
|
||||
ConvertBits<8, 5, true>([&](unsigned char c) { input.push_back(c); }, buffer.begin(), buffer.end());
|
||||
|
||||
if (input.size() + 3 + 6 <= 90) {
|
||||
// If it's possible to encode input in Bech32(m) without exceeding the 90-character limit:
|
||||
for (auto encoding : {bech32::Encoding::BECH32, bech32::Encoding::BECH32M}) {
|
||||
const std::string encoded = bech32::Encode(encoding, "bc", input);
|
||||
assert(!encoded.empty());
|
||||
const auto r2 = bech32::Decode(encoded);
|
||||
assert(r2.encoding == encoding);
|
||||
assert(r2.hrp == "bc");
|
||||
assert(r2.data == input);
|
||||
}
|
||||
}
|
||||
}
|
||||
74
src/test/fuzz/block.cpp
Normal file
74
src/test/fuzz/block.cpp
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
// Copyright (c) 2019-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <chainparams.h>
|
||||
#include <consensus/merkle.h>
|
||||
#include <consensus/validation.h>
|
||||
#include <core_io.h>
|
||||
#include <core_memusage.h>
|
||||
#include <primitives/block.h>
|
||||
#include <pubkey.h>
|
||||
#include <streams.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <validation.h>
|
||||
#include <version.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
|
||||
void initialize_block()
|
||||
{
|
||||
static const ECCVerifyHandle verify_handle;
|
||||
SelectParams(CBaseChainParams::REGTEST);
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(block, initialize_block)
|
||||
{
|
||||
CDataStream ds(buffer, SER_NETWORK, INIT_PROTO_VERSION);
|
||||
CBlock block;
|
||||
try {
|
||||
int nVersion;
|
||||
ds >> nVersion;
|
||||
ds.SetVersion(nVersion);
|
||||
ds >> block;
|
||||
} catch (const std::ios_base::failure&) {
|
||||
return;
|
||||
}
|
||||
const Consensus::Params& consensus_params = Params().GetConsensus();
|
||||
BlockValidationState validation_state_pow_and_merkle;
|
||||
const bool valid_incl_pow_and_merkle = CheckBlock(block, validation_state_pow_and_merkle, consensus_params, /* fCheckPOW= */ true, /* fCheckMerkleRoot= */ true);
|
||||
assert(validation_state_pow_and_merkle.IsValid() || validation_state_pow_and_merkle.IsInvalid() || validation_state_pow_and_merkle.IsError());
|
||||
(void)validation_state_pow_and_merkle.Error("");
|
||||
BlockValidationState validation_state_pow;
|
||||
const bool valid_incl_pow = CheckBlock(block, validation_state_pow, consensus_params, /* fCheckPOW= */ true, /* fCheckMerkleRoot= */ false);
|
||||
assert(validation_state_pow.IsValid() || validation_state_pow.IsInvalid() || validation_state_pow.IsError());
|
||||
BlockValidationState validation_state_merkle;
|
||||
const bool valid_incl_merkle = CheckBlock(block, validation_state_merkle, consensus_params, /* fCheckPOW= */ false, /* fCheckMerkleRoot= */ true);
|
||||
assert(validation_state_merkle.IsValid() || validation_state_merkle.IsInvalid() || validation_state_merkle.IsError());
|
||||
BlockValidationState validation_state_none;
|
||||
const bool valid_incl_none = CheckBlock(block, validation_state_none, consensus_params, /* fCheckPOW= */ false, /* fCheckMerkleRoot= */ false);
|
||||
assert(validation_state_none.IsValid() || validation_state_none.IsInvalid() || validation_state_none.IsError());
|
||||
if (valid_incl_pow_and_merkle) {
|
||||
assert(valid_incl_pow && valid_incl_merkle && valid_incl_none);
|
||||
} else if (valid_incl_merkle || valid_incl_pow) {
|
||||
assert(valid_incl_none);
|
||||
}
|
||||
(void)block.GetHash();
|
||||
(void)block.ToString(consensus_params);
|
||||
(void)BlockMerkleRoot(block);
|
||||
if (!block.vtx.empty()) {
|
||||
// TODO: Avoid array index out of bounds error in BlockWitnessMerkleRoot
|
||||
// when block.vtx.empty().
|
||||
(void)BlockWitnessMerkleRoot(block);
|
||||
}
|
||||
(void)GetBlockWeight(block);
|
||||
(void)GetWitnessCommitmentIndex(block);
|
||||
const size_t raw_memory_size = RecursiveDynamicUsage(block);
|
||||
const size_t raw_memory_size_as_shared_ptr = RecursiveDynamicUsage(std::make_shared<CBlock>(block));
|
||||
assert(raw_memory_size_as_shared_ptr > raw_memory_size);
|
||||
CBlock block_copy = block;
|
||||
block_copy.SetNull();
|
||||
const bool is_null = block_copy.IsNull();
|
||||
assert(is_null);
|
||||
}
|
||||
50
src/test/fuzz/block_header.cpp
Normal file
50
src/test/fuzz/block_header.cpp
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <primitives/block.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <uint256.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(block_header)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
const std::optional<CBlockHeader> block_header = ConsumeDeserializable<CBlockHeader>(fuzzed_data_provider);
|
||||
if (!block_header) {
|
||||
return;
|
||||
}
|
||||
{
|
||||
const uint256 hash = block_header->GetHash();
|
||||
static const uint256 u256_max(uint256S("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));
|
||||
assert(hash != u256_max);
|
||||
assert(block_header->GetBlockTime() == block_header->nTime);
|
||||
assert(block_header->IsNull() == (block_header->nBits == 0));
|
||||
}
|
||||
{
|
||||
const Consensus::Params& consensus_params = Params().GetConsensus();
|
||||
CBlockHeader mut_block_header = *block_header;
|
||||
mut_block_header.SetNull();
|
||||
assert(mut_block_header.IsNull());
|
||||
CBlock block{*block_header};
|
||||
assert(block.GetBlockHeader().GetHash() == block_header->GetHash());
|
||||
(void)block.ToString(consensus_params);
|
||||
block.SetNull();
|
||||
assert(block.GetBlockHeader().GetHash() == mut_block_header.GetHash());
|
||||
}
|
||||
{
|
||||
std::optional<CBlockLocator> block_locator = ConsumeDeserializable<CBlockLocator>(fuzzed_data_provider);
|
||||
if (block_locator) {
|
||||
(void)block_locator->IsNull();
|
||||
block_locator->SetNull();
|
||||
assert(block_locator->IsNull());
|
||||
}
|
||||
}
|
||||
}
|
||||
44
src/test/fuzz/blockfilter.cpp
Normal file
44
src/test/fuzz/blockfilter.cpp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <blockfilter.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(blockfilter)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
const std::optional<BlockFilter> block_filter = ConsumeDeserializable<BlockFilter>(fuzzed_data_provider);
|
||||
if (!block_filter) {
|
||||
return;
|
||||
}
|
||||
{
|
||||
(void)block_filter->ComputeHeader(ConsumeUInt256(fuzzed_data_provider));
|
||||
(void)block_filter->GetBlockHash();
|
||||
(void)block_filter->GetEncodedFilter();
|
||||
(void)block_filter->GetHash();
|
||||
}
|
||||
{
|
||||
const BlockFilterType block_filter_type = block_filter->GetFilterType();
|
||||
(void)BlockFilterTypeName(block_filter_type);
|
||||
}
|
||||
{
|
||||
const GCSFilter gcs_filter = block_filter->GetFilter();
|
||||
(void)gcs_filter.GetN();
|
||||
(void)gcs_filter.GetParams();
|
||||
(void)gcs_filter.GetEncoded();
|
||||
(void)gcs_filter.Match(ConsumeRandomLengthByteVector(fuzzed_data_provider));
|
||||
GCSFilter::ElementSet element_set;
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
element_set.insert(ConsumeRandomLengthByteVector(fuzzed_data_provider));
|
||||
gcs_filter.MatchAny(element_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
67
src/test/fuzz/bloom_filter.cpp
Normal file
67
src/test/fuzz/bloom_filter.cpp
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <bloom.h>
|
||||
#include <primitives/transaction.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <uint256.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(bloom_filter)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
|
||||
CBloomFilter bloom_filter{
|
||||
fuzzed_data_provider.ConsumeIntegralInRange<unsigned int>(1, 10000000),
|
||||
1.0 / fuzzed_data_provider.ConsumeIntegralInRange<unsigned int>(1, std::numeric_limits<unsigned int>::max()),
|
||||
fuzzed_data_provider.ConsumeIntegral<unsigned int>(),
|
||||
static_cast<unsigned char>(fuzzed_data_provider.PickValueInArray({BLOOM_UPDATE_NONE, BLOOM_UPDATE_ALL, BLOOM_UPDATE_P2PUBKEY_ONLY, BLOOM_UPDATE_MASK}))};
|
||||
while (fuzzed_data_provider.remaining_bytes() > 0) {
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
const std::vector<unsigned char> b = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
(void)bloom_filter.contains(b);
|
||||
bloom_filter.insert(b);
|
||||
const bool present = bloom_filter.contains(b);
|
||||
assert(present);
|
||||
},
|
||||
[&] {
|
||||
const std::optional<COutPoint> out_point = ConsumeDeserializable<COutPoint>(fuzzed_data_provider);
|
||||
if (!out_point) {
|
||||
return;
|
||||
}
|
||||
(void)bloom_filter.contains(*out_point);
|
||||
bloom_filter.insert(*out_point);
|
||||
const bool present = bloom_filter.contains(*out_point);
|
||||
assert(present);
|
||||
},
|
||||
[&] {
|
||||
const std::optional<uint256> u256 = ConsumeDeserializable<uint256>(fuzzed_data_provider);
|
||||
if (!u256) {
|
||||
return;
|
||||
}
|
||||
(void)bloom_filter.contains(*u256);
|
||||
bloom_filter.insert(*u256);
|
||||
const bool present = bloom_filter.contains(*u256);
|
||||
assert(present);
|
||||
},
|
||||
[&] {
|
||||
const std::optional<CMutableTransaction> mut_tx = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider);
|
||||
if (!mut_tx) {
|
||||
return;
|
||||
}
|
||||
const CTransaction tx{*mut_tx};
|
||||
(void)bloom_filter.IsRelevantAndUpdate(tx);
|
||||
});
|
||||
(void)bloom_filter.IsWithinSizeConstraints();
|
||||
}
|
||||
}
|
||||
68
src/test/fuzz/buffered_file.cpp
Normal file
68
src/test/fuzz/buffered_file.cpp
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <streams.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(buffered_file)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
FuzzedFileProvider fuzzed_file_provider = ConsumeFile(fuzzed_data_provider);
|
||||
std::optional<CBufferedFile> opt_buffered_file;
|
||||
FILE* fuzzed_file = fuzzed_file_provider.open();
|
||||
try {
|
||||
opt_buffered_file.emplace(fuzzed_file, fuzzed_data_provider.ConsumeIntegralInRange<uint64_t>(0, 4096), fuzzed_data_provider.ConsumeIntegralInRange<uint64_t>(0, 4096), fuzzed_data_provider.ConsumeIntegral<int>(), fuzzed_data_provider.ConsumeIntegral<int>());
|
||||
} catch (const std::ios_base::failure&) {
|
||||
if (fuzzed_file != nullptr) {
|
||||
fclose(fuzzed_file);
|
||||
}
|
||||
}
|
||||
if (opt_buffered_file && fuzzed_file != nullptr) {
|
||||
bool setpos_fail = false;
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
std::array<uint8_t, 4096> arr{};
|
||||
try {
|
||||
opt_buffered_file->read((char*)arr.data(), fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096));
|
||||
} catch (const std::ios_base::failure&) {
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
opt_buffered_file->SetLimit(fuzzed_data_provider.ConsumeIntegralInRange<uint64_t>(0, 4096));
|
||||
},
|
||||
[&] {
|
||||
if (!opt_buffered_file->SetPos(fuzzed_data_provider.ConsumeIntegralInRange<uint64_t>(0, 4096))) {
|
||||
setpos_fail = true;
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
if (setpos_fail) {
|
||||
// Calling FindByte(...) after a failed SetPos(...) call may result in an infinite loop.
|
||||
return;
|
||||
}
|
||||
try {
|
||||
opt_buffered_file->FindByte(fuzzed_data_provider.ConsumeIntegral<char>());
|
||||
} catch (const std::ios_base::failure&) {
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
ReadFromStream(fuzzed_data_provider, *opt_buffered_file);
|
||||
});
|
||||
}
|
||||
opt_buffered_file->GetPos();
|
||||
opt_buffered_file->GetType();
|
||||
opt_buffered_file->GetVersion();
|
||||
}
|
||||
}
|
||||
65
src/test/fuzz/chain.cpp
Normal file
65
src/test/fuzz/chain.cpp
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <chain.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(chain)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
std::optional<CDiskBlockIndex> disk_block_index = ConsumeDeserializable<CDiskBlockIndex>(fuzzed_data_provider);
|
||||
if (!disk_block_index) {
|
||||
return;
|
||||
}
|
||||
|
||||
const uint256 zero{};
|
||||
disk_block_index->phashBlock = &zero;
|
||||
(void)disk_block_index->GetBlockHash();
|
||||
(void)disk_block_index->GetBlockPos();
|
||||
(void)disk_block_index->GetBlockTime();
|
||||
(void)disk_block_index->GetBlockTimeMax();
|
||||
(void)disk_block_index->GetMedianTimePast();
|
||||
(void)disk_block_index->GetUndoPos();
|
||||
(void)disk_block_index->HaveTxsDownloaded();
|
||||
(void)disk_block_index->IsValid();
|
||||
(void)disk_block_index->ToString();
|
||||
|
||||
const CBlockHeader block_header = disk_block_index->GetBlockHeader();
|
||||
(void)CDiskBlockIndex{*disk_block_index};
|
||||
(void)disk_block_index->BuildSkip();
|
||||
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
const BlockStatus block_status = fuzzed_data_provider.PickValueInArray({
|
||||
BlockStatus::BLOCK_VALID_UNKNOWN,
|
||||
BlockStatus::BLOCK_VALID_RESERVED,
|
||||
BlockStatus::BLOCK_VALID_TREE,
|
||||
BlockStatus::BLOCK_VALID_TRANSACTIONS,
|
||||
BlockStatus::BLOCK_VALID_CHAIN,
|
||||
BlockStatus::BLOCK_VALID_SCRIPTS,
|
||||
BlockStatus::BLOCK_VALID_MASK,
|
||||
BlockStatus::BLOCK_HAVE_DATA,
|
||||
BlockStatus::BLOCK_HAVE_UNDO,
|
||||
BlockStatus::BLOCK_HAVE_MASK,
|
||||
BlockStatus::BLOCK_FAILED_VALID,
|
||||
BlockStatus::BLOCK_FAILED_CHILD,
|
||||
BlockStatus::BLOCK_FAILED_MASK,
|
||||
BlockStatus::BLOCK_OPT_WITNESS,
|
||||
});
|
||||
if (block_status & ~BLOCK_VALID_MASK) {
|
||||
continue;
|
||||
}
|
||||
(void)disk_block_index->RaiseValidity(block_status);
|
||||
}
|
||||
|
||||
CBlockIndex block_index{block_header};
|
||||
block_index.phashBlock = &zero;
|
||||
(void)block_index.GetBlockHash();
|
||||
(void)block_index.ToString();
|
||||
}
|
||||
64
src/test/fuzz/checkqueue.cpp
Normal file
64
src/test/fuzz/checkqueue.cpp
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <checkqueue.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
struct DumbCheck {
|
||||
const bool result = false;
|
||||
|
||||
DumbCheck() = default;
|
||||
|
||||
explicit DumbCheck(const bool _result) : result(_result)
|
||||
{
|
||||
}
|
||||
|
||||
bool operator()() const
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
void swap(DumbCheck& x)
|
||||
{
|
||||
}
|
||||
};
|
||||
} // namespace
|
||||
|
||||
FUZZ_TARGET(checkqueue)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
|
||||
const unsigned int batch_size = fuzzed_data_provider.ConsumeIntegralInRange<unsigned int>(0, 1024);
|
||||
CCheckQueue<DumbCheck> check_queue_1{batch_size};
|
||||
CCheckQueue<DumbCheck> check_queue_2{batch_size};
|
||||
std::vector<DumbCheck> checks_1;
|
||||
std::vector<DumbCheck> checks_2;
|
||||
const int size = fuzzed_data_provider.ConsumeIntegralInRange<int>(0, 1024);
|
||||
for (int i = 0; i < size; ++i) {
|
||||
const bool result = fuzzed_data_provider.ConsumeBool();
|
||||
checks_1.emplace_back(result);
|
||||
checks_2.emplace_back(result);
|
||||
}
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
check_queue_1.Add(checks_1);
|
||||
}
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
(void)check_queue_1.Wait();
|
||||
}
|
||||
|
||||
CCheckQueueControl<DumbCheck> check_queue_control{&check_queue_2};
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
check_queue_control.Add(checks_2);
|
||||
}
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
(void)check_queue_control.Wait();
|
||||
}
|
||||
}
|
||||
283
src/test/fuzz/coins_view.cpp
Normal file
283
src/test/fuzz/coins_view.cpp
Normal file
|
|
@ -0,0 +1,283 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <amount.h>
|
||||
#include <chainparams.h>
|
||||
#include <chainparamsbase.h>
|
||||
#include <coins.h>
|
||||
#include <consensus/tx_check.h>
|
||||
#include <consensus/tx_verify.h>
|
||||
#include <consensus/validation.h>
|
||||
#include <key.h>
|
||||
#include <node/coinstats.h>
|
||||
#include <policy/policy.h>
|
||||
#include <primitives/transaction.h>
|
||||
#include <pubkey.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <validation.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
const TestingSetup* g_setup;
|
||||
const Coin EMPTY_COIN{};
|
||||
|
||||
bool operator==(const Coin& a, const Coin& b)
|
||||
{
|
||||
if (a.IsSpent() && b.IsSpent()) return true;
|
||||
return a.fCoinBase == b.fCoinBase && a.nHeight == b.nHeight && a.out == b.out;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void initialize_coins_view()
|
||||
{
|
||||
static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>();
|
||||
g_setup = testing_setup.get();
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(coins_view, initialize_coins_view)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
CCoinsView backend_coins_view;
|
||||
CCoinsViewCache coins_view_cache{&backend_coins_view};
|
||||
COutPoint random_out_point;
|
||||
Coin random_coin;
|
||||
CMutableTransaction random_mutable_transaction;
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
if (random_coin.IsSpent()) {
|
||||
return;
|
||||
}
|
||||
Coin coin = random_coin;
|
||||
bool expected_code_path = false;
|
||||
const bool possible_overwrite = fuzzed_data_provider.ConsumeBool();
|
||||
try {
|
||||
coins_view_cache.AddCoin(random_out_point, std::move(coin), possible_overwrite);
|
||||
expected_code_path = true;
|
||||
} catch (const std::logic_error& e) {
|
||||
if (e.what() == std::string{"Attempted to overwrite an unspent coin (when possible_overwrite is false)"}) {
|
||||
assert(!possible_overwrite);
|
||||
expected_code_path = true;
|
||||
}
|
||||
}
|
||||
assert(expected_code_path);
|
||||
},
|
||||
[&] {
|
||||
(void)coins_view_cache.Flush();
|
||||
},
|
||||
[&] {
|
||||
coins_view_cache.SetBestBlock(ConsumeUInt256(fuzzed_data_provider));
|
||||
},
|
||||
[&] {
|
||||
Coin move_to;
|
||||
(void)coins_view_cache.SpendCoin(random_out_point, fuzzed_data_provider.ConsumeBool() ? &move_to : nullptr);
|
||||
},
|
||||
[&] {
|
||||
coins_view_cache.Uncache(random_out_point);
|
||||
},
|
||||
[&] {
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
backend_coins_view = CCoinsView{};
|
||||
}
|
||||
coins_view_cache.SetBackend(backend_coins_view);
|
||||
},
|
||||
[&] {
|
||||
const std::optional<COutPoint> opt_out_point = ConsumeDeserializable<COutPoint>(fuzzed_data_provider);
|
||||
if (!opt_out_point) {
|
||||
return;
|
||||
}
|
||||
random_out_point = *opt_out_point;
|
||||
},
|
||||
[&] {
|
||||
const std::optional<Coin> opt_coin = ConsumeDeserializable<Coin>(fuzzed_data_provider);
|
||||
if (!opt_coin) {
|
||||
return;
|
||||
}
|
||||
random_coin = *opt_coin;
|
||||
},
|
||||
[&] {
|
||||
const std::optional<CMutableTransaction> opt_mutable_transaction = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider);
|
||||
if (!opt_mutable_transaction) {
|
||||
return;
|
||||
}
|
||||
random_mutable_transaction = *opt_mutable_transaction;
|
||||
},
|
||||
[&] {
|
||||
CCoinsMap coins_map;
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
CCoinsCacheEntry coins_cache_entry;
|
||||
coins_cache_entry.flags = fuzzed_data_provider.ConsumeIntegral<unsigned char>();
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
coins_cache_entry.coin = random_coin;
|
||||
} else {
|
||||
const std::optional<Coin> opt_coin = ConsumeDeserializable<Coin>(fuzzed_data_provider);
|
||||
if (!opt_coin) {
|
||||
return;
|
||||
}
|
||||
coins_cache_entry.coin = *opt_coin;
|
||||
}
|
||||
coins_map.emplace(random_out_point, std::move(coins_cache_entry));
|
||||
}
|
||||
bool expected_code_path = false;
|
||||
try {
|
||||
coins_view_cache.BatchWrite(coins_map, fuzzed_data_provider.ConsumeBool() ? ConsumeUInt256(fuzzed_data_provider) : coins_view_cache.GetBestBlock());
|
||||
expected_code_path = true;
|
||||
} catch (const std::logic_error& e) {
|
||||
if (e.what() == std::string{"FRESH flag misapplied to coin that exists in parent cache"}) {
|
||||
expected_code_path = true;
|
||||
}
|
||||
}
|
||||
assert(expected_code_path);
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
const Coin& coin_using_access_coin = coins_view_cache.AccessCoin(random_out_point);
|
||||
const bool exists_using_access_coin = !(coin_using_access_coin == EMPTY_COIN);
|
||||
const bool exists_using_have_coin = coins_view_cache.HaveCoin(random_out_point);
|
||||
const bool exists_using_have_coin_in_cache = coins_view_cache.HaveCoinInCache(random_out_point);
|
||||
Coin coin_using_get_coin;
|
||||
const bool exists_using_get_coin = coins_view_cache.GetCoin(random_out_point, coin_using_get_coin);
|
||||
if (exists_using_get_coin) {
|
||||
assert(coin_using_get_coin == coin_using_access_coin);
|
||||
}
|
||||
assert((exists_using_access_coin && exists_using_have_coin_in_cache && exists_using_have_coin && exists_using_get_coin) ||
|
||||
(!exists_using_access_coin && !exists_using_have_coin_in_cache && !exists_using_have_coin && !exists_using_get_coin));
|
||||
const bool exists_using_have_coin_in_backend = backend_coins_view.HaveCoin(random_out_point);
|
||||
if (exists_using_have_coin_in_backend) {
|
||||
assert(exists_using_have_coin);
|
||||
}
|
||||
Coin coin_using_backend_get_coin;
|
||||
if (backend_coins_view.GetCoin(random_out_point, coin_using_backend_get_coin)) {
|
||||
assert(exists_using_have_coin_in_backend);
|
||||
assert(coin_using_get_coin == coin_using_backend_get_coin);
|
||||
} else {
|
||||
assert(!exists_using_have_coin_in_backend);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
bool expected_code_path = false;
|
||||
try {
|
||||
(void)coins_view_cache.Cursor();
|
||||
} catch (const std::logic_error&) {
|
||||
expected_code_path = true;
|
||||
}
|
||||
assert(expected_code_path);
|
||||
(void)coins_view_cache.DynamicMemoryUsage();
|
||||
(void)coins_view_cache.EstimateSize();
|
||||
(void)coins_view_cache.GetBestBlock();
|
||||
(void)coins_view_cache.GetCacheSize();
|
||||
(void)coins_view_cache.GetHeadBlocks();
|
||||
(void)coins_view_cache.HaveInputs(CTransaction{random_mutable_transaction});
|
||||
}
|
||||
|
||||
{
|
||||
std::unique_ptr<CCoinsViewCursor> coins_view_cursor = backend_coins_view.Cursor();
|
||||
assert(!coins_view_cursor);
|
||||
(void)backend_coins_view.EstimateSize();
|
||||
(void)backend_coins_view.GetBestBlock();
|
||||
(void)backend_coins_view.GetHeadBlocks();
|
||||
}
|
||||
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
const CTransaction transaction{random_mutable_transaction};
|
||||
bool is_spent = false;
|
||||
for (const CTxOut& tx_out : transaction.vout) {
|
||||
if (Coin{tx_out, 0, transaction.IsCoinBase()}.IsSpent()) {
|
||||
is_spent = true;
|
||||
}
|
||||
}
|
||||
if (is_spent) {
|
||||
// Avoid:
|
||||
// coins.cpp:69: void CCoinsViewCache::AddCoin(const COutPoint &, Coin &&, bool): Assertion `!coin.IsSpent()' failed.
|
||||
return;
|
||||
}
|
||||
bool expected_code_path = false;
|
||||
const int height = fuzzed_data_provider.ConsumeIntegral<int>();
|
||||
const bool possible_overwrite = fuzzed_data_provider.ConsumeBool();
|
||||
try {
|
||||
AddCoins(coins_view_cache, transaction, height, possible_overwrite);
|
||||
expected_code_path = true;
|
||||
} catch (const std::logic_error& e) {
|
||||
if (e.what() == std::string{"Attempted to overwrite an unspent coin (when possible_overwrite is false)"}) {
|
||||
assert(!possible_overwrite);
|
||||
expected_code_path = true;
|
||||
}
|
||||
}
|
||||
assert(expected_code_path);
|
||||
},
|
||||
[&] {
|
||||
(void)AreInputsStandard(CTransaction{random_mutable_transaction}, coins_view_cache, false);
|
||||
(void)AreInputsStandard(CTransaction{random_mutable_transaction}, coins_view_cache, true);
|
||||
},
|
||||
[&] {
|
||||
TxValidationState state;
|
||||
CAmount tx_fee_out;
|
||||
const CTransaction transaction{random_mutable_transaction};
|
||||
if (ContainsSpentInput(transaction, coins_view_cache)) {
|
||||
// Avoid:
|
||||
// consensus/tx_verify.cpp:171: bool Consensus::CheckTxInputs(const CTransaction &, TxValidationState &, const CCoinsViewCache &, int, CAmount &): Assertion `!coin.IsSpent()' failed.
|
||||
return;
|
||||
}
|
||||
TxValidationState dummy;
|
||||
if (!CheckTransaction(transaction, dummy)) {
|
||||
// It is not allowed to call CheckTxInputs if CheckTransaction failed
|
||||
return;
|
||||
}
|
||||
if (Consensus::CheckTxInputs(transaction, state, coins_view_cache, fuzzed_data_provider.ConsumeIntegralInRange<int>(0, std::numeric_limits<int>::max()), tx_fee_out)) {
|
||||
assert(MoneyRange(tx_fee_out));
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
const CTransaction transaction{random_mutable_transaction};
|
||||
if (ContainsSpentInput(transaction, coins_view_cache)) {
|
||||
// Avoid:
|
||||
// consensus/tx_verify.cpp:130: unsigned int GetP2SHSigOpCount(const CTransaction &, const CCoinsViewCache &): Assertion `!coin.IsSpent()' failed.
|
||||
return;
|
||||
}
|
||||
(void)GetP2SHSigOpCount(transaction, coins_view_cache);
|
||||
},
|
||||
[&] {
|
||||
const CTransaction transaction{random_mutable_transaction};
|
||||
if (ContainsSpentInput(transaction, coins_view_cache)) {
|
||||
// Avoid:
|
||||
// consensus/tx_verify.cpp:130: unsigned int GetP2SHSigOpCount(const CTransaction &, const CCoinsViewCache &): Assertion `!coin.IsSpent()' failed.
|
||||
return;
|
||||
}
|
||||
const int flags = fuzzed_data_provider.ConsumeIntegral<int>();
|
||||
if (!transaction.vin.empty() && (flags & SCRIPT_VERIFY_WITNESS) != 0 && (flags & SCRIPT_VERIFY_P2SH) == 0) {
|
||||
// Avoid:
|
||||
// script/interpreter.cpp:1705: size_t CountWitnessSigOps(const CScript &, const CScript &, const CScriptWitness *, unsigned int): Assertion `(flags & SCRIPT_VERIFY_P2SH) != 0' failed.
|
||||
return;
|
||||
}
|
||||
(void)GetTransactionSigOpCost(transaction, coins_view_cache, flags);
|
||||
},
|
||||
[&] {
|
||||
CCoinsStats stats{CoinStatsHashType::HASH_SERIALIZED};
|
||||
bool expected_code_path = false;
|
||||
try {
|
||||
(void)GetUTXOStats(&coins_view_cache, WITH_LOCK(::cs_main, return std::ref(g_setup->m_node.chainman->m_blockman)), stats);
|
||||
} catch (const std::logic_error&) {
|
||||
expected_code_path = true;
|
||||
}
|
||||
assert(expected_code_path);
|
||||
},
|
||||
[&] {
|
||||
(void)IsWitnessStandard(CTransaction{random_mutable_transaction}, coins_view_cache);
|
||||
});
|
||||
}
|
||||
}
|
||||
134
src/test/fuzz/connman.cpp
Normal file
134
src/test/fuzz/connman.cpp
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <chainparams.h>
|
||||
#include <chainparamsbase.h>
|
||||
#include <net.h>
|
||||
#include <netaddress.h>
|
||||
#include <protocol.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <util/translation.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
void initialize_connman()
|
||||
{
|
||||
static const auto testing_setup = MakeNoLogFileContext<>();
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(connman, initialize_connman)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
SetMockTime(ConsumeTime(fuzzed_data_provider));
|
||||
CAddrMan addrman;
|
||||
CConnman connman{fuzzed_data_provider.ConsumeIntegral<uint64_t>(), fuzzed_data_provider.ConsumeIntegral<uint64_t>(), addrman, fuzzed_data_provider.ConsumeBool()};
|
||||
CNetAddr random_netaddr;
|
||||
CNode random_node = ConsumeNode(fuzzed_data_provider);
|
||||
CSubNet random_subnet;
|
||||
std::string random_string;
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
random_netaddr = ConsumeNetAddr(fuzzed_data_provider);
|
||||
},
|
||||
[&] {
|
||||
random_subnet = ConsumeSubNet(fuzzed_data_provider);
|
||||
},
|
||||
[&] {
|
||||
random_string = fuzzed_data_provider.ConsumeRandomLengthString(64);
|
||||
},
|
||||
[&] {
|
||||
connman.AddNode(random_string);
|
||||
},
|
||||
[&] {
|
||||
connman.CheckIncomingNonce(fuzzed_data_provider.ConsumeIntegral<uint64_t>());
|
||||
},
|
||||
[&] {
|
||||
connman.DisconnectNode(fuzzed_data_provider.ConsumeIntegral<NodeId>());
|
||||
},
|
||||
[&] {
|
||||
connman.DisconnectNode(random_netaddr);
|
||||
},
|
||||
[&] {
|
||||
connman.DisconnectNode(random_string);
|
||||
},
|
||||
[&] {
|
||||
connman.DisconnectNode(random_subnet);
|
||||
},
|
||||
[&] {
|
||||
connman.ForEachNode([](auto) {});
|
||||
},
|
||||
[&] {
|
||||
(void)connman.ForNode(fuzzed_data_provider.ConsumeIntegral<NodeId>(), [&](auto) { return fuzzed_data_provider.ConsumeBool(); });
|
||||
},
|
||||
[&] {
|
||||
(void)connman.GetAddresses(
|
||||
/* max_addresses */ fuzzed_data_provider.ConsumeIntegral<size_t>(),
|
||||
/* max_pct */ fuzzed_data_provider.ConsumeIntegral<size_t>(),
|
||||
/* network */ std::nullopt);
|
||||
},
|
||||
[&] {
|
||||
(void)connman.GetAddresses(
|
||||
/* requestor */ random_node,
|
||||
/* max_addresses */ fuzzed_data_provider.ConsumeIntegral<size_t>(),
|
||||
/* max_pct */ fuzzed_data_provider.ConsumeIntegral<size_t>());
|
||||
},
|
||||
[&] {
|
||||
(void)connman.GetDeterministicRandomizer(fuzzed_data_provider.ConsumeIntegral<uint64_t>());
|
||||
},
|
||||
[&] {
|
||||
(void)connman.GetNodeCount(fuzzed_data_provider.PickValueInArray({ConnectionDirection::None, ConnectionDirection::In, ConnectionDirection::Out, ConnectionDirection::Both}));
|
||||
},
|
||||
[&] {
|
||||
(void)connman.OutboundTargetReached(fuzzed_data_provider.ConsumeBool());
|
||||
},
|
||||
[&] {
|
||||
// Limit now to int32_t to avoid signed integer overflow
|
||||
(void)connman.PoissonNextSendInbound(
|
||||
std::chrono::microseconds{fuzzed_data_provider.ConsumeIntegral<int32_t>()},
|
||||
std::chrono::seconds{fuzzed_data_provider.ConsumeIntegral<int>()});
|
||||
},
|
||||
[&] {
|
||||
CSerializedNetMsg serialized_net_msg;
|
||||
serialized_net_msg.m_type = fuzzed_data_provider.ConsumeRandomLengthString(CMessageHeader::COMMAND_SIZE);
|
||||
serialized_net_msg.data = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
connman.PushMessage(&random_node, std::move(serialized_net_msg));
|
||||
},
|
||||
[&] {
|
||||
connman.RemoveAddedNode(random_string);
|
||||
},
|
||||
[&] {
|
||||
const std::vector<bool> asmap = ConsumeRandomLengthBitVector(fuzzed_data_provider);
|
||||
if (SanityCheckASMap(asmap)) {
|
||||
connman.SetAsmap(asmap);
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
connman.SetNetworkActive(fuzzed_data_provider.ConsumeBool());
|
||||
},
|
||||
[&] {
|
||||
connman.SetTryNewOutboundPeer(fuzzed_data_provider.ConsumeBool());
|
||||
});
|
||||
}
|
||||
(void)connman.GetAddedNodeInfo();
|
||||
(void)connman.GetExtraFullOutboundCount();
|
||||
(void)connman.GetLocalServices();
|
||||
(void)connman.GetMaxOutboundTarget();
|
||||
(void)connman.GetMaxOutboundTimeframe();
|
||||
(void)connman.GetMaxOutboundTimeLeftInCycle();
|
||||
(void)connman.GetNetworkActive();
|
||||
std::vector<CNodeStats> stats;
|
||||
connman.GetNodeStats(stats);
|
||||
(void)connman.GetOutboundTargetBytesLeft();
|
||||
(void)connman.GetReceiveFloodSize();
|
||||
(void)connman.GetTotalBytesRecv();
|
||||
(void)connman.GetTotalBytesSent();
|
||||
(void)connman.GetTryNewOutboundPeer();
|
||||
(void)connman.GetUseAddrmanOutgoing();
|
||||
}
|
||||
130
src/test/fuzz/crypto.cpp
Normal file
130
src/test/fuzz/crypto.cpp
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <crypto/hmac_sha256.h>
|
||||
#include <crypto/hmac_sha512.h>
|
||||
#include <crypto/ripemd160.h>
|
||||
#include <crypto/sha1.h>
|
||||
#include <crypto/sha256.h>
|
||||
#include <crypto/sha3.h>
|
||||
#include <crypto/sha512.h>
|
||||
#include <hash.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(crypto)
|
||||
{
|
||||
// Hashing is expensive with sanitizers enabled, so limit the number of
|
||||
// calls
|
||||
int limit_max_ops{30};
|
||||
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
std::vector<uint8_t> data = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
if (data.empty()) {
|
||||
data.resize(fuzzed_data_provider.ConsumeIntegralInRange<size_t>(1, 4096), fuzzed_data_provider.ConsumeIntegral<uint8_t>());
|
||||
}
|
||||
|
||||
CHash160 hash160;
|
||||
CHash256 hash256;
|
||||
CHMAC_SHA256 hmac_sha256{data.data(), data.size()};
|
||||
CHMAC_SHA512 hmac_sha512{data.data(), data.size()};
|
||||
CRIPEMD160 ripemd160;
|
||||
CSHA1 sha1;
|
||||
CSHA256 sha256;
|
||||
CSHA512 sha512;
|
||||
SHA3_256 sha3;
|
||||
CSipHasher sip_hasher{fuzzed_data_provider.ConsumeIntegral<uint64_t>(), fuzzed_data_provider.ConsumeIntegral<uint64_t>()};
|
||||
|
||||
while (--limit_max_ops >= 0 && fuzzed_data_provider.ConsumeBool()) {
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
data = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
if (data.empty()) {
|
||||
data.resize(fuzzed_data_provider.ConsumeIntegralInRange<size_t>(1, 4096), fuzzed_data_provider.ConsumeIntegral<uint8_t>());
|
||||
}
|
||||
}
|
||||
|
||||
(void)hash160.Write(data);
|
||||
(void)hash256.Write(data);
|
||||
(void)hmac_sha256.Write(data.data(), data.size());
|
||||
(void)hmac_sha512.Write(data.data(), data.size());
|
||||
(void)ripemd160.Write(data.data(), data.size());
|
||||
(void)sha1.Write(data.data(), data.size());
|
||||
(void)sha256.Write(data.data(), data.size());
|
||||
(void)sha3.Write(data);
|
||||
(void)sha512.Write(data.data(), data.size());
|
||||
(void)sip_hasher.Write(data.data(), data.size());
|
||||
|
||||
(void)Hash(data);
|
||||
(void)Hash160(data);
|
||||
(void)sha512.Size();
|
||||
},
|
||||
[&] {
|
||||
(void)hash160.Reset();
|
||||
(void)hash256.Reset();
|
||||
(void)ripemd160.Reset();
|
||||
(void)sha1.Reset();
|
||||
(void)sha256.Reset();
|
||||
(void)sha3.Reset();
|
||||
(void)sha512.Reset();
|
||||
},
|
||||
[&] {
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
data.resize(CHash160::OUTPUT_SIZE);
|
||||
hash160.Finalize(data);
|
||||
},
|
||||
[&] {
|
||||
data.resize(CHash256::OUTPUT_SIZE);
|
||||
hash256.Finalize(data);
|
||||
},
|
||||
[&] {
|
||||
data.resize(CHMAC_SHA256::OUTPUT_SIZE);
|
||||
hmac_sha256.Finalize(data.data());
|
||||
},
|
||||
[&] {
|
||||
data.resize(CHMAC_SHA512::OUTPUT_SIZE);
|
||||
hmac_sha512.Finalize(data.data());
|
||||
},
|
||||
[&] {
|
||||
data.resize(CRIPEMD160::OUTPUT_SIZE);
|
||||
ripemd160.Finalize(data.data());
|
||||
},
|
||||
[&] {
|
||||
data.resize(CSHA1::OUTPUT_SIZE);
|
||||
sha1.Finalize(data.data());
|
||||
},
|
||||
[&] {
|
||||
data.resize(CSHA256::OUTPUT_SIZE);
|
||||
sha256.Finalize(data.data());
|
||||
},
|
||||
[&] {
|
||||
data.resize(CSHA512::OUTPUT_SIZE);
|
||||
sha512.Finalize(data.data());
|
||||
},
|
||||
[&] {
|
||||
data.resize(1);
|
||||
data[0] = sip_hasher.Finalize() % 256;
|
||||
},
|
||||
[&] {
|
||||
data.resize(SHA3_256::OUTPUT_SIZE);
|
||||
sha3.Finalize(data);
|
||||
});
|
||||
});
|
||||
}
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
uint64_t state[25];
|
||||
for (size_t i = 0; i < 25; ++i) {
|
||||
state[i] = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
|
||||
}
|
||||
KeccakF(state);
|
||||
}
|
||||
}
|
||||
30
src/test/fuzz/crypto_aes256.cpp
Normal file
30
src/test/fuzz/crypto_aes256.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <crypto/aes.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(crypto_aes256)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
const std::vector<uint8_t> key = ConsumeFixedLengthByteVector(fuzzed_data_provider, AES256_KEYSIZE);
|
||||
|
||||
AES256Encrypt encrypt{key.data()};
|
||||
AES256Decrypt decrypt{key.data()};
|
||||
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
const std::vector<uint8_t> plaintext = ConsumeFixedLengthByteVector(fuzzed_data_provider, AES_BLOCKSIZE);
|
||||
std::vector<uint8_t> ciphertext(AES_BLOCKSIZE);
|
||||
encrypt.Encrypt(ciphertext.data(), plaintext.data());
|
||||
std::vector<uint8_t> decrypted_plaintext(AES_BLOCKSIZE);
|
||||
decrypt.Decrypt(decrypted_plaintext.data(), ciphertext.data());
|
||||
assert(decrypted_plaintext == plaintext);
|
||||
}
|
||||
}
|
||||
34
src/test/fuzz/crypto_aes256cbc.cpp
Normal file
34
src/test/fuzz/crypto_aes256cbc.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <crypto/aes.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(crypto_aes256cbc)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
const std::vector<uint8_t> key = ConsumeFixedLengthByteVector(fuzzed_data_provider, AES256_KEYSIZE);
|
||||
const std::vector<uint8_t> iv = ConsumeFixedLengthByteVector(fuzzed_data_provider, AES_BLOCKSIZE);
|
||||
const bool pad = fuzzed_data_provider.ConsumeBool();
|
||||
|
||||
AES256CBCEncrypt encrypt{key.data(), iv.data(), pad};
|
||||
AES256CBCDecrypt decrypt{key.data(), iv.data(), pad};
|
||||
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
const std::vector<uint8_t> plaintext = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
std::vector<uint8_t> ciphertext(plaintext.size() + AES_BLOCKSIZE);
|
||||
const int encrypt_ret = encrypt.Encrypt(plaintext.data(), plaintext.size(), ciphertext.data());
|
||||
ciphertext.resize(encrypt_ret);
|
||||
std::vector<uint8_t> decrypted_plaintext(ciphertext.size());
|
||||
const int decrypt_ret = decrypt.Decrypt(ciphertext.data(), ciphertext.size(), decrypted_plaintext.data());
|
||||
decrypted_plaintext.resize(decrypt_ret);
|
||||
assert(decrypted_plaintext == plaintext || (!pad && plaintext.size() % AES_BLOCKSIZE != 0 && encrypt_ret == 0 && decrypt_ret == 0));
|
||||
}
|
||||
}
|
||||
45
src/test/fuzz/crypto_chacha20.cpp
Normal file
45
src/test/fuzz/crypto_chacha20.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <crypto/chacha20.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(crypto_chacha20)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
|
||||
ChaCha20 chacha20;
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
const std::vector<unsigned char> key = ConsumeFixedLengthByteVector(fuzzed_data_provider, fuzzed_data_provider.ConsumeIntegralInRange<size_t>(16, 32));
|
||||
chacha20 = ChaCha20{key.data(), key.size()};
|
||||
}
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
const std::vector<unsigned char> key = ConsumeFixedLengthByteVector(fuzzed_data_provider, fuzzed_data_provider.ConsumeIntegralInRange<size_t>(16, 32));
|
||||
chacha20.SetKey(key.data(), key.size());
|
||||
},
|
||||
[&] {
|
||||
chacha20.SetIV(fuzzed_data_provider.ConsumeIntegral<uint64_t>());
|
||||
},
|
||||
[&] {
|
||||
chacha20.Seek(fuzzed_data_provider.ConsumeIntegral<uint64_t>());
|
||||
},
|
||||
[&] {
|
||||
std::vector<uint8_t> output(fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096));
|
||||
chacha20.Keystream(output.data(), output.size());
|
||||
},
|
||||
[&] {
|
||||
std::vector<uint8_t> output(fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096));
|
||||
const std::vector<uint8_t> input = ConsumeFixedLengthByteVector(fuzzed_data_provider, output.size());
|
||||
chacha20.Crypt(input.data(), output.data(), input.size());
|
||||
});
|
||||
}
|
||||
}
|
||||
71
src/test/fuzz/crypto_chacha20_poly1305_aead.cpp
Normal file
71
src/test/fuzz/crypto_chacha20_poly1305_aead.cpp
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <crypto/chacha_poly_aead.h>
|
||||
#include <crypto/poly1305.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(crypto_chacha20_poly1305_aead)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
|
||||
const std::vector<uint8_t> k1 = ConsumeFixedLengthByteVector(fuzzed_data_provider, CHACHA20_POLY1305_AEAD_KEY_LEN);
|
||||
const std::vector<uint8_t> k2 = ConsumeFixedLengthByteVector(fuzzed_data_provider, CHACHA20_POLY1305_AEAD_KEY_LEN);
|
||||
|
||||
ChaCha20Poly1305AEAD aead(k1.data(), k1.size(), k2.data(), k2.size());
|
||||
uint64_t seqnr_payload = 0;
|
||||
uint64_t seqnr_aad = 0;
|
||||
int aad_pos = 0;
|
||||
size_t buffer_size = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096);
|
||||
std::vector<uint8_t> in(buffer_size + CHACHA20_POLY1305_AEAD_AAD_LEN + POLY1305_TAGLEN, 0);
|
||||
std::vector<uint8_t> out(buffer_size + CHACHA20_POLY1305_AEAD_AAD_LEN + POLY1305_TAGLEN, 0);
|
||||
bool is_encrypt = fuzzed_data_provider.ConsumeBool();
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
buffer_size = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(64, 4096);
|
||||
in = std::vector<uint8_t>(buffer_size + CHACHA20_POLY1305_AEAD_AAD_LEN + POLY1305_TAGLEN, 0);
|
||||
out = std::vector<uint8_t>(buffer_size + CHACHA20_POLY1305_AEAD_AAD_LEN + POLY1305_TAGLEN, 0);
|
||||
},
|
||||
[&] {
|
||||
(void)aead.Crypt(seqnr_payload, seqnr_aad, aad_pos, out.data(), out.size(), in.data(), buffer_size, is_encrypt);
|
||||
},
|
||||
[&] {
|
||||
uint32_t len = 0;
|
||||
const bool ok = aead.GetLength(&len, seqnr_aad, aad_pos, in.data());
|
||||
assert(ok);
|
||||
},
|
||||
[&] {
|
||||
if (AdditionOverflow(seqnr_payload, static_cast<uint64_t>(1))) {
|
||||
return;
|
||||
}
|
||||
seqnr_payload += 1;
|
||||
aad_pos += CHACHA20_POLY1305_AEAD_AAD_LEN;
|
||||
if (aad_pos + CHACHA20_POLY1305_AEAD_AAD_LEN > CHACHA20_ROUND_OUTPUT) {
|
||||
aad_pos = 0;
|
||||
if (AdditionOverflow(seqnr_aad, static_cast<uint64_t>(1))) {
|
||||
return;
|
||||
}
|
||||
seqnr_aad += 1;
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
seqnr_payload = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
|
||||
},
|
||||
[&] {
|
||||
seqnr_aad = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
|
||||
},
|
||||
[&] {
|
||||
is_encrypt = fuzzed_data_provider.ConsumeBool();
|
||||
});
|
||||
}
|
||||
}
|
||||
70
src/test/fuzz/crypto_common.cpp
Normal file
70
src/test/fuzz/crypto_common.cpp
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <crypto/common.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(crypto_common)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
const uint16_t random_u16 = fuzzed_data_provider.ConsumeIntegral<uint16_t>();
|
||||
const uint32_t random_u32 = fuzzed_data_provider.ConsumeIntegral<uint32_t>();
|
||||
const uint64_t random_u64 = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
|
||||
const std::vector<uint8_t> random_bytes_2 = ConsumeFixedLengthByteVector(fuzzed_data_provider, 2);
|
||||
const std::vector<uint8_t> random_bytes_4 = ConsumeFixedLengthByteVector(fuzzed_data_provider, 4);
|
||||
const std::vector<uint8_t> random_bytes_8 = ConsumeFixedLengthByteVector(fuzzed_data_provider, 8);
|
||||
|
||||
std::array<uint8_t, 2> writele16_arr;
|
||||
WriteLE16(writele16_arr.data(), random_u16);
|
||||
assert(ReadLE16(writele16_arr.data()) == random_u16);
|
||||
|
||||
std::array<uint8_t, 4> writele32_arr;
|
||||
WriteLE32(writele32_arr.data(), random_u32);
|
||||
assert(ReadLE32(writele32_arr.data()) == random_u32);
|
||||
|
||||
std::array<uint8_t, 8> writele64_arr;
|
||||
WriteLE64(writele64_arr.data(), random_u64);
|
||||
assert(ReadLE64(writele64_arr.data()) == random_u64);
|
||||
|
||||
std::array<uint8_t, 4> writebe32_arr;
|
||||
WriteBE32(writebe32_arr.data(), random_u32);
|
||||
assert(ReadBE32(writebe32_arr.data()) == random_u32);
|
||||
|
||||
std::array<uint8_t, 8> writebe64_arr;
|
||||
WriteBE64(writebe64_arr.data(), random_u64);
|
||||
assert(ReadBE64(writebe64_arr.data()) == random_u64);
|
||||
|
||||
const uint16_t readle16_result = ReadLE16(random_bytes_2.data());
|
||||
std::array<uint8_t, 2> readle16_arr;
|
||||
WriteLE16(readle16_arr.data(), readle16_result);
|
||||
assert(std::memcmp(random_bytes_2.data(), readle16_arr.data(), 2) == 0);
|
||||
|
||||
const uint32_t readle32_result = ReadLE32(random_bytes_4.data());
|
||||
std::array<uint8_t, 4> readle32_arr;
|
||||
WriteLE32(readle32_arr.data(), readle32_result);
|
||||
assert(std::memcmp(random_bytes_4.data(), readle32_arr.data(), 4) == 0);
|
||||
|
||||
const uint64_t readle64_result = ReadLE64(random_bytes_8.data());
|
||||
std::array<uint8_t, 8> readle64_arr;
|
||||
WriteLE64(readle64_arr.data(), readle64_result);
|
||||
assert(std::memcmp(random_bytes_8.data(), readle64_arr.data(), 8) == 0);
|
||||
|
||||
const uint32_t readbe32_result = ReadBE32(random_bytes_4.data());
|
||||
std::array<uint8_t, 4> readbe32_arr;
|
||||
WriteBE32(readbe32_arr.data(), readbe32_result);
|
||||
assert(std::memcmp(random_bytes_4.data(), readbe32_arr.data(), 4) == 0);
|
||||
|
||||
const uint64_t readbe64_result = ReadBE64(random_bytes_8.data());
|
||||
std::array<uint8_t, 8> readbe64_arr;
|
||||
WriteBE64(readbe64_arr.data(), readbe64_result);
|
||||
assert(std::memcmp(random_bytes_8.data(), readbe64_arr.data(), 8) == 0);
|
||||
}
|
||||
25
src/test/fuzz/crypto_hkdf_hmac_sha256_l32.cpp
Normal file
25
src/test/fuzz/crypto_hkdf_hmac_sha256_l32.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <crypto/hkdf_sha256_32.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(crypto_hkdf_hmac_sha256_l32)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
|
||||
const std::vector<uint8_t> initial_key_material = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
|
||||
CHKDF_HMAC_SHA256_L32 hkdf_hmac_sha256_l32(initial_key_material.data(), initial_key_material.size(), fuzzed_data_provider.ConsumeRandomLengthString(1024));
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
std::vector<uint8_t> out(32);
|
||||
hkdf_hmac_sha256_l32.Expand32(fuzzed_data_provider.ConsumeRandomLengthString(128), out.data());
|
||||
}
|
||||
}
|
||||
22
src/test/fuzz/crypto_poly1305.cpp
Normal file
22
src/test/fuzz/crypto_poly1305.cpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <crypto/poly1305.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(crypto_poly1305)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
|
||||
const std::vector<uint8_t> key = ConsumeFixedLengthByteVector(fuzzed_data_provider, POLY1305_KEYLEN);
|
||||
const std::vector<uint8_t> in = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
|
||||
std::vector<uint8_t> tag_out(POLY1305_TAGLEN);
|
||||
poly1305_auth(tag_out.data(), in.data(), in.size(), key.data());
|
||||
}
|
||||
48
src/test/fuzz/cuckoocache.cpp
Normal file
48
src/test/fuzz/cuckoocache.cpp
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <cuckoocache.h>
|
||||
#include <script/sigcache.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <test/util/setup_common.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
FuzzedDataProvider* fuzzed_data_provider_ptr = nullptr;
|
||||
|
||||
struct RandomHasher {
|
||||
template <uint8_t>
|
||||
uint32_t operator()(const bool& /* unused */) const
|
||||
{
|
||||
assert(fuzzed_data_provider_ptr != nullptr);
|
||||
return fuzzed_data_provider_ptr->ConsumeIntegral<uint32_t>();
|
||||
}
|
||||
};
|
||||
} // namespace
|
||||
|
||||
FUZZ_TARGET(cuckoocache)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
fuzzed_data_provider_ptr = &fuzzed_data_provider;
|
||||
CuckooCache::cache<int, RandomHasher> cuckoo_cache{};
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
const size_t megabytes = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 16);
|
||||
cuckoo_cache.setup_bytes(megabytes << 20);
|
||||
} else {
|
||||
cuckoo_cache.setup(fuzzed_data_provider.ConsumeIntegralInRange<uint32_t>(0, 4096));
|
||||
}
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
cuckoo_cache.insert(fuzzed_data_provider.ConsumeBool());
|
||||
} else {
|
||||
cuckoo_cache.contains(fuzzed_data_provider.ConsumeBool(), fuzzed_data_provider.ConsumeBool());
|
||||
}
|
||||
}
|
||||
fuzzed_data_provider_ptr = nullptr;
|
||||
}
|
||||
26
src/test/fuzz/data_stream.cpp
Normal file
26
src/test/fuzz/data_stream.cpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <addrman.h>
|
||||
#include <net.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <test/util/setup_common.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
void initialize_data_stream_addr_man()
|
||||
{
|
||||
static const auto testing_setup = MakeNoLogFileContext<>();
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(data_stream_addr_man, initialize_data_stream_addr_man)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
CDataStream data_stream = ConsumeDataStream(fuzzed_data_provider);
|
||||
CAddrMan addr_man;
|
||||
CAddrDB::Read(addr_man, data_stream);
|
||||
}
|
||||
32
src/test/fuzz/decode_tx.cpp
Normal file
32
src/test/fuzz/decode_tx.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright (c) 2019-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <core_io.h>
|
||||
#include <primitives/transaction.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(decode_tx)
|
||||
{
|
||||
const std::string tx_hex = HexStr(buffer);
|
||||
CMutableTransaction mtx;
|
||||
const bool result_none = DecodeHexTx(mtx, tx_hex, false, false);
|
||||
const bool result_try_witness = DecodeHexTx(mtx, tx_hex, false, true);
|
||||
const bool result_try_witness_and_maybe_no_witness = DecodeHexTx(mtx, tx_hex, true, true);
|
||||
CMutableTransaction no_witness_mtx;
|
||||
const bool result_try_no_witness = DecodeHexTx(no_witness_mtx, tx_hex, true, false);
|
||||
assert(!result_none);
|
||||
if (result_try_witness_and_maybe_no_witness) {
|
||||
assert(result_try_no_witness || result_try_witness);
|
||||
}
|
||||
if (result_try_no_witness) {
|
||||
assert(!no_witness_mtx.HasWitness());
|
||||
assert(result_try_witness_and_maybe_no_witness);
|
||||
}
|
||||
}
|
||||
30
src/test/fuzz/descriptor_parse.cpp
Normal file
30
src/test/fuzz/descriptor_parse.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (c) 2009-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <chainparams.h>
|
||||
#include <pubkey.h>
|
||||
#include <script/descriptor.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
|
||||
void initialize_descriptor_parse()
|
||||
{
|
||||
static const ECCVerifyHandle verify_handle;
|
||||
ECC_Start();
|
||||
SelectParams(CBaseChainParams::MAIN);
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(descriptor_parse, initialize_descriptor_parse)
|
||||
{
|
||||
const std::string descriptor(buffer.begin(), buffer.end());
|
||||
FlatSigningProvider signing_provider;
|
||||
std::string error;
|
||||
for (const bool require_checksum : {true, false}) {
|
||||
const auto desc = Parse(descriptor, signing_provider, error, require_checksum);
|
||||
if (desc) {
|
||||
(void)desc->ToString();
|
||||
(void)desc->IsRange();
|
||||
(void)desc->IsSolvable();
|
||||
}
|
||||
}
|
||||
}
|
||||
327
src/test/fuzz/deserialize.cpp
Normal file
327
src/test/fuzz/deserialize.cpp
Normal file
|
|
@ -0,0 +1,327 @@
|
|||
// Copyright (c) 2009-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <addrdb.h>
|
||||
#include <addrman.h>
|
||||
#include <blockencodings.h>
|
||||
#include <blockfilter.h>
|
||||
#include <chain.h>
|
||||
#include <coins.h>
|
||||
#include <compressor.h>
|
||||
#include <consensus/merkle.h>
|
||||
#include <key.h>
|
||||
#include <merkleblock.h>
|
||||
#include <net.h>
|
||||
#include <netbase.h>
|
||||
#include <node/utxo_snapshot.h>
|
||||
#include <primitives/block.h>
|
||||
#include <protocol.h>
|
||||
#include <psbt.h>
|
||||
#include <pubkey.h>
|
||||
#include <script/keyorigin.h>
|
||||
#include <streams.h>
|
||||
#include <undo.h>
|
||||
#include <version.h>
|
||||
|
||||
#include <exception>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <test/fuzz/fuzz.h>
|
||||
|
||||
void initialize_deserialize()
|
||||
{
|
||||
// Fuzzers using pubkey must hold an ECCVerifyHandle.
|
||||
static const ECCVerifyHandle verify_handle;
|
||||
}
|
||||
|
||||
#define FUZZ_TARGET_DESERIALIZE(name, code) \
|
||||
FUZZ_TARGET_INIT(name, initialize_deserialize) \
|
||||
{ \
|
||||
try { \
|
||||
code \
|
||||
} catch (const invalid_fuzzing_input_exception&) { \
|
||||
} \
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
struct invalid_fuzzing_input_exception : public std::exception {
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
CDataStream Serialize(const T& obj, const int version = INIT_PROTO_VERSION, const int ser_type = SER_NETWORK)
|
||||
{
|
||||
CDataStream ds(ser_type, version);
|
||||
ds << obj;
|
||||
return ds;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T Deserialize(CDataStream ds)
|
||||
{
|
||||
T obj;
|
||||
ds >> obj;
|
||||
return obj;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void DeserializeFromFuzzingInput(FuzzBufferType buffer, T& obj, const std::optional<int> protocol_version = std::nullopt, const int ser_type = SER_NETWORK)
|
||||
{
|
||||
CDataStream ds(buffer, ser_type, INIT_PROTO_VERSION);
|
||||
if (protocol_version) {
|
||||
ds.SetVersion(*protocol_version);
|
||||
} else {
|
||||
try {
|
||||
int version;
|
||||
ds >> version;
|
||||
ds.SetVersion(version);
|
||||
} catch (const std::ios_base::failure&) {
|
||||
throw invalid_fuzzing_input_exception();
|
||||
}
|
||||
}
|
||||
try {
|
||||
ds >> obj;
|
||||
} catch (const std::ios_base::failure&) {
|
||||
throw invalid_fuzzing_input_exception();
|
||||
}
|
||||
assert(buffer.empty() || !Serialize(obj).empty());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void AssertEqualAfterSerializeDeserialize(const T& obj, const int version = INIT_PROTO_VERSION, const int ser_type = SER_NETWORK)
|
||||
{
|
||||
assert(Deserialize<T>(Serialize(obj, version, ser_type)) == obj);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
FUZZ_TARGET_DESERIALIZE(block_filter_deserialize, {
|
||||
BlockFilter block_filter;
|
||||
DeserializeFromFuzzingInput(buffer, block_filter);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(addr_info_deserialize, {
|
||||
CAddrInfo addr_info;
|
||||
DeserializeFromFuzzingInput(buffer, addr_info);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(block_file_info_deserialize, {
|
||||
CBlockFileInfo block_file_info;
|
||||
DeserializeFromFuzzingInput(buffer, block_file_info);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(block_header_and_short_txids_deserialize, {
|
||||
CBlockHeaderAndShortTxIDs block_header_and_short_txids;
|
||||
DeserializeFromFuzzingInput(buffer, block_header_and_short_txids);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(fee_rate_deserialize, {
|
||||
CFeeRate fee_rate;
|
||||
DeserializeFromFuzzingInput(buffer, fee_rate);
|
||||
AssertEqualAfterSerializeDeserialize(fee_rate);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(merkle_block_deserialize, {
|
||||
CMerkleBlock merkle_block;
|
||||
DeserializeFromFuzzingInput(buffer, merkle_block);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(out_point_deserialize, {
|
||||
COutPoint out_point;
|
||||
DeserializeFromFuzzingInput(buffer, out_point);
|
||||
AssertEqualAfterSerializeDeserialize(out_point);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(partial_merkle_tree_deserialize, {
|
||||
CPartialMerkleTree partial_merkle_tree;
|
||||
DeserializeFromFuzzingInput(buffer, partial_merkle_tree);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(pub_key_deserialize, {
|
||||
CPubKey pub_key;
|
||||
DeserializeFromFuzzingInput(buffer, pub_key);
|
||||
AssertEqualAfterSerializeDeserialize(pub_key);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(script_deserialize, {
|
||||
CScript script;
|
||||
DeserializeFromFuzzingInput(buffer, script);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(sub_net_deserialize, {
|
||||
CSubNet sub_net_1;
|
||||
DeserializeFromFuzzingInput(buffer, sub_net_1, INIT_PROTO_VERSION);
|
||||
AssertEqualAfterSerializeDeserialize(sub_net_1, INIT_PROTO_VERSION);
|
||||
CSubNet sub_net_2;
|
||||
DeserializeFromFuzzingInput(buffer, sub_net_2, INIT_PROTO_VERSION | ADDRV2_FORMAT);
|
||||
AssertEqualAfterSerializeDeserialize(sub_net_2, INIT_PROTO_VERSION | ADDRV2_FORMAT);
|
||||
CSubNet sub_net_3;
|
||||
DeserializeFromFuzzingInput(buffer, sub_net_3);
|
||||
AssertEqualAfterSerializeDeserialize(sub_net_3, INIT_PROTO_VERSION | ADDRV2_FORMAT);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(tx_in_deserialize, {
|
||||
CTxIn tx_in;
|
||||
DeserializeFromFuzzingInput(buffer, tx_in);
|
||||
AssertEqualAfterSerializeDeserialize(tx_in);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(flat_file_pos_deserialize, {
|
||||
FlatFilePos flat_file_pos;
|
||||
DeserializeFromFuzzingInput(buffer, flat_file_pos);
|
||||
AssertEqualAfterSerializeDeserialize(flat_file_pos);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(key_origin_info_deserialize, {
|
||||
KeyOriginInfo key_origin_info;
|
||||
DeserializeFromFuzzingInput(buffer, key_origin_info);
|
||||
AssertEqualAfterSerializeDeserialize(key_origin_info);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(partially_signed_transaction_deserialize, {
|
||||
PartiallySignedTransaction partially_signed_transaction;
|
||||
DeserializeFromFuzzingInput(buffer, partially_signed_transaction);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(prefilled_transaction_deserialize, {
|
||||
PrefilledTransaction prefilled_transaction;
|
||||
DeserializeFromFuzzingInput(buffer, prefilled_transaction);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(psbt_input_deserialize, {
|
||||
PSBTInput psbt_input;
|
||||
DeserializeFromFuzzingInput(buffer, psbt_input);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(psbt_output_deserialize, {
|
||||
PSBTOutput psbt_output;
|
||||
DeserializeFromFuzzingInput(buffer, psbt_output);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(block_deserialize, {
|
||||
CBlock block;
|
||||
DeserializeFromFuzzingInput(buffer, block);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(blocklocator_deserialize, {
|
||||
CBlockLocator bl;
|
||||
DeserializeFromFuzzingInput(buffer, bl);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(blockmerkleroot, {
|
||||
CBlock block;
|
||||
DeserializeFromFuzzingInput(buffer, block);
|
||||
bool mutated;
|
||||
BlockMerkleRoot(block, &mutated);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(addrman_deserialize, {
|
||||
CAddrMan am;
|
||||
DeserializeFromFuzzingInput(buffer, am);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(blockheader_deserialize, {
|
||||
CBlockHeader bh;
|
||||
DeserializeFromFuzzingInput(buffer, bh);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(banentry_deserialize, {
|
||||
CBanEntry be;
|
||||
DeserializeFromFuzzingInput(buffer, be);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(txundo_deserialize, {
|
||||
CTxUndo tu;
|
||||
DeserializeFromFuzzingInput(buffer, tu);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(blockundo_deserialize, {
|
||||
CBlockUndo bu;
|
||||
DeserializeFromFuzzingInput(buffer, bu);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(coins_deserialize, {
|
||||
Coin coin;
|
||||
DeserializeFromFuzzingInput(buffer, coin);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(netaddr_deserialize, {
|
||||
CNetAddr na;
|
||||
DeserializeFromFuzzingInput(buffer, na);
|
||||
if (na.IsAddrV1Compatible()) {
|
||||
AssertEqualAfterSerializeDeserialize(na);
|
||||
}
|
||||
AssertEqualAfterSerializeDeserialize(na, INIT_PROTO_VERSION | ADDRV2_FORMAT);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(service_deserialize, {
|
||||
CService s;
|
||||
DeserializeFromFuzzingInput(buffer, s);
|
||||
if (s.IsAddrV1Compatible()) {
|
||||
AssertEqualAfterSerializeDeserialize(s);
|
||||
}
|
||||
AssertEqualAfterSerializeDeserialize(s, INIT_PROTO_VERSION | ADDRV2_FORMAT);
|
||||
CService s1;
|
||||
DeserializeFromFuzzingInput(buffer, s1, INIT_PROTO_VERSION);
|
||||
AssertEqualAfterSerializeDeserialize(s1, INIT_PROTO_VERSION);
|
||||
assert(s1.IsAddrV1Compatible());
|
||||
CService s2;
|
||||
DeserializeFromFuzzingInput(buffer, s2, INIT_PROTO_VERSION | ADDRV2_FORMAT);
|
||||
AssertEqualAfterSerializeDeserialize(s2, INIT_PROTO_VERSION | ADDRV2_FORMAT);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(messageheader_deserialize, {
|
||||
CMessageHeader mh;
|
||||
DeserializeFromFuzzingInput(buffer, mh);
|
||||
(void)mh.IsCommandValid();
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(address_deserialize_v1_notime, {
|
||||
CAddress a;
|
||||
DeserializeFromFuzzingInput(buffer, a, INIT_PROTO_VERSION);
|
||||
// A CAddress without nTime (as is expected under INIT_PROTO_VERSION) will roundtrip
|
||||
// in all 5 formats (with/without nTime, v1/v2, network/disk)
|
||||
AssertEqualAfterSerializeDeserialize(a, INIT_PROTO_VERSION);
|
||||
AssertEqualAfterSerializeDeserialize(a, PROTOCOL_VERSION);
|
||||
AssertEqualAfterSerializeDeserialize(a, 0, SER_DISK);
|
||||
AssertEqualAfterSerializeDeserialize(a, PROTOCOL_VERSION | ADDRV2_FORMAT);
|
||||
AssertEqualAfterSerializeDeserialize(a, ADDRV2_FORMAT, SER_DISK);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(address_deserialize_v1_withtime, {
|
||||
CAddress a;
|
||||
DeserializeFromFuzzingInput(buffer, a, PROTOCOL_VERSION);
|
||||
// A CAddress in V1 mode will roundtrip in all 4 formats that have nTime.
|
||||
AssertEqualAfterSerializeDeserialize(a, PROTOCOL_VERSION);
|
||||
AssertEqualAfterSerializeDeserialize(a, 0, SER_DISK);
|
||||
AssertEqualAfterSerializeDeserialize(a, PROTOCOL_VERSION | ADDRV2_FORMAT);
|
||||
AssertEqualAfterSerializeDeserialize(a, ADDRV2_FORMAT, SER_DISK);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(address_deserialize_v2, {
|
||||
CAddress a;
|
||||
DeserializeFromFuzzingInput(buffer, a, PROTOCOL_VERSION | ADDRV2_FORMAT);
|
||||
// A CAddress in V2 mode will roundtrip in both V2 formats, and also in the V1 formats
|
||||
// with time if it's V1 compatible.
|
||||
if (a.IsAddrV1Compatible()) {
|
||||
AssertEqualAfterSerializeDeserialize(a, PROTOCOL_VERSION);
|
||||
AssertEqualAfterSerializeDeserialize(a, 0, SER_DISK);
|
||||
}
|
||||
AssertEqualAfterSerializeDeserialize(a, PROTOCOL_VERSION | ADDRV2_FORMAT);
|
||||
AssertEqualAfterSerializeDeserialize(a, ADDRV2_FORMAT, SER_DISK);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(inv_deserialize, {
|
||||
CInv i;
|
||||
DeserializeFromFuzzingInput(buffer, i);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(bloomfilter_deserialize, {
|
||||
CBloomFilter bf;
|
||||
DeserializeFromFuzzingInput(buffer, bf);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(diskblockindex_deserialize, {
|
||||
CDiskBlockIndex dbi;
|
||||
DeserializeFromFuzzingInput(buffer, dbi);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(txoutcompressor_deserialize, {
|
||||
CTxOut to;
|
||||
auto toc = Using<TxOutCompression>(to);
|
||||
DeserializeFromFuzzingInput(buffer, toc);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(blocktransactions_deserialize, {
|
||||
BlockTransactions bt;
|
||||
DeserializeFromFuzzingInput(buffer, bt);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(blocktransactionsrequest_deserialize, {
|
||||
BlockTransactionsRequest btr;
|
||||
DeserializeFromFuzzingInput(buffer, btr);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(snapshotmetadata_deserialize, {
|
||||
SnapshotMetadata snapshot_metadata;
|
||||
DeserializeFromFuzzingInput(buffer, snapshot_metadata);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(uint160_deserialize, {
|
||||
uint160 u160;
|
||||
DeserializeFromFuzzingInput(buffer, u160);
|
||||
AssertEqualAfterSerializeDeserialize(u160);
|
||||
})
|
||||
FUZZ_TARGET_DESERIALIZE(uint256_deserialize, {
|
||||
uint256 u256;
|
||||
DeserializeFromFuzzingInput(buffer, u256);
|
||||
AssertEqualAfterSerializeDeserialize(u256);
|
||||
})
|
||||
// Classes intentionally not covered in this file since their deserialization code is
|
||||
// fuzzed elsewhere:
|
||||
// * Deserialization of CTxOut is fuzzed in test/fuzz/tx_out.cpp
|
||||
// * Deserialization of CMutableTransaction is fuzzed in src/test/fuzz/transaction.cpp
|
||||
36
src/test/fuzz/eval_script.cpp
Normal file
36
src/test/fuzz/eval_script.cpp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
// Copyright (c) 2009-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <pubkey.h>
|
||||
#include <script/interpreter.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
|
||||
#include <limits>
|
||||
|
||||
void initialize_eval_script()
|
||||
{
|
||||
static const ECCVerifyHandle verify_handle;
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(eval_script, initialize_eval_script)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
const unsigned int flags = fuzzed_data_provider.ConsumeIntegral<unsigned int>();
|
||||
const std::vector<uint8_t> script_bytes = [&] {
|
||||
if (fuzzed_data_provider.remaining_bytes() != 0) {
|
||||
return fuzzed_data_provider.ConsumeRemainingBytes<uint8_t>();
|
||||
} else {
|
||||
// Avoid UBSan warning:
|
||||
// test/fuzz/FuzzedDataProvider.h:212:17: runtime error: null pointer passed as argument 1, which is declared to never be null
|
||||
// /usr/include/string.h:43:28: note: nonnull attribute specified here
|
||||
return std::vector<uint8_t>();
|
||||
}
|
||||
}();
|
||||
const CScript script(script_bytes.begin(), script_bytes.end());
|
||||
for (const auto sig_version : {SigVersion::BASE, SigVersion::WITNESS_V0}) {
|
||||
std::vector<std::vector<unsigned char>> stack;
|
||||
(void)EvalScript(stack, script, flags, BaseSignatureChecker(), sig_version, nullptr);
|
||||
}
|
||||
}
|
||||
40
src/test/fuzz/fee_rate.cpp
Normal file
40
src/test/fuzz/fee_rate.cpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <amount.h>
|
||||
#include <policy/feerate.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(fee_rate)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
const CAmount satoshis_per_k = ConsumeMoney(fuzzed_data_provider);
|
||||
const CFeeRate fee_rate{satoshis_per_k};
|
||||
|
||||
(void)fee_rate.GetFeePerK();
|
||||
const auto bytes = fuzzed_data_provider.ConsumeIntegral<uint32_t>();
|
||||
if (!MultiplicationOverflow(int64_t{bytes}, satoshis_per_k)) {
|
||||
(void)fee_rate.GetFee(bytes);
|
||||
}
|
||||
(void)fee_rate.ToString();
|
||||
|
||||
const CAmount another_satoshis_per_k = ConsumeMoney(fuzzed_data_provider);
|
||||
CFeeRate larger_fee_rate{another_satoshis_per_k};
|
||||
larger_fee_rate += fee_rate;
|
||||
if (satoshis_per_k != 0 && another_satoshis_per_k != 0) {
|
||||
assert(fee_rate < larger_fee_rate);
|
||||
assert(!(fee_rate > larger_fee_rate));
|
||||
assert(!(fee_rate == larger_fee_rate));
|
||||
assert(fee_rate <= larger_fee_rate);
|
||||
assert(!(fee_rate >= larger_fee_rate));
|
||||
assert(fee_rate != larger_fee_rate);
|
||||
}
|
||||
}
|
||||
28
src/test/fuzz/fees.cpp
Normal file
28
src/test/fuzz/fees.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <amount.h>
|
||||
#include <policy/fees.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <util/fees.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(fees)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
const CFeeRate minimal_incremental_fee{ConsumeMoney(fuzzed_data_provider)};
|
||||
FeeFilterRounder fee_filter_rounder{minimal_incremental_fee};
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
const CAmount current_minimum_fee = ConsumeMoney(fuzzed_data_provider);
|
||||
const CAmount rounded_fee = fee_filter_rounder.round(current_minimum_fee);
|
||||
assert(MoneyRange(rounded_fee));
|
||||
}
|
||||
const FeeReason fee_reason = fuzzed_data_provider.PickValueInArray({FeeReason::NONE, FeeReason::HALF_ESTIMATE, FeeReason::FULL_ESTIMATE, FeeReason::DOUBLE_ESTIMATE, FeeReason::CONSERVATIVE, FeeReason::MEMPOOL_MIN, FeeReason::PAYTXFEE, FeeReason::FALLBACK, FeeReason::REQUIRED});
|
||||
(void)StringForFeeReason(fee_reason);
|
||||
}
|
||||
30
src/test/fuzz/flatfile.cpp
Normal file
30
src/test/fuzz/flatfile.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <flatfile.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(flatfile)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
std::optional<FlatFilePos> flat_file_pos = ConsumeDeserializable<FlatFilePos>(fuzzed_data_provider);
|
||||
if (!flat_file_pos) {
|
||||
return;
|
||||
}
|
||||
std::optional<FlatFilePos> another_flat_file_pos = ConsumeDeserializable<FlatFilePos>(fuzzed_data_provider);
|
||||
if (another_flat_file_pos) {
|
||||
assert((*flat_file_pos == *another_flat_file_pos) != (*flat_file_pos != *another_flat_file_pos));
|
||||
}
|
||||
(void)flat_file_pos->ToString();
|
||||
flat_file_pos->SetNull();
|
||||
assert(flat_file_pos->IsNull());
|
||||
}
|
||||
62
src/test/fuzz/float.cpp
Normal file
62
src/test/fuzz/float.cpp
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <memusage.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <util/serfloat.h>
|
||||
#include <version.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
|
||||
FUZZ_TARGET(float)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
|
||||
{
|
||||
const double d{[&] {
|
||||
double tmp;
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
// an actual number
|
||||
[&] { tmp = fuzzed_data_provider.ConsumeFloatingPoint<double>(); },
|
||||
// special numbers and NANs
|
||||
[&] { tmp = fuzzed_data_provider.PickValueInArray({
|
||||
std::numeric_limits<double>::infinity(),
|
||||
-std::numeric_limits<double>::infinity(),
|
||||
std::numeric_limits<double>::min(),
|
||||
-std::numeric_limits<double>::min(),
|
||||
std::numeric_limits<double>::max(),
|
||||
-std::numeric_limits<double>::max(),
|
||||
std::numeric_limits<double>::lowest(),
|
||||
-std::numeric_limits<double>::lowest(),
|
||||
std::numeric_limits<double>::quiet_NaN(),
|
||||
-std::numeric_limits<double>::quiet_NaN(),
|
||||
std::numeric_limits<double>::signaling_NaN(),
|
||||
-std::numeric_limits<double>::signaling_NaN(),
|
||||
std::numeric_limits<double>::denorm_min(),
|
||||
-std::numeric_limits<double>::denorm_min(),
|
||||
}); },
|
||||
// Anything from raw memory (also checks that DecodeDouble doesn't crash on any input)
|
||||
[&] { tmp = DecodeDouble(fuzzed_data_provider.ConsumeIntegral<uint64_t>()); });
|
||||
return tmp;
|
||||
}()};
|
||||
(void)memusage::DynamicUsage(d);
|
||||
|
||||
uint64_t encoded = EncodeDouble(d);
|
||||
if constexpr (std::numeric_limits<double>::is_iec559) {
|
||||
if (!std::isnan(d)) {
|
||||
uint64_t encoded_in_memory;
|
||||
std::copy((const unsigned char*)&d, (const unsigned char*)(&d + 1), (unsigned char*)&encoded_in_memory);
|
||||
assert(encoded_in_memory == encoded);
|
||||
}
|
||||
}
|
||||
double d_deserialized = DecodeDouble(encoded);
|
||||
assert(std::isnan(d) == std::isnan(d_deserialized));
|
||||
assert(std::isnan(d) || d == d_deserialized);
|
||||
}
|
||||
}
|
||||
132
src/test/fuzz/fuzz.cpp
Normal file
132
src/test/fuzz/fuzz.cpp
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
// Copyright (c) 2009-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <test/fuzz/fuzz.h>
|
||||
|
||||
#include <netaddress.h>
|
||||
#include <netbase.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <util/check.h>
|
||||
#include <util/sock.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <exception>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
#include <vector>
|
||||
|
||||
const std::function<void(const std::string&)> G_TEST_LOG_FUN{};
|
||||
|
||||
std::map<std::string_view, std::tuple<TypeTestOneInput, TypeInitialize, TypeHidden>>& FuzzTargets()
|
||||
{
|
||||
static std::map<std::string_view, std::tuple<TypeTestOneInput, TypeInitialize, TypeHidden>> g_fuzz_targets;
|
||||
return g_fuzz_targets;
|
||||
}
|
||||
|
||||
void FuzzFrameworkRegisterTarget(std::string_view name, TypeTestOneInput target, TypeInitialize init, TypeHidden hidden)
|
||||
{
|
||||
const auto it_ins = FuzzTargets().try_emplace(name, std::move(target), std::move(init), hidden);
|
||||
Assert(it_ins.second);
|
||||
}
|
||||
|
||||
static TypeTestOneInput* g_test_one_input{nullptr};
|
||||
|
||||
void initialize()
|
||||
{
|
||||
// Terminate immediately if a fuzzing harness ever tries to create a TCP socket.
|
||||
CreateSock = [](const CService&) -> std::unique_ptr<Sock> { std::terminate(); };
|
||||
|
||||
// Terminate immediately if a fuzzing harness ever tries to perform a DNS lookup.
|
||||
g_dns_lookup = [](const std::string& name, bool allow_lookup) {
|
||||
if (allow_lookup) {
|
||||
std::terminate();
|
||||
}
|
||||
return WrappedGetAddrInfo(name, false);
|
||||
};
|
||||
|
||||
bool should_abort{false};
|
||||
if (std::getenv("PRINT_ALL_FUZZ_TARGETS_AND_ABORT")) {
|
||||
for (const auto& t : FuzzTargets()) {
|
||||
if (std::get<2>(t.second)) continue;
|
||||
std::cout << t.first << std::endl;
|
||||
}
|
||||
should_abort = true;
|
||||
}
|
||||
if (const char* out_path = std::getenv("WRITE_ALL_FUZZ_TARGETS_AND_ABORT")) {
|
||||
std::cout << "Writing all fuzz target names to '" << out_path << "'." << std::endl;
|
||||
std::ofstream out_stream(out_path, std::ios::binary);
|
||||
for (const auto& t : FuzzTargets()) {
|
||||
if (std::get<2>(t.second)) continue;
|
||||
out_stream << t.first << std::endl;
|
||||
}
|
||||
should_abort = true;
|
||||
}
|
||||
Assert(!should_abort);
|
||||
std::string_view fuzz_target{Assert(std::getenv("FUZZ"))};
|
||||
const auto it = FuzzTargets().find(fuzz_target);
|
||||
Assert(it != FuzzTargets().end());
|
||||
Assert(!g_test_one_input);
|
||||
g_test_one_input = &std::get<0>(it->second);
|
||||
std::get<1>(it->second)();
|
||||
}
|
||||
|
||||
#if defined(PROVIDE_FUZZ_MAIN_FUNCTION)
|
||||
static bool read_stdin(std::vector<uint8_t>& data)
|
||||
{
|
||||
uint8_t buffer[1024];
|
||||
ssize_t length = 0;
|
||||
while ((length = read(STDIN_FILENO, buffer, 1024)) > 0) {
|
||||
data.insert(data.end(), buffer, buffer + length);
|
||||
}
|
||||
return length == 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
// This function is used by libFuzzer
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
||||
{
|
||||
static const auto& test_one_input = *Assert(g_test_one_input);
|
||||
test_one_input({data, size});
|
||||
return 0;
|
||||
}
|
||||
|
||||
// This function is used by libFuzzer
|
||||
extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv)
|
||||
{
|
||||
initialize();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(PROVIDE_FUZZ_MAIN_FUNCTION)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
initialize();
|
||||
static const auto& test_one_input = *Assert(g_test_one_input);
|
||||
#ifdef __AFL_INIT
|
||||
// Enable AFL deferred forkserver mode. Requires compilation using
|
||||
// afl-clang-fast++. See fuzzing.md for details.
|
||||
__AFL_INIT();
|
||||
#endif
|
||||
|
||||
#ifdef __AFL_LOOP
|
||||
// Enable AFL persistent mode. Requires compilation using afl-clang-fast++.
|
||||
// See fuzzing.md for details.
|
||||
while (__AFL_LOOP(1000)) {
|
||||
std::vector<uint8_t> buffer;
|
||||
if (!read_stdin(buffer)) {
|
||||
continue;
|
||||
}
|
||||
test_one_input(buffer);
|
||||
}
|
||||
#else
|
||||
std::vector<uint8_t> buffer;
|
||||
if (!read_stdin(buffer)) {
|
||||
return 0;
|
||||
}
|
||||
test_one_input(buffer);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
40
src/test/fuzz/fuzz.h
Normal file
40
src/test/fuzz/fuzz.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
// Copyright (c) 2009-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef DIGIBYTE_TEST_FUZZ_FUZZ_H
|
||||
#define DIGIBYTE_TEST_FUZZ_FUZZ_H
|
||||
|
||||
#include <span.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <string_view>
|
||||
|
||||
using FuzzBufferType = Span<const uint8_t>;
|
||||
|
||||
using TypeTestOneInput = std::function<void(FuzzBufferType)>;
|
||||
using TypeInitialize = std::function<void()>;
|
||||
using TypeHidden = bool;
|
||||
|
||||
void FuzzFrameworkRegisterTarget(std::string_view name, TypeTestOneInput target, TypeInitialize init, TypeHidden hidden);
|
||||
|
||||
inline void FuzzFrameworkEmptyInitFun() {}
|
||||
|
||||
#define FUZZ_TARGET(name) \
|
||||
FUZZ_TARGET_INIT(name, FuzzFrameworkEmptyInitFun)
|
||||
|
||||
#define FUZZ_TARGET_INIT(name, init_fun) \
|
||||
FUZZ_TARGET_INIT_HIDDEN(name, init_fun, false)
|
||||
|
||||
#define FUZZ_TARGET_INIT_HIDDEN(name, init_fun, hidden) \
|
||||
void name##_fuzz_target(FuzzBufferType); \
|
||||
struct name##_Before_Main { \
|
||||
name##_Before_Main() \
|
||||
{ \
|
||||
FuzzFrameworkRegisterTarget(#name, name##_fuzz_target, init_fun, hidden); \
|
||||
} \
|
||||
} const static g_##name##_before_main; \
|
||||
void name##_fuzz_target(FuzzBufferType buffer)
|
||||
|
||||
#endif // DIGIBYTE_TEST_FUZZ_FUZZ_H
|
||||
112
src/test/fuzz/golomb_rice.cpp
Normal file
112
src/test/fuzz/golomb_rice.cpp
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <blockfilter.h>
|
||||
#include <serialize.h>
|
||||
#include <streams.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <util/bytevectorhash.h>
|
||||
#include <util/golombrice.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <iosfwd>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
uint64_t MapIntoRange(const uint64_t x, const uint64_t n)
|
||||
{
|
||||
const uint64_t x_hi = x >> 32;
|
||||
const uint64_t x_lo = x & 0xFFFFFFFF;
|
||||
const uint64_t n_hi = n >> 32;
|
||||
const uint64_t n_lo = n & 0xFFFFFFFF;
|
||||
const uint64_t ac = x_hi * n_hi;
|
||||
const uint64_t ad = x_hi * n_lo;
|
||||
const uint64_t bc = x_lo * n_hi;
|
||||
const uint64_t bd = x_lo * n_lo;
|
||||
const uint64_t mid34 = (bd >> 32) + (bc & 0xFFFFFFFF) + (ad & 0xFFFFFFFF);
|
||||
const uint64_t upper64 = ac + (bc >> 32) + (ad >> 32) + (mid34 >> 32);
|
||||
return upper64;
|
||||
}
|
||||
|
||||
uint64_t HashToRange(const std::vector<uint8_t>& element, const uint64_t f)
|
||||
{
|
||||
const uint64_t hash = CSipHasher(0x0706050403020100ULL, 0x0F0E0D0C0B0A0908ULL)
|
||||
.Write(element.data(), element.size())
|
||||
.Finalize();
|
||||
return MapIntoRange(hash, f);
|
||||
}
|
||||
|
||||
std::vector<uint64_t> BuildHashedSet(const std::unordered_set<std::vector<uint8_t>, ByteVectorHash>& elements, const uint64_t f)
|
||||
{
|
||||
std::vector<uint64_t> hashed_elements;
|
||||
hashed_elements.reserve(elements.size());
|
||||
for (const std::vector<uint8_t>& element : elements) {
|
||||
hashed_elements.push_back(HashToRange(element, f));
|
||||
}
|
||||
std::sort(hashed_elements.begin(), hashed_elements.end());
|
||||
return hashed_elements;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
FUZZ_TARGET(golomb_rice)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
std::vector<uint8_t> golomb_rice_data;
|
||||
std::vector<uint64_t> encoded_deltas;
|
||||
{
|
||||
std::unordered_set<std::vector<uint8_t>, ByteVectorHash> elements;
|
||||
const int n = fuzzed_data_provider.ConsumeIntegralInRange<int>(0, 512);
|
||||
for (int i = 0; i < n; ++i) {
|
||||
elements.insert(ConsumeRandomLengthByteVector(fuzzed_data_provider, 16));
|
||||
}
|
||||
CVectorWriter stream(SER_NETWORK, 0, golomb_rice_data, 0);
|
||||
WriteCompactSize(stream, static_cast<uint32_t>(elements.size()));
|
||||
BitStreamWriter<CVectorWriter> bitwriter(stream);
|
||||
if (!elements.empty()) {
|
||||
uint64_t last_value = 0;
|
||||
for (const uint64_t value : BuildHashedSet(elements, static_cast<uint64_t>(elements.size()) * static_cast<uint64_t>(BASIC_FILTER_M))) {
|
||||
const uint64_t delta = value - last_value;
|
||||
encoded_deltas.push_back(delta);
|
||||
GolombRiceEncode(bitwriter, BASIC_FILTER_P, delta);
|
||||
last_value = value;
|
||||
}
|
||||
}
|
||||
bitwriter.Flush();
|
||||
}
|
||||
|
||||
std::vector<uint64_t> decoded_deltas;
|
||||
{
|
||||
VectorReader stream{SER_NETWORK, 0, golomb_rice_data, 0};
|
||||
BitStreamReader<VectorReader> bitreader(stream);
|
||||
const uint32_t n = static_cast<uint32_t>(ReadCompactSize(stream));
|
||||
for (uint32_t i = 0; i < n; ++i) {
|
||||
decoded_deltas.push_back(GolombRiceDecode(bitreader, BASIC_FILTER_P));
|
||||
}
|
||||
}
|
||||
|
||||
assert(encoded_deltas == decoded_deltas);
|
||||
|
||||
{
|
||||
const std::vector<uint8_t> random_bytes = ConsumeRandomLengthByteVector(fuzzed_data_provider, 1024);
|
||||
VectorReader stream{SER_NETWORK, 0, random_bytes, 0};
|
||||
uint32_t n;
|
||||
try {
|
||||
n = static_cast<uint32_t>(ReadCompactSize(stream));
|
||||
} catch (const std::ios_base::failure&) {
|
||||
return;
|
||||
}
|
||||
BitStreamReader<VectorReader> bitreader(stream);
|
||||
for (uint32_t i = 0; i < std::min<uint32_t>(n, 1024); ++i) {
|
||||
try {
|
||||
(void)GolombRiceDecode(bitreader, BASIC_FILTER_P);
|
||||
} catch (const std::ios_base::failure&) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
44
src/test/fuzz/hex.cpp
Normal file
44
src/test/fuzz/hex.cpp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// Copyright (c) 2019-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <core_io.h>
|
||||
#include <primitives/block.h>
|
||||
#include <pubkey.h>
|
||||
#include <rpc/util.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <uint256.h>
|
||||
#include <univalue.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
void initialize_hex()
|
||||
{
|
||||
static const ECCVerifyHandle verify_handle;
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(hex, initialize_hex)
|
||||
{
|
||||
const std::string random_hex_string(buffer.begin(), buffer.end());
|
||||
const std::vector<unsigned char> data = ParseHex(random_hex_string);
|
||||
const std::string hex_data = HexStr(data);
|
||||
if (IsHex(random_hex_string)) {
|
||||
assert(ToLower(random_hex_string) == hex_data);
|
||||
}
|
||||
(void)IsHexNumber(random_hex_string);
|
||||
uint256 result;
|
||||
(void)ParseHashStr(random_hex_string, result);
|
||||
(void)uint256S(random_hex_string);
|
||||
try {
|
||||
(void)HexToPubKey(random_hex_string);
|
||||
} catch (const UniValue&) {
|
||||
}
|
||||
CBlockHeader block_header;
|
||||
(void)DecodeHexBlockHeader(block_header, random_hex_string);
|
||||
CBlock block;
|
||||
(void)DecodeHexBlk(block, random_hex_string);
|
||||
}
|
||||
81
src/test/fuzz/http_request.cpp
Normal file
81
src/test/fuzz/http_request.cpp
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <httpserver.h>
|
||||
#include <netaddress.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <event2/buffer.h>
|
||||
#include <event2/event.h>
|
||||
#include <event2/http.h>
|
||||
#include <event2/http_struct.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// workaround for libevent versions before 2.1.1,
|
||||
// when internal functions didn't have underscores at the end
|
||||
#if LIBEVENT_VERSION_NUMBER < 0x02010100
|
||||
extern "C" int evhttp_parse_firstline(struct evhttp_request*, struct evbuffer*);
|
||||
extern "C" int evhttp_parse_headers(struct evhttp_request*, struct evbuffer*);
|
||||
inline int evhttp_parse_firstline_(struct evhttp_request* r, struct evbuffer* b)
|
||||
{
|
||||
return evhttp_parse_firstline(r, b);
|
||||
}
|
||||
inline int evhttp_parse_headers_(struct evhttp_request* r, struct evbuffer* b)
|
||||
{
|
||||
return evhttp_parse_headers(r, b);
|
||||
}
|
||||
#else
|
||||
extern "C" int evhttp_parse_firstline_(struct evhttp_request*, struct evbuffer*);
|
||||
extern "C" int evhttp_parse_headers_(struct evhttp_request*, struct evbuffer*);
|
||||
#endif
|
||||
|
||||
std::string RequestMethodString(HTTPRequest::RequestMethod m);
|
||||
|
||||
FUZZ_TARGET(http_request)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
evhttp_request* evreq = evhttp_request_new(nullptr, nullptr);
|
||||
assert(evreq != nullptr);
|
||||
evreq->kind = EVHTTP_REQUEST;
|
||||
evbuffer* evbuf = evbuffer_new();
|
||||
assert(evbuf != nullptr);
|
||||
const std::vector<uint8_t> http_buffer = ConsumeRandomLengthByteVector(fuzzed_data_provider, 4096);
|
||||
evbuffer_add(evbuf, http_buffer.data(), http_buffer.size());
|
||||
// Avoid constructing requests that will be interpreted by libevent as PROXY requests to avoid triggering
|
||||
// a nullptr dereference. The dereference (req->evcon->http_server) takes place in evhttp_parse_request_line
|
||||
// and is a consequence of our hacky but necessary use of the internal function evhttp_parse_firstline_ in
|
||||
// this fuzzing harness. The workaround is not aesthetically pleasing, but it successfully avoids the troublesome
|
||||
// code path. " http:// HTTP/1.1\n" was a crashing input prior to this workaround.
|
||||
const std::string http_buffer_str = ToLower({http_buffer.begin(), http_buffer.end()});
|
||||
if (http_buffer_str.find(" http://") != std::string::npos || http_buffer_str.find(" https://") != std::string::npos ||
|
||||
evhttp_parse_firstline_(evreq, evbuf) != 1 || evhttp_parse_headers_(evreq, evbuf) != 1) {
|
||||
evbuffer_free(evbuf);
|
||||
evhttp_request_free(evreq);
|
||||
return;
|
||||
}
|
||||
|
||||
HTTPRequest http_request{evreq, true};
|
||||
const HTTPRequest::RequestMethod request_method = http_request.GetRequestMethod();
|
||||
(void)RequestMethodString(request_method);
|
||||
(void)http_request.GetURI();
|
||||
(void)http_request.GetHeader("Host");
|
||||
const std::string header = fuzzed_data_provider.ConsumeRandomLengthString(16);
|
||||
(void)http_request.GetHeader(header);
|
||||
(void)http_request.WriteHeader(header, fuzzed_data_provider.ConsumeRandomLengthString(16));
|
||||
(void)http_request.GetHeader(header);
|
||||
const std::string body = http_request.ReadBody();
|
||||
assert(body.empty());
|
||||
const CService service = http_request.GetPeer();
|
||||
assert(service.ToString() == "[::]:0");
|
||||
|
||||
evbuffer_free(evbuf);
|
||||
evhttp_request_free(evreq);
|
||||
}
|
||||
57
src/test/fuzz/i2p.cpp
Normal file
57
src/test/fuzz/i2p.cpp
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <i2p.h>
|
||||
#include <netaddress.h>
|
||||
#include <netbase.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <threadinterrupt.h>
|
||||
#include <util/system.h>
|
||||
|
||||
void initialize_i2p()
|
||||
{
|
||||
static const auto testing_setup = MakeNoLogFileContext<>();
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(i2p, initialize_i2p)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
|
||||
// Mock CreateSock() to create FuzzedSock.
|
||||
auto CreateSockOrig = CreateSock;
|
||||
CreateSock = [&fuzzed_data_provider](const CService&) {
|
||||
return std::make_unique<FuzzedSock>(fuzzed_data_provider);
|
||||
};
|
||||
|
||||
const CService sam_proxy;
|
||||
CThreadInterrupt interrupt;
|
||||
|
||||
i2p::sam::Session sess{gArgs.GetDataDirNet() / "fuzzed_i2p_private_key", sam_proxy, &interrupt};
|
||||
|
||||
i2p::Connection conn;
|
||||
|
||||
if (sess.Listen(conn)) {
|
||||
if (sess.Accept(conn)) {
|
||||
try {
|
||||
(void)conn.sock->RecvUntilTerminator('\n', 10ms, interrupt, i2p::sam::MAX_MSG_SIZE);
|
||||
} catch (const std::runtime_error&) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const CService to;
|
||||
bool proxy_error;
|
||||
|
||||
if (sess.Connect(to, conn, proxy_error)) {
|
||||
try {
|
||||
conn.sock->SendComplete("verack\n", 10ms, interrupt);
|
||||
} catch (const std::runtime_error&) {
|
||||
}
|
||||
}
|
||||
|
||||
CreateSock = CreateSockOrig;
|
||||
}
|
||||
273
src/test/fuzz/integer.cpp
Normal file
273
src/test/fuzz/integer.cpp
Normal file
|
|
@ -0,0 +1,273 @@
|
|||
// Copyright (c) 2019-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <amount.h>
|
||||
#include <arith_uint256.h>
|
||||
#include <compressor.h>
|
||||
#include <consensus/merkle.h>
|
||||
#include <core_io.h>
|
||||
#include <crypto/common.h>
|
||||
#include <crypto/siphash.h>
|
||||
#include <key_io.h>
|
||||
#include <memusage.h>
|
||||
#include <netbase.h>
|
||||
#include <policy/settings.h>
|
||||
#include <pow.h>
|
||||
#include <protocol.h>
|
||||
#include <pubkey.h>
|
||||
#include <script/standard.h>
|
||||
#include <serialize.h>
|
||||
#include <streams.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <uint256.h>
|
||||
#include <util/check.h>
|
||||
#include <util/moneystr.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/string.h>
|
||||
#include <util/system.h>
|
||||
#include <util/time.h>
|
||||
#include <version.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <chrono>
|
||||
#include <ctime>
|
||||
#include <limits>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
void initialize_integer()
|
||||
{
|
||||
SelectParams(CBaseChainParams::REGTEST);
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(integer, initialize_integer)
|
||||
{
|
||||
if (buffer.size() < sizeof(uint256) + sizeof(uint160)) {
|
||||
return;
|
||||
}
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
const uint256 u256(fuzzed_data_provider.ConsumeBytes<unsigned char>(sizeof(uint256)));
|
||||
const uint160 u160(fuzzed_data_provider.ConsumeBytes<unsigned char>(sizeof(uint160)));
|
||||
const uint64_t u64 = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
|
||||
const int64_t i64 = fuzzed_data_provider.ConsumeIntegral<int64_t>();
|
||||
const uint32_t u32 = fuzzed_data_provider.ConsumeIntegral<uint32_t>();
|
||||
const int32_t i32 = fuzzed_data_provider.ConsumeIntegral<int32_t>();
|
||||
const uint16_t u16 = fuzzed_data_provider.ConsumeIntegral<uint16_t>();
|
||||
const int16_t i16 = fuzzed_data_provider.ConsumeIntegral<int16_t>();
|
||||
const uint8_t u8 = fuzzed_data_provider.ConsumeIntegral<uint8_t>();
|
||||
const int8_t i8 = fuzzed_data_provider.ConsumeIntegral<int8_t>();
|
||||
// We cannot assume a specific value of std::is_signed<char>::value:
|
||||
// ConsumeIntegral<char>() instead of casting from {u,}int8_t.
|
||||
const char ch = fuzzed_data_provider.ConsumeIntegral<char>();
|
||||
const bool b = fuzzed_data_provider.ConsumeBool();
|
||||
|
||||
const Consensus::Params& consensus_params = Params().GetConsensus();
|
||||
(void)CheckProofOfWork(u256, u32, consensus_params);
|
||||
if (u64 <= MAX_MONEY) {
|
||||
const uint64_t compressed_money_amount = CompressAmount(u64);
|
||||
assert(u64 == DecompressAmount(compressed_money_amount));
|
||||
static const uint64_t compressed_money_amount_max = CompressAmount(MAX_MONEY - 1);
|
||||
assert(compressed_money_amount <= compressed_money_amount_max);
|
||||
} else {
|
||||
(void)CompressAmount(u64);
|
||||
}
|
||||
static const uint256 u256_min(uint256S("0000000000000000000000000000000000000000000000000000000000000000"));
|
||||
static const uint256 u256_max(uint256S("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));
|
||||
const std::vector<uint256> v256{u256, u256_min, u256_max};
|
||||
(void)ComputeMerkleRoot(v256);
|
||||
(void)CountBits(u64);
|
||||
(void)DecompressAmount(u64);
|
||||
(void)FormatISO8601Date(i64);
|
||||
(void)FormatISO8601DateTime(i64);
|
||||
{
|
||||
int64_t parsed_money;
|
||||
if (ParseMoney(FormatMoney(i64), parsed_money)) {
|
||||
assert(parsed_money == i64);
|
||||
}
|
||||
}
|
||||
(void)GetSizeOfCompactSize(u64);
|
||||
(void)GetSpecialScriptSize(u32);
|
||||
if (!MultiplicationOverflow(i64, static_cast<int64_t>(::nBytesPerSigOp)) && !AdditionOverflow(i64 * ::nBytesPerSigOp, static_cast<int64_t>(4))) {
|
||||
(void)GetVirtualTransactionSize(i64, i64);
|
||||
}
|
||||
if (!MultiplicationOverflow(i64, static_cast<int64_t>(u32)) && !AdditionOverflow(i64, static_cast<int64_t>(4)) && !AdditionOverflow(i64 * u32, static_cast<int64_t>(4))) {
|
||||
(void)GetVirtualTransactionSize(i64, i64, u32);
|
||||
}
|
||||
(void)HexDigit(ch);
|
||||
(void)MoneyRange(i64);
|
||||
(void)ToString(i64);
|
||||
(void)IsDigit(ch);
|
||||
(void)IsSpace(ch);
|
||||
(void)IsSwitchChar(ch);
|
||||
(void)memusage::DynamicUsage(ch);
|
||||
(void)memusage::DynamicUsage(i16);
|
||||
(void)memusage::DynamicUsage(i32);
|
||||
(void)memusage::DynamicUsage(i64);
|
||||
(void)memusage::DynamicUsage(i8);
|
||||
(void)memusage::DynamicUsage(u16);
|
||||
(void)memusage::DynamicUsage(u32);
|
||||
(void)memusage::DynamicUsage(u64);
|
||||
(void)memusage::DynamicUsage(u8);
|
||||
const unsigned char uch = static_cast<unsigned char>(u8);
|
||||
(void)memusage::DynamicUsage(uch);
|
||||
{
|
||||
const std::set<int64_t> i64s{i64, static_cast<int64_t>(u64)};
|
||||
const size_t dynamic_usage = memusage::DynamicUsage(i64s);
|
||||
const size_t incremental_dynamic_usage = memusage::IncrementalDynamicUsage(i64s);
|
||||
assert(dynamic_usage == incremental_dynamic_usage * i64s.size());
|
||||
}
|
||||
(void)MillisToTimeval(i64);
|
||||
(void)SighashToStr(uch);
|
||||
(void)SipHashUint256(u64, u64, u256);
|
||||
(void)SipHashUint256Extra(u64, u64, u256, u32);
|
||||
(void)ToLower(ch);
|
||||
(void)ToUpper(ch);
|
||||
{
|
||||
int64_t parsed_money;
|
||||
if (ParseMoney(ValueFromAmount(i64).getValStr(), parsed_money)) {
|
||||
assert(parsed_money == i64);
|
||||
}
|
||||
}
|
||||
if (i32 >= 0 && i32 <= 16) {
|
||||
assert(i32 == CScript::DecodeOP_N(CScript::EncodeOP_N(i32)));
|
||||
}
|
||||
|
||||
const std::chrono::seconds seconds{i64};
|
||||
assert(count_seconds(seconds) == i64);
|
||||
|
||||
const CScriptNum script_num{i64};
|
||||
(void)script_num.getint();
|
||||
(void)script_num.getvch();
|
||||
|
||||
const arith_uint256 au256 = UintToArith256(u256);
|
||||
assert(ArithToUint256(au256) == u256);
|
||||
assert(uint256S(au256.GetHex()) == u256);
|
||||
(void)au256.bits();
|
||||
(void)au256.GetCompact(/* fNegative= */ false);
|
||||
(void)au256.GetCompact(/* fNegative= */ true);
|
||||
(void)au256.getdouble();
|
||||
(void)au256.GetHex();
|
||||
(void)au256.GetLow64();
|
||||
(void)au256.size();
|
||||
(void)au256.ToString();
|
||||
|
||||
const CKeyID key_id{u160};
|
||||
const CScriptID script_id{u160};
|
||||
|
||||
{
|
||||
CDataStream stream(SER_NETWORK, INIT_PROTO_VERSION);
|
||||
|
||||
uint256 deserialized_u256;
|
||||
stream << u256;
|
||||
stream >> deserialized_u256;
|
||||
assert(u256 == deserialized_u256 && stream.empty());
|
||||
|
||||
uint160 deserialized_u160;
|
||||
stream << u160;
|
||||
stream >> deserialized_u160;
|
||||
assert(u160 == deserialized_u160 && stream.empty());
|
||||
|
||||
uint64_t deserialized_u64;
|
||||
stream << u64;
|
||||
stream >> deserialized_u64;
|
||||
assert(u64 == deserialized_u64 && stream.empty());
|
||||
|
||||
int64_t deserialized_i64;
|
||||
stream << i64;
|
||||
stream >> deserialized_i64;
|
||||
assert(i64 == deserialized_i64 && stream.empty());
|
||||
|
||||
uint32_t deserialized_u32;
|
||||
stream << u32;
|
||||
stream >> deserialized_u32;
|
||||
assert(u32 == deserialized_u32 && stream.empty());
|
||||
|
||||
int32_t deserialized_i32;
|
||||
stream << i32;
|
||||
stream >> deserialized_i32;
|
||||
assert(i32 == deserialized_i32 && stream.empty());
|
||||
|
||||
uint16_t deserialized_u16;
|
||||
stream << u16;
|
||||
stream >> deserialized_u16;
|
||||
assert(u16 == deserialized_u16 && stream.empty());
|
||||
|
||||
int16_t deserialized_i16;
|
||||
stream << i16;
|
||||
stream >> deserialized_i16;
|
||||
assert(i16 == deserialized_i16 && stream.empty());
|
||||
|
||||
uint8_t deserialized_u8;
|
||||
stream << u8;
|
||||
stream >> deserialized_u8;
|
||||
assert(u8 == deserialized_u8 && stream.empty());
|
||||
|
||||
int8_t deserialized_i8;
|
||||
stream << i8;
|
||||
stream >> deserialized_i8;
|
||||
assert(i8 == deserialized_i8 && stream.empty());
|
||||
|
||||
char deserialized_ch;
|
||||
stream << ch;
|
||||
stream >> deserialized_ch;
|
||||
assert(ch == deserialized_ch && stream.empty());
|
||||
|
||||
bool deserialized_b;
|
||||
stream << b;
|
||||
stream >> deserialized_b;
|
||||
assert(b == deserialized_b && stream.empty());
|
||||
}
|
||||
|
||||
{
|
||||
const ServiceFlags service_flags = (ServiceFlags)u64;
|
||||
(void)HasAllDesirableServiceFlags(service_flags);
|
||||
(void)MayHaveUsefulAddressDB(service_flags);
|
||||
}
|
||||
|
||||
{
|
||||
CDataStream stream(SER_NETWORK, INIT_PROTO_VERSION);
|
||||
|
||||
ser_writedata64(stream, u64);
|
||||
const uint64_t deserialized_u64 = ser_readdata64(stream);
|
||||
assert(u64 == deserialized_u64 && stream.empty());
|
||||
|
||||
ser_writedata32(stream, u32);
|
||||
const uint32_t deserialized_u32 = ser_readdata32(stream);
|
||||
assert(u32 == deserialized_u32 && stream.empty());
|
||||
|
||||
ser_writedata32be(stream, u32);
|
||||
const uint32_t deserialized_u32be = ser_readdata32be(stream);
|
||||
assert(u32 == deserialized_u32be && stream.empty());
|
||||
|
||||
ser_writedata16(stream, u16);
|
||||
const uint16_t deserialized_u16 = ser_readdata16(stream);
|
||||
assert(u16 == deserialized_u16 && stream.empty());
|
||||
|
||||
ser_writedata16be(stream, u16);
|
||||
const uint16_t deserialized_u16be = ser_readdata16be(stream);
|
||||
assert(u16 == deserialized_u16be && stream.empty());
|
||||
|
||||
ser_writedata8(stream, u8);
|
||||
const uint8_t deserialized_u8 = ser_readdata8(stream);
|
||||
assert(u8 == deserialized_u8 && stream.empty());
|
||||
}
|
||||
|
||||
{
|
||||
CDataStream stream(SER_NETWORK, INIT_PROTO_VERSION);
|
||||
|
||||
WriteCompactSize(stream, u64);
|
||||
try {
|
||||
const uint64_t deserialized_u64 = ReadCompactSize(stream);
|
||||
assert(u64 == deserialized_u64 && stream.empty());
|
||||
} catch (const std::ios_base::failure&) {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
CHECK_NONFATAL(b);
|
||||
} catch (const NonFatalCheckError&) {
|
||||
}
|
||||
}
|
||||
308
src/test/fuzz/key.cpp
Normal file
308
src/test/fuzz/key.cpp
Normal file
|
|
@ -0,0 +1,308 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <chainparams.h>
|
||||
#include <chainparamsbase.h>
|
||||
#include <key.h>
|
||||
#include <key_io.h>
|
||||
#include <outputtype.h>
|
||||
#include <policy/policy.h>
|
||||
#include <pubkey.h>
|
||||
#include <rpc/util.h>
|
||||
#include <script/keyorigin.h>
|
||||
#include <script/script.h>
|
||||
#include <script/sign.h>
|
||||
#include <script/signingprovider.h>
|
||||
#include <script/standard.h>
|
||||
#include <streams.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <numeric>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
void initialize_key()
|
||||
{
|
||||
static const ECCVerifyHandle ecc_verify_handle;
|
||||
ECC_Start();
|
||||
SelectParams(CBaseChainParams::REGTEST);
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(key, initialize_key)
|
||||
{
|
||||
const CKey key = [&] {
|
||||
CKey k;
|
||||
k.Set(buffer.begin(), buffer.end(), true);
|
||||
return k;
|
||||
}();
|
||||
if (!key.IsValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
assert(key.begin() + key.size() == key.end());
|
||||
assert(key.IsCompressed());
|
||||
assert(key.size() == 32);
|
||||
assert(DecodeSecret(EncodeSecret(key)) == key);
|
||||
}
|
||||
|
||||
{
|
||||
CKey invalid_key;
|
||||
assert(!(invalid_key == key));
|
||||
assert(!invalid_key.IsCompressed());
|
||||
assert(!invalid_key.IsValid());
|
||||
assert(invalid_key.size() == 0);
|
||||
}
|
||||
|
||||
{
|
||||
CKey uncompressed_key;
|
||||
uncompressed_key.Set(buffer.begin(), buffer.end(), false);
|
||||
assert(!(uncompressed_key == key));
|
||||
assert(!uncompressed_key.IsCompressed());
|
||||
assert(key.size() == 32);
|
||||
assert(uncompressed_key.begin() + uncompressed_key.size() == uncompressed_key.end());
|
||||
assert(uncompressed_key.IsValid());
|
||||
}
|
||||
|
||||
{
|
||||
CKey copied_key;
|
||||
copied_key.Set(key.begin(), key.end(), key.IsCompressed());
|
||||
assert(copied_key == key);
|
||||
}
|
||||
|
||||
{
|
||||
CKey negated_key = key;
|
||||
negated_key.Negate();
|
||||
assert(negated_key.IsValid());
|
||||
assert(!(negated_key == key));
|
||||
|
||||
negated_key.Negate();
|
||||
assert(negated_key == key);
|
||||
}
|
||||
|
||||
const uint256 random_uint256 = Hash(buffer);
|
||||
|
||||
{
|
||||
CKey child_key;
|
||||
ChainCode child_chaincode;
|
||||
const bool ok = key.Derive(child_key, child_chaincode, 0, random_uint256);
|
||||
assert(ok);
|
||||
assert(child_key.IsValid());
|
||||
assert(!(child_key == key));
|
||||
assert(child_chaincode != random_uint256);
|
||||
}
|
||||
|
||||
const CPubKey pubkey = key.GetPubKey();
|
||||
|
||||
{
|
||||
assert(pubkey.size() == 33);
|
||||
assert(key.VerifyPubKey(pubkey));
|
||||
assert(pubkey.GetHash() != random_uint256);
|
||||
assert(pubkey.begin() + pubkey.size() == pubkey.end());
|
||||
assert(pubkey.data() == pubkey.begin());
|
||||
assert(pubkey.IsCompressed());
|
||||
assert(pubkey.IsValid());
|
||||
assert(pubkey.IsFullyValid());
|
||||
assert(HexToPubKey(HexStr(pubkey)) == pubkey);
|
||||
assert(GetAllDestinationsForKey(pubkey).size() == 3);
|
||||
}
|
||||
|
||||
{
|
||||
CDataStream data_stream{SER_NETWORK, INIT_PROTO_VERSION};
|
||||
pubkey.Serialize(data_stream);
|
||||
|
||||
CPubKey pubkey_deserialized;
|
||||
pubkey_deserialized.Unserialize(data_stream);
|
||||
assert(pubkey_deserialized == pubkey);
|
||||
}
|
||||
|
||||
{
|
||||
const CScript tx_pubkey_script = GetScriptForRawPubKey(pubkey);
|
||||
assert(!tx_pubkey_script.IsPayToScriptHash());
|
||||
assert(!tx_pubkey_script.IsPayToWitnessScriptHash());
|
||||
assert(!tx_pubkey_script.IsPushOnly());
|
||||
assert(!tx_pubkey_script.IsUnspendable());
|
||||
assert(tx_pubkey_script.HasValidOps());
|
||||
assert(tx_pubkey_script.size() == 35);
|
||||
|
||||
const CScript tx_multisig_script = GetScriptForMultisig(1, {pubkey});
|
||||
assert(!tx_multisig_script.IsPayToScriptHash());
|
||||
assert(!tx_multisig_script.IsPayToWitnessScriptHash());
|
||||
assert(!tx_multisig_script.IsPushOnly());
|
||||
assert(!tx_multisig_script.IsUnspendable());
|
||||
assert(tx_multisig_script.HasValidOps());
|
||||
assert(tx_multisig_script.size() == 37);
|
||||
|
||||
FillableSigningProvider fillable_signing_provider;
|
||||
assert(IsSolvable(fillable_signing_provider, tx_pubkey_script));
|
||||
assert(IsSolvable(fillable_signing_provider, tx_multisig_script));
|
||||
assert(!IsSegWitOutput(fillable_signing_provider, tx_pubkey_script));
|
||||
assert(!IsSegWitOutput(fillable_signing_provider, tx_multisig_script));
|
||||
assert(fillable_signing_provider.GetKeys().size() == 0);
|
||||
assert(!fillable_signing_provider.HaveKey(pubkey.GetID()));
|
||||
|
||||
const bool ok_add_key = fillable_signing_provider.AddKey(key);
|
||||
assert(ok_add_key);
|
||||
assert(fillable_signing_provider.HaveKey(pubkey.GetID()));
|
||||
|
||||
FillableSigningProvider fillable_signing_provider_pub;
|
||||
assert(!fillable_signing_provider_pub.HaveKey(pubkey.GetID()));
|
||||
|
||||
const bool ok_add_key_pubkey = fillable_signing_provider_pub.AddKeyPubKey(key, pubkey);
|
||||
assert(ok_add_key_pubkey);
|
||||
assert(fillable_signing_provider_pub.HaveKey(pubkey.GetID()));
|
||||
|
||||
TxoutType which_type_tx_pubkey;
|
||||
const bool is_standard_tx_pubkey = IsStandard(tx_pubkey_script, which_type_tx_pubkey);
|
||||
assert(is_standard_tx_pubkey);
|
||||
assert(which_type_tx_pubkey == TxoutType::PUBKEY);
|
||||
|
||||
TxoutType which_type_tx_multisig;
|
||||
const bool is_standard_tx_multisig = IsStandard(tx_multisig_script, which_type_tx_multisig);
|
||||
assert(is_standard_tx_multisig);
|
||||
assert(which_type_tx_multisig == TxoutType::MULTISIG);
|
||||
|
||||
std::vector<std::vector<unsigned char>> v_solutions_ret_tx_pubkey;
|
||||
const TxoutType outtype_tx_pubkey = Solver(tx_pubkey_script, v_solutions_ret_tx_pubkey);
|
||||
assert(outtype_tx_pubkey == TxoutType::PUBKEY);
|
||||
assert(v_solutions_ret_tx_pubkey.size() == 1);
|
||||
assert(v_solutions_ret_tx_pubkey[0].size() == 33);
|
||||
|
||||
std::vector<std::vector<unsigned char>> v_solutions_ret_tx_multisig;
|
||||
const TxoutType outtype_tx_multisig = Solver(tx_multisig_script, v_solutions_ret_tx_multisig);
|
||||
assert(outtype_tx_multisig == TxoutType::MULTISIG);
|
||||
assert(v_solutions_ret_tx_multisig.size() == 3);
|
||||
assert(v_solutions_ret_tx_multisig[0].size() == 1);
|
||||
assert(v_solutions_ret_tx_multisig[1].size() == 33);
|
||||
assert(v_solutions_ret_tx_multisig[2].size() == 1);
|
||||
|
||||
OutputType output_type{};
|
||||
const CTxDestination tx_destination = GetDestinationForKey(pubkey, output_type);
|
||||
assert(output_type == OutputType::LEGACY);
|
||||
assert(IsValidDestination(tx_destination));
|
||||
assert(CTxDestination{PKHash{pubkey}} == tx_destination);
|
||||
|
||||
const CScript script_for_destination = GetScriptForDestination(tx_destination);
|
||||
assert(script_for_destination.size() == 25);
|
||||
|
||||
const std::string destination_address = EncodeDestination(tx_destination);
|
||||
assert(DecodeDestination(destination_address) == tx_destination);
|
||||
|
||||
const CPubKey pubkey_from_address_string = AddrToPubKey(fillable_signing_provider, destination_address);
|
||||
assert(pubkey_from_address_string == pubkey);
|
||||
|
||||
CKeyID key_id = pubkey.GetID();
|
||||
assert(!key_id.IsNull());
|
||||
assert(key_id == CKeyID{key_id});
|
||||
assert(key_id == GetKeyForDestination(fillable_signing_provider, tx_destination));
|
||||
|
||||
CPubKey pubkey_out;
|
||||
const bool ok_get_pubkey = fillable_signing_provider.GetPubKey(key_id, pubkey_out);
|
||||
assert(ok_get_pubkey);
|
||||
|
||||
CKey key_out;
|
||||
const bool ok_get_key = fillable_signing_provider.GetKey(key_id, key_out);
|
||||
assert(ok_get_key);
|
||||
assert(fillable_signing_provider.GetKeys().size() == 1);
|
||||
assert(fillable_signing_provider.HaveKey(key_id));
|
||||
|
||||
KeyOriginInfo key_origin_info;
|
||||
const bool ok_get_key_origin = fillable_signing_provider.GetKeyOrigin(key_id, key_origin_info);
|
||||
assert(!ok_get_key_origin);
|
||||
}
|
||||
|
||||
{
|
||||
const std::vector<unsigned char> vch_pubkey{pubkey.begin(), pubkey.end()};
|
||||
assert(CPubKey::ValidSize(vch_pubkey));
|
||||
assert(!CPubKey::ValidSize({pubkey.begin(), pubkey.begin() + pubkey.size() - 1}));
|
||||
|
||||
const CPubKey pubkey_ctor_1{vch_pubkey};
|
||||
assert(pubkey == pubkey_ctor_1);
|
||||
|
||||
const CPubKey pubkey_ctor_2{vch_pubkey.begin(), vch_pubkey.end()};
|
||||
assert(pubkey == pubkey_ctor_2);
|
||||
|
||||
CPubKey pubkey_set;
|
||||
pubkey_set.Set(vch_pubkey.begin(), vch_pubkey.end());
|
||||
assert(pubkey == pubkey_set);
|
||||
}
|
||||
|
||||
{
|
||||
const CPubKey invalid_pubkey{};
|
||||
assert(!invalid_pubkey.IsValid());
|
||||
assert(!invalid_pubkey.IsFullyValid());
|
||||
assert(!(pubkey == invalid_pubkey));
|
||||
assert(pubkey != invalid_pubkey);
|
||||
assert(pubkey < invalid_pubkey);
|
||||
}
|
||||
|
||||
{
|
||||
// Cover CPubKey's operator[](unsigned int pos)
|
||||
unsigned int sum = 0;
|
||||
for (size_t i = 0; i < pubkey.size(); ++i) {
|
||||
sum += pubkey[i];
|
||||
}
|
||||
assert(std::accumulate(pubkey.begin(), pubkey.end(), 0U) == sum);
|
||||
}
|
||||
|
||||
{
|
||||
CPubKey decompressed_pubkey = pubkey;
|
||||
assert(decompressed_pubkey.IsCompressed());
|
||||
|
||||
const bool ok = decompressed_pubkey.Decompress();
|
||||
assert(ok);
|
||||
assert(!decompressed_pubkey.IsCompressed());
|
||||
assert(decompressed_pubkey.size() == 65);
|
||||
}
|
||||
|
||||
{
|
||||
std::vector<unsigned char> vch_sig;
|
||||
const bool ok = key.Sign(random_uint256, vch_sig, false);
|
||||
assert(ok);
|
||||
assert(pubkey.Verify(random_uint256, vch_sig));
|
||||
assert(CPubKey::CheckLowS(vch_sig));
|
||||
|
||||
const std::vector<unsigned char> vch_invalid_sig{vch_sig.begin(), vch_sig.begin() + vch_sig.size() - 1};
|
||||
assert(!pubkey.Verify(random_uint256, vch_invalid_sig));
|
||||
assert(!CPubKey::CheckLowS(vch_invalid_sig));
|
||||
}
|
||||
|
||||
{
|
||||
std::vector<unsigned char> vch_compact_sig;
|
||||
const bool ok_sign_compact = key.SignCompact(random_uint256, vch_compact_sig);
|
||||
assert(ok_sign_compact);
|
||||
|
||||
CPubKey recover_pubkey;
|
||||
const bool ok_recover_compact = recover_pubkey.RecoverCompact(random_uint256, vch_compact_sig);
|
||||
assert(ok_recover_compact);
|
||||
assert(recover_pubkey == pubkey);
|
||||
}
|
||||
|
||||
{
|
||||
CPubKey child_pubkey;
|
||||
ChainCode child_chaincode;
|
||||
const bool ok = pubkey.Derive(child_pubkey, child_chaincode, 0, random_uint256);
|
||||
assert(ok);
|
||||
assert(child_pubkey != pubkey);
|
||||
assert(child_pubkey.IsCompressed());
|
||||
assert(child_pubkey.IsFullyValid());
|
||||
assert(child_pubkey.IsValid());
|
||||
assert(child_pubkey.size() == 33);
|
||||
assert(child_chaincode != random_uint256);
|
||||
}
|
||||
|
||||
const CPrivKey priv_key = key.GetPrivKey();
|
||||
|
||||
{
|
||||
for (const bool skip_check : {true, false}) {
|
||||
CKey loaded_key;
|
||||
const bool ok = loaded_key.Load(priv_key, pubkey, skip_check);
|
||||
assert(ok);
|
||||
assert(key == loaded_key);
|
||||
}
|
||||
}
|
||||
}
|
||||
39
src/test/fuzz/key_io.cpp
Normal file
39
src/test/fuzz/key_io.cpp
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <chainparams.h>
|
||||
#include <key_io.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
void initialize_key_io()
|
||||
{
|
||||
static const ECCVerifyHandle verify_handle;
|
||||
ECC_Start();
|
||||
SelectParams(CBaseChainParams::MAIN);
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(key_io, initialize_key_io)
|
||||
{
|
||||
const std::string random_string(buffer.begin(), buffer.end());
|
||||
|
||||
const CKey key = DecodeSecret(random_string);
|
||||
if (key.IsValid()) {
|
||||
assert(key == DecodeSecret(EncodeSecret(key)));
|
||||
}
|
||||
|
||||
const CExtKey ext_key = DecodeExtKey(random_string);
|
||||
if (ext_key.key.size() == 32) {
|
||||
assert(ext_key == DecodeExtKey(EncodeExtKey(ext_key)));
|
||||
}
|
||||
|
||||
const CExtPubKey ext_pub_key = DecodeExtPubKey(random_string);
|
||||
if (ext_pub_key.pubkey.size() == CPubKey::COMPRESSED_SIZE) {
|
||||
assert(ext_pub_key == DecodeExtPubKey(EncodeExtPubKey(ext_pub_key)));
|
||||
}
|
||||
}
|
||||
59
src/test/fuzz/kitchen_sink.cpp
Normal file
59
src/test/fuzz/kitchen_sink.cpp
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <merkleblock.h>
|
||||
#include <policy/fees.h>
|
||||
#include <rpc/util.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <util/error.h>
|
||||
#include <util/translation.h>
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
constexpr TransactionError ALL_TRANSACTION_ERROR[] = {
|
||||
TransactionError::OK,
|
||||
TransactionError::MISSING_INPUTS,
|
||||
TransactionError::ALREADY_IN_CHAIN,
|
||||
TransactionError::P2P_DISABLED,
|
||||
TransactionError::MEMPOOL_REJECTED,
|
||||
TransactionError::MEMPOOL_ERROR,
|
||||
TransactionError::INVALID_PSBT,
|
||||
TransactionError::PSBT_MISMATCH,
|
||||
TransactionError::SIGHASH_MISMATCH,
|
||||
TransactionError::MAX_FEE_EXCEEDED,
|
||||
};
|
||||
}; // namespace
|
||||
|
||||
// The fuzzing kitchen sink: Fuzzing harness for functions that need to be
|
||||
// fuzzed but a.) don't belong in any existing fuzzing harness file, and
|
||||
// b.) are not important enough to warrant their own fuzzing harness file.
|
||||
FUZZ_TARGET(kitchen_sink)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
|
||||
const TransactionError transaction_error = fuzzed_data_provider.PickValueInArray(ALL_TRANSACTION_ERROR);
|
||||
(void)JSONRPCTransactionError(transaction_error);
|
||||
(void)RPCErrorFromTransactionError(transaction_error);
|
||||
(void)TransactionErrorString(transaction_error);
|
||||
|
||||
(void)StringForFeeEstimateHorizon(fuzzed_data_provider.PickValueInArray(ALL_FEE_ESTIMATE_HORIZONS));
|
||||
|
||||
const OutputType output_type = fuzzed_data_provider.PickValueInArray(OUTPUT_TYPES);
|
||||
const std::string& output_type_string = FormatOutputType(output_type);
|
||||
OutputType output_type_parsed;
|
||||
const bool parsed = ParseOutputType(output_type_string, output_type_parsed);
|
||||
assert(parsed);
|
||||
assert(output_type == output_type_parsed);
|
||||
(void)ParseOutputType(fuzzed_data_provider.ConsumeRandomLengthString(64), output_type_parsed);
|
||||
|
||||
const std::vector<uint8_t> bytes = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
const std::vector<bool> bits = BytesToBits(bytes);
|
||||
const std::vector<uint8_t> bytes_decoded = BitsToBytes(bits);
|
||||
assert(bytes == bytes_decoded);
|
||||
}
|
||||
36
src/test/fuzz/load_external_block_file.cpp
Normal file
36
src/test/fuzz/load_external_block_file.cpp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <chainparams.h>
|
||||
#include <flatfile.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <validation.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
const TestingSetup* g_setup;
|
||||
} // namespace
|
||||
|
||||
void initialize_load_external_block_file()
|
||||
{
|
||||
static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>();
|
||||
g_setup = testing_setup.get();
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(load_external_block_file, initialize_load_external_block_file)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
FuzzedFileProvider fuzzed_file_provider = ConsumeFile(fuzzed_data_provider);
|
||||
FILE* fuzzed_block_file = fuzzed_file_provider.open();
|
||||
if (fuzzed_block_file == nullptr) {
|
||||
return;
|
||||
}
|
||||
FlatFilePos flat_file_pos;
|
||||
g_setup->m_node.chainman->ActiveChainstate().LoadExternalBlockFile(fuzzed_block_file, fuzzed_data_provider.ConsumeBool() ? &flat_file_pos : nullptr);
|
||||
}
|
||||
93
src/test/fuzz/locale.cpp
Normal file
93
src/test/fuzz/locale.cpp
Normal file
File diff suppressed because one or more lines are too long
49
src/test/fuzz/merkleblock.cpp
Normal file
49
src/test/fuzz/merkleblock.cpp
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <merkleblock.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <uint256.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(merkleblock)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
CPartialMerkleTree partial_merkle_tree;
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
const std::optional<CPartialMerkleTree> opt_partial_merkle_tree = ConsumeDeserializable<CPartialMerkleTree>(fuzzed_data_provider);
|
||||
if (opt_partial_merkle_tree) {
|
||||
partial_merkle_tree = *opt_partial_merkle_tree;
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
CMerkleBlock merkle_block;
|
||||
const std::optional<CBlock> opt_block = ConsumeDeserializable<CBlock>(fuzzed_data_provider);
|
||||
CBloomFilter bloom_filter;
|
||||
std::set<uint256> txids;
|
||||
if (opt_block && !opt_block->vtx.empty()) {
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
merkle_block = CMerkleBlock{*opt_block, bloom_filter};
|
||||
} else if (fuzzed_data_provider.ConsumeBool()) {
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
txids.insert(ConsumeUInt256(fuzzed_data_provider));
|
||||
}
|
||||
merkle_block = CMerkleBlock{*opt_block, txids};
|
||||
}
|
||||
}
|
||||
partial_merkle_tree = merkle_block.txn;
|
||||
});
|
||||
(void)partial_merkle_tree.GetNumTransactions();
|
||||
std::vector<uint256> matches;
|
||||
std::vector<unsigned int> indices;
|
||||
(void)partial_merkle_tree.ExtractMatches(matches, indices);
|
||||
}
|
||||
47
src/test/fuzz/message.cpp
Normal file
47
src/test/fuzz/message.cpp
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <chainparams.h>
|
||||
#include <key_io.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <util/message.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
void initialize_message()
|
||||
{
|
||||
static const ECCVerifyHandle ecc_verify_handle;
|
||||
ECC_Start();
|
||||
SelectParams(CBaseChainParams::REGTEST);
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(message, initialize_message)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
const std::string random_message = fuzzed_data_provider.ConsumeRandomLengthString(1024);
|
||||
{
|
||||
const std::vector<uint8_t> random_bytes = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
CKey private_key;
|
||||
private_key.Set(random_bytes.begin(), random_bytes.end(), fuzzed_data_provider.ConsumeBool());
|
||||
std::string signature;
|
||||
const bool message_signed = MessageSign(private_key, random_message, signature);
|
||||
if (private_key.IsValid()) {
|
||||
assert(message_signed);
|
||||
const MessageVerificationResult verification_result = MessageVerify(EncodeDestination(PKHash(private_key.GetPubKey().GetID())), signature, random_message);
|
||||
assert(verification_result == MessageVerificationResult::OK);
|
||||
}
|
||||
}
|
||||
{
|
||||
(void)MessageHash(random_message);
|
||||
(void)MessageVerify(fuzzed_data_provider.ConsumeRandomLengthString(1024), fuzzed_data_provider.ConsumeRandomLengthString(1024), random_message);
|
||||
(void)SigningResultString(fuzzed_data_provider.PickValueInArray({SigningResult::OK, SigningResult::PRIVATE_KEY_NOT_AVAILABLE, SigningResult::SIGNING_FAILED}));
|
||||
}
|
||||
}
|
||||
63
src/test/fuzz/muhash.cpp
Normal file
63
src/test/fuzz/muhash.cpp
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <crypto/muhash.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(muhash)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
std::vector<uint8_t> data = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
std::vector<uint8_t> data2 = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
if (data.empty()) {
|
||||
data.resize(fuzzed_data_provider.ConsumeIntegralInRange<size_t>(1, 4096), fuzzed_data_provider.ConsumeIntegral<uint8_t>());
|
||||
}
|
||||
if (data2.empty()) {
|
||||
data2.resize(fuzzed_data_provider.ConsumeIntegralInRange<size_t>(1, 4096), fuzzed_data_provider.ConsumeIntegral<uint8_t>());
|
||||
}
|
||||
|
||||
data = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
data2 = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
|
||||
MuHash3072 muhash;
|
||||
|
||||
// Test that MuHash result is consistent independent of order of operations
|
||||
muhash.Insert(data);
|
||||
muhash.Insert(data2);
|
||||
|
||||
uint256 out;
|
||||
muhash.Finalize(out);
|
||||
|
||||
muhash = MuHash3072();
|
||||
muhash.Insert(data2);
|
||||
muhash.Insert(data);
|
||||
|
||||
uint256 out2;
|
||||
muhash.Finalize(out2);
|
||||
|
||||
assert(out == out2);
|
||||
MuHash3072 muhash3;
|
||||
muhash3 *= muhash;
|
||||
uint256 out3;
|
||||
muhash3.Finalize(out3);
|
||||
assert(out == out3);
|
||||
|
||||
// Test that removing all added elements brings the object back to it's initial state
|
||||
muhash /= muhash;
|
||||
muhash.Finalize(out);
|
||||
|
||||
MuHash3072 muhash2;
|
||||
muhash2.Finalize(out2);
|
||||
|
||||
assert(out == out2);
|
||||
|
||||
muhash3.Remove(data);
|
||||
muhash3.Remove(data2);
|
||||
muhash3.Finalize(out3);
|
||||
assert(out == out3);
|
||||
}
|
||||
55
src/test/fuzz/multiplication_overflow.cpp
Normal file
55
src/test/fuzz/multiplication_overflow.cpp
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#if defined(__has_builtin)
|
||||
#if __has_builtin(__builtin_mul_overflow)
|
||||
#define HAVE_BUILTIN_MUL_OVERFLOW
|
||||
#endif
|
||||
#elif defined(__GNUC__)
|
||||
#define HAVE_BUILTIN_MUL_OVERFLOW
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
template <typename T>
|
||||
void TestMultiplicationOverflow(FuzzedDataProvider& fuzzed_data_provider)
|
||||
{
|
||||
const T i = fuzzed_data_provider.ConsumeIntegral<T>();
|
||||
const T j = fuzzed_data_provider.ConsumeIntegral<T>();
|
||||
const bool is_multiplication_overflow_custom = MultiplicationOverflow(i, j);
|
||||
#if defined(HAVE_BUILTIN_MUL_OVERFLOW)
|
||||
T result_builtin;
|
||||
const bool is_multiplication_overflow_builtin = __builtin_mul_overflow(i, j, &result_builtin);
|
||||
assert(is_multiplication_overflow_custom == is_multiplication_overflow_builtin);
|
||||
if (!is_multiplication_overflow_custom) {
|
||||
assert(i * j == result_builtin);
|
||||
}
|
||||
#else
|
||||
if (!is_multiplication_overflow_custom) {
|
||||
(void)(i * j);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
} // namespace
|
||||
|
||||
FUZZ_TARGET(multiplication_overflow)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
TestMultiplicationOverflow<int64_t>(fuzzed_data_provider);
|
||||
TestMultiplicationOverflow<uint64_t>(fuzzed_data_provider);
|
||||
TestMultiplicationOverflow<int32_t>(fuzzed_data_provider);
|
||||
TestMultiplicationOverflow<uint32_t>(fuzzed_data_provider);
|
||||
TestMultiplicationOverflow<int16_t>(fuzzed_data_provider);
|
||||
TestMultiplicationOverflow<uint16_t>(fuzzed_data_provider);
|
||||
TestMultiplicationOverflow<char>(fuzzed_data_provider);
|
||||
TestMultiplicationOverflow<unsigned char>(fuzzed_data_provider);
|
||||
TestMultiplicationOverflow<signed char>(fuzzed_data_provider);
|
||||
}
|
||||
96
src/test/fuzz/net.cpp
Normal file
96
src/test/fuzz/net.cpp
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <chainparams.h>
|
||||
#include <chainparamsbase.h>
|
||||
#include <net.h>
|
||||
#include <net_permissions.h>
|
||||
#include <netaddress.h>
|
||||
#include <protocol.h>
|
||||
#include <random.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <test/util/net.h>
|
||||
#include <test/util/setup_common.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
void initialize_net()
|
||||
{
|
||||
static const auto testing_setup = MakeNoLogFileContext<>(CBaseChainParams::MAIN);
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(net, initialize_net)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
SetMockTime(ConsumeTime(fuzzed_data_provider));
|
||||
CNode node{ConsumeNode(fuzzed_data_provider)};
|
||||
node.SetCommonVersion(fuzzed_data_provider.ConsumeIntegral<int>());
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
node.CloseSocketDisconnect();
|
||||
},
|
||||
[&] {
|
||||
node.MaybeSetAddrName(fuzzed_data_provider.ConsumeRandomLengthString(32));
|
||||
},
|
||||
[&] {
|
||||
const std::vector<bool> asmap = ConsumeRandomLengthBitVector(fuzzed_data_provider);
|
||||
if (!SanityCheckASMap(asmap)) {
|
||||
return;
|
||||
}
|
||||
CNodeStats stats;
|
||||
node.copyStats(stats, asmap);
|
||||
},
|
||||
[&] {
|
||||
const CNode* add_ref_node = node.AddRef();
|
||||
assert(add_ref_node == &node);
|
||||
},
|
||||
[&] {
|
||||
if (node.GetRefCount() > 0) {
|
||||
node.Release();
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
const std::optional<CInv> inv_opt = ConsumeDeserializable<CInv>(fuzzed_data_provider);
|
||||
if (!inv_opt) {
|
||||
return;
|
||||
}
|
||||
node.AddKnownTx(inv_opt->hash);
|
||||
},
|
||||
[&] {
|
||||
node.PushTxInventory(ConsumeUInt256(fuzzed_data_provider));
|
||||
},
|
||||
[&] {
|
||||
const std::optional<CService> service_opt = ConsumeDeserializable<CService>(fuzzed_data_provider);
|
||||
if (!service_opt) {
|
||||
return;
|
||||
}
|
||||
node.SetAddrLocal(*service_opt);
|
||||
},
|
||||
[&] {
|
||||
const std::vector<uint8_t> b = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
bool complete;
|
||||
node.ReceiveMsgBytes(b, complete);
|
||||
});
|
||||
}
|
||||
|
||||
(void)node.GetAddrLocal();
|
||||
(void)node.GetAddrName();
|
||||
(void)node.GetId();
|
||||
(void)node.GetLocalNonce();
|
||||
(void)node.GetLocalServices();
|
||||
const int ref_count = node.GetRefCount();
|
||||
assert(ref_count >= 0);
|
||||
(void)node.GetCommonVersion();
|
||||
|
||||
const NetPermissionFlags net_permission_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS);
|
||||
(void)node.HasPermission(net_permission_flags);
|
||||
(void)node.ConnectedThroughNetwork();
|
||||
}
|
||||
41
src/test/fuzz/net_permissions.cpp
Normal file
41
src/test/fuzz/net_permissions.cpp
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <net_permissions.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <util/translation.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(net_permissions)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
const std::string s = fuzzed_data_provider.ConsumeRandomLengthString(32);
|
||||
const NetPermissionFlags net_permission_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS);
|
||||
|
||||
NetWhitebindPermissions net_whitebind_permissions;
|
||||
bilingual_str error_net_whitebind_permissions;
|
||||
if (NetWhitebindPermissions::TryParse(s, net_whitebind_permissions, error_net_whitebind_permissions)) {
|
||||
(void)NetPermissions::ToStrings(net_whitebind_permissions.m_flags);
|
||||
(void)NetPermissions::AddFlag(net_whitebind_permissions.m_flags, net_permission_flags);
|
||||
assert(NetPermissions::HasFlag(net_whitebind_permissions.m_flags, net_permission_flags));
|
||||
(void)NetPermissions::ClearFlag(net_whitebind_permissions.m_flags, NetPermissionFlags::Implicit);
|
||||
(void)NetPermissions::ToStrings(net_whitebind_permissions.m_flags);
|
||||
}
|
||||
|
||||
NetWhitelistPermissions net_whitelist_permissions;
|
||||
bilingual_str error_net_whitelist_permissions;
|
||||
if (NetWhitelistPermissions::TryParse(s, net_whitelist_permissions, error_net_whitelist_permissions)) {
|
||||
(void)NetPermissions::ToStrings(net_whitelist_permissions.m_flags);
|
||||
(void)NetPermissions::AddFlag(net_whitelist_permissions.m_flags, net_permission_flags);
|
||||
assert(NetPermissions::HasFlag(net_whitelist_permissions.m_flags, net_permission_flags));
|
||||
(void)NetPermissions::ClearFlag(net_whitelist_permissions.m_flags, NetPermissionFlags::Implicit);
|
||||
(void)NetPermissions::ToStrings(net_whitelist_permissions.m_flags);
|
||||
}
|
||||
}
|
||||
102
src/test/fuzz/netaddress.cpp
Normal file
102
src/test/fuzz/netaddress.cpp
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
// Copyright (c) 2020-2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <netaddress.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(netaddress)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
|
||||
const CNetAddr net_addr = ConsumeNetAddr(fuzzed_data_provider);
|
||||
(void)net_addr.GetHash();
|
||||
(void)net_addr.GetNetClass();
|
||||
if (net_addr.GetNetwork() == Network::NET_IPV4) {
|
||||
assert(net_addr.IsIPv4());
|
||||
}
|
||||
if (net_addr.GetNetwork() == Network::NET_IPV6) {
|
||||
assert(net_addr.IsIPv6());
|
||||
}
|
||||
if (net_addr.GetNetwork() == Network::NET_ONION) {
|
||||
assert(net_addr.IsTor());
|
||||
}
|
||||
if (net_addr.GetNetwork() == Network::NET_INTERNAL) {
|
||||
assert(net_addr.IsInternal());
|
||||
}
|
||||
if (net_addr.GetNetwork() == Network::NET_UNROUTABLE) {
|
||||
assert(!net_addr.IsRoutable());
|
||||
}
|
||||
(void)net_addr.IsBindAny();
|
||||
if (net_addr.IsInternal()) {
|
||||
assert(net_addr.GetNetwork() == Network::NET_INTERNAL);
|
||||
}
|
||||
if (net_addr.IsIPv4()) {
|
||||
assert(net_addr.GetNetwork() == Network::NET_IPV4 || net_addr.GetNetwork() == Network::NET_UNROUTABLE);
|
||||
}
|
||||
if (net_addr.IsIPv6()) {
|
||||
assert(net_addr.GetNetwork() == Network::NET_IPV6 || net_addr.GetNetwork() == Network::NET_UNROUTABLE);
|
||||
}
|
||||
(void)net_addr.IsLocal();
|
||||
if (net_addr.IsRFC1918() || net_addr.IsRFC2544() || net_addr.IsRFC6598() || net_addr.IsRFC5737() || net_addr.IsRFC3927()) {
|
||||
assert(net_addr.IsIPv4());
|
||||
}
|
||||
(void)net_addr.IsRFC2544();
|
||||
if (net_addr.IsRFC3849() || net_addr.IsRFC3964() || net_addr.IsRFC4380() || net_addr.IsRFC4843() || net_addr.IsRFC7343() || net_addr.IsRFC4862() || net_addr.IsRFC6052() || net_addr.IsRFC6145()) {
|
||||
assert(net_addr.IsIPv6());
|
||||
}
|
||||
(void)net_addr.IsRFC3927();
|
||||
(void)net_addr.IsRFC3964();
|
||||
if (net_addr.IsRFC4193()) {
|
||||
assert(net_addr.GetNetwork() == Network::NET_INTERNAL || net_addr.GetNetwork() == Network::NET_UNROUTABLE);
|
||||
}
|
||||
(void)net_addr.IsRFC4380();
|
||||
(void)net_addr.IsRFC4843();
|
||||
(void)net_addr.IsRFC4862();
|
||||
(void)net_addr.IsRFC5737();
|
||||
(void)net_addr.IsRFC6052();
|
||||
(void)net_addr.IsRFC6145();
|
||||
(void)net_addr.IsRFC6598();
|
||||
(void)net_addr.IsRFC7343();
|
||||
if (!net_addr.IsRoutable()) {
|
||||
assert(net_addr.GetNetwork() == Network::NET_UNROUTABLE || net_addr.GetNetwork() == Network::NET_INTERNAL);
|
||||
}
|
||||
if (net_addr.IsTor()) {
|
||||
assert(net_addr.GetNetwork() == Network::NET_ONION);
|
||||
}
|
||||
(void)net_addr.IsValid();
|
||||
(void)net_addr.ToString();
|
||||
(void)net_addr.ToStringIP();
|
||||
|
||||
const CSubNet sub_net{net_addr, fuzzed_data_provider.ConsumeIntegral<uint8_t>()};
|
||||
(void)sub_net.IsValid();
|
||||
(void)sub_net.ToString();
|
||||
|
||||
const CService service{net_addr, fuzzed_data_provider.ConsumeIntegral<uint16_t>()};
|
||||
(void)service.GetKey();
|
||||
(void)service.GetPort();
|
||||
(void)service.ToString();
|
||||
(void)service.ToStringIPPort();
|
||||
(void)service.ToStringPort();
|
||||
|
||||
const CNetAddr other_net_addr = ConsumeNetAddr(fuzzed_data_provider);
|
||||
(void)net_addr.GetReachabilityFrom(&other_net_addr);
|
||||
(void)sub_net.Match(other_net_addr);
|
||||
|
||||
const CService other_service{net_addr, fuzzed_data_provider.ConsumeIntegral<uint16_t>()};
|
||||
assert((service == other_service) != (service != other_service));
|
||||
(void)(service < other_service);
|
||||
|
||||
const CSubNet sub_net_copy_1{net_addr, other_net_addr};
|
||||
const CSubNet sub_net_copy_2{net_addr};
|
||||
|
||||
CNetAddr mutable_net_addr;
|
||||
mutable_net_addr.SetIP(net_addr);
|
||||
assert(net_addr == mutable_net_addr);
|
||||
}
|
||||
71
src/test/fuzz/netbase_dns_lookup.cpp
Normal file
71
src/test/fuzz/netbase_dns_lookup.cpp
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
// Copyright (c) 2021 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <netaddress.h>
|
||||
#include <netbase.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(netbase_dns_lookup)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
const std::string name = fuzzed_data_provider.ConsumeRandomLengthString(512);
|
||||
const unsigned int max_results = fuzzed_data_provider.ConsumeIntegral<unsigned int>();
|
||||
const bool allow_lookup = fuzzed_data_provider.ConsumeBool();
|
||||
const uint16_t default_port = fuzzed_data_provider.ConsumeIntegral<uint16_t>();
|
||||
|
||||
auto fuzzed_dns_lookup_function = [&](const std::string&, bool) {
|
||||
std::vector<CNetAddr> resolved_addresses;
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
resolved_addresses.push_back(ConsumeNetAddr(fuzzed_data_provider));
|
||||
}
|
||||
return resolved_addresses;
|
||||
};
|
||||
|
||||
{
|
||||
std::vector<CNetAddr> resolved_addresses;
|
||||
if (LookupHost(name, resolved_addresses, max_results, allow_lookup, fuzzed_dns_lookup_function)) {
|
||||
for (const CNetAddr& resolved_address : resolved_addresses) {
|
||||
assert(!resolved_address.IsInternal());
|
||||
}
|
||||
}
|
||||
assert(resolved_addresses.size() <= max_results || max_results == 0);
|
||||
}
|
||||
{
|
||||
CNetAddr resolved_address;
|
||||
if (LookupHost(name, resolved_address, allow_lookup, fuzzed_dns_lookup_function)) {
|
||||
assert(!resolved_address.IsInternal());
|
||||
}
|
||||
}
|
||||
{
|
||||
std::vector<CService> resolved_services;
|
||||
if (Lookup(name, resolved_services, default_port, allow_lookup, max_results, fuzzed_dns_lookup_function)) {
|
||||
for (const CNetAddr& resolved_service : resolved_services) {
|
||||
assert(!resolved_service.IsInternal());
|
||||
}
|
||||
}
|
||||
assert(resolved_services.size() <= max_results || max_results == 0);
|
||||
}
|
||||
{
|
||||
CService resolved_service;
|
||||
if (Lookup(name, resolved_service, default_port, allow_lookup, fuzzed_dns_lookup_function)) {
|
||||
assert(!resolved_service.IsInternal());
|
||||
}
|
||||
}
|
||||
{
|
||||
CService resolved_service = LookupNumeric(name, default_port, fuzzed_dns_lookup_function);
|
||||
assert(!resolved_service.IsInternal());
|
||||
}
|
||||
{
|
||||
CSubNet resolved_subnet;
|
||||
if (LookupSubNet(name, resolved_subnet, fuzzed_dns_lookup_function)) {
|
||||
assert(resolved_subnet.IsValid());
|
||||
}
|
||||
}
|
||||
}
|
||||
44
src/test/fuzz/node_eviction.cpp
Normal file
44
src/test/fuzz/node_eviction.cpp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// Copyright (c) 2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <net.h>
|
||||
#include <protocol.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(node_eviction)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
std::vector<NodeEvictionCandidate> eviction_candidates;
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
eviction_candidates.push_back({
|
||||
/* id */ fuzzed_data_provider.ConsumeIntegral<NodeId>(),
|
||||
/* nTimeConnected */ fuzzed_data_provider.ConsumeIntegral<int64_t>(),
|
||||
/* m_min_ping_time */ std::chrono::microseconds{fuzzed_data_provider.ConsumeIntegral<int64_t>()},
|
||||
/* nLastBlockTime */ fuzzed_data_provider.ConsumeIntegral<int64_t>(),
|
||||
/* nLastTXTime */ fuzzed_data_provider.ConsumeIntegral<int64_t>(),
|
||||
/* fRelevantServices */ fuzzed_data_provider.ConsumeBool(),
|
||||
/* fRelayTxes */ fuzzed_data_provider.ConsumeBool(),
|
||||
/* fBloomFilter */ fuzzed_data_provider.ConsumeBool(),
|
||||
/* nKeyedNetGroup */ fuzzed_data_provider.ConsumeIntegral<uint64_t>(),
|
||||
/* prefer_evict */ fuzzed_data_provider.ConsumeBool(),
|
||||
/* m_is_local */ fuzzed_data_provider.ConsumeBool(),
|
||||
/* m_network */ fuzzed_data_provider.PickValueInArray(ALL_NETWORKS),
|
||||
});
|
||||
}
|
||||
// Make a copy since eviction_candidates may be in some valid but otherwise
|
||||
// indeterminate state after the SelectNodeToEvict(&&) call.
|
||||
const std::vector<NodeEvictionCandidate> eviction_candidates_copy = eviction_candidates;
|
||||
const std::optional<NodeId> node_to_evict = SelectNodeToEvict(std::move(eviction_candidates));
|
||||
if (node_to_evict) {
|
||||
assert(std::any_of(eviction_candidates_copy.begin(), eviction_candidates_copy.end(), [&node_to_evict](const NodeEvictionCandidate& eviction_candidate) { return *node_to_evict == eviction_candidate.id; }));
|
||||
}
|
||||
}
|
||||
85
src/test/fuzz/p2p_transport_serialization.cpp
Normal file
85
src/test/fuzz/p2p_transport_serialization.cpp
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
// Copyright (c) 2019-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <chainparams.h>
|
||||
#include <hash.h>
|
||||
#include <net.h>
|
||||
#include <netmessagemaker.h>
|
||||
#include <protocol.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
void initialize_p2p_transport_serialization()
|
||||
{
|
||||
SelectParams(CBaseChainParams::REGTEST);
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(p2p_transport_serialization, initialize_p2p_transport_serialization)
|
||||
{
|
||||
// Construct deserializer, with a dummy NodeId
|
||||
V1TransportDeserializer deserializer{Params(), (NodeId)0, SER_NETWORK, INIT_PROTO_VERSION};
|
||||
V1TransportSerializer serializer{};
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
|
||||
auto checksum_assist = fuzzed_data_provider.ConsumeBool();
|
||||
auto magic_bytes_assist = fuzzed_data_provider.ConsumeBool();
|
||||
std::vector<uint8_t> mutable_msg_bytes;
|
||||
|
||||
auto header_bytes_remaining = CMessageHeader::HEADER_SIZE;
|
||||
if (magic_bytes_assist) {
|
||||
auto msg_start = Params().MessageStart();
|
||||
for (size_t i = 0; i < CMessageHeader::MESSAGE_SIZE_SIZE; ++i) {
|
||||
mutable_msg_bytes.push_back(msg_start[i]);
|
||||
}
|
||||
header_bytes_remaining -= CMessageHeader::MESSAGE_SIZE_SIZE;
|
||||
}
|
||||
|
||||
if (checksum_assist) {
|
||||
header_bytes_remaining -= CMessageHeader::CHECKSUM_SIZE;
|
||||
}
|
||||
|
||||
auto header_random_bytes = fuzzed_data_provider.ConsumeBytes<uint8_t>(header_bytes_remaining);
|
||||
mutable_msg_bytes.insert(mutable_msg_bytes.end(), header_random_bytes.begin(), header_random_bytes.end());
|
||||
auto payload_bytes = fuzzed_data_provider.ConsumeRemainingBytes<uint8_t>();
|
||||
|
||||
if (checksum_assist && mutable_msg_bytes.size() == CMessageHeader::CHECKSUM_OFFSET) {
|
||||
CHash256 hasher;
|
||||
unsigned char hsh[32];
|
||||
hasher.Write(payload_bytes);
|
||||
hasher.Finalize(hsh);
|
||||
for (size_t i = 0; i < CMessageHeader::CHECKSUM_SIZE; ++i) {
|
||||
mutable_msg_bytes.push_back(hsh[i]);
|
||||
}
|
||||
}
|
||||
|
||||
mutable_msg_bytes.insert(mutable_msg_bytes.end(), payload_bytes.begin(), payload_bytes.end());
|
||||
Span<const uint8_t> msg_bytes{mutable_msg_bytes};
|
||||
while (msg_bytes.size() > 0) {
|
||||
const int handled = deserializer.Read(msg_bytes);
|
||||
if (handled < 0) {
|
||||
break;
|
||||
}
|
||||
if (deserializer.Complete()) {
|
||||
const std::chrono::microseconds m_time{std::numeric_limits<int64_t>::max()};
|
||||
uint32_t out_err_raw_size{0};
|
||||
std::optional<CNetMessage> result{deserializer.GetMessage(m_time, out_err_raw_size)};
|
||||
if (result) {
|
||||
assert(result->m_command.size() <= CMessageHeader::COMMAND_SIZE);
|
||||
assert(result->m_raw_message_size <= mutable_msg_bytes.size());
|
||||
assert(result->m_raw_message_size == CMessageHeader::HEADER_SIZE + result->m_message_size);
|
||||
assert(result->m_time == m_time);
|
||||
|
||||
std::vector<unsigned char> header;
|
||||
auto msg = CNetMsgMaker{result->m_recv.GetVersion()}.Make(result->m_command, MakeUCharSpan(result->m_recv));
|
||||
serializer.prepareForTransport(msg, header);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
src/test/fuzz/parse_hd_keypath.cpp
Normal file
23
src/test/fuzz/parse_hd_keypath.cpp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// Copyright (c) 2009-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <test/fuzz/util.h>
|
||||
#include <util/bip32.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(parse_hd_keypath)
|
||||
{
|
||||
const std::string keypath_str(buffer.begin(), buffer.end());
|
||||
std::vector<uint32_t> keypath;
|
||||
(void)ParseHDKeypath(keypath_str, keypath);
|
||||
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
const std::vector<uint32_t> random_keypath = ConsumeRandomLengthIntegralVector<uint32_t>(fuzzed_data_provider);
|
||||
(void)FormatHDKeypath(random_keypath);
|
||||
(void)WriteHDKeypath(random_keypath);
|
||||
}
|
||||
32
src/test/fuzz/parse_iso8601.cpp
Normal file
32
src/test/fuzz/parse_iso8601.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright (c) 2019-2020 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
#include <util/time.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
FUZZ_TARGET(parse_iso8601)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
|
||||
const int64_t random_time = fuzzed_data_provider.ConsumeIntegral<int32_t>();
|
||||
const std::string random_string = fuzzed_data_provider.ConsumeRemainingBytesAsString();
|
||||
|
||||
const std::string iso8601_datetime = FormatISO8601DateTime(random_time);
|
||||
const int64_t parsed_time_1 = ParseISO8601DateTime(iso8601_datetime);
|
||||
if (random_time >= 0) {
|
||||
assert(parsed_time_1 >= 0);
|
||||
if (iso8601_datetime.length() == 20) {
|
||||
assert(parsed_time_1 == random_time);
|
||||
}
|
||||
}
|
||||
|
||||
const int64_t parsed_time_2 = ParseISO8601DateTime(random_string);
|
||||
assert(parsed_time_2 >= 0);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue