Various updates

This commit is contained in:
Duke Leto
2020-12-08 14:37:58 -05:00
parent fc5c773d66
commit 4fd9ae6f94
6 changed files with 28 additions and 35 deletions

View File

@@ -8,13 +8,9 @@
#define HUSH_SUPPORT_ALLOCATORS_SECURE_H #define HUSH_SUPPORT_ALLOCATORS_SECURE_H
#include "support/pagelocker.h" #include "support/pagelocker.h"
#include <string> #include <string>
//
// Allocator that locks its contents from being paged // Allocator that locks its contents from being paged
// out of memory and clears its contents before deletion. // out of memory and clears its contents before deletion.
//
template <typename T> template <typename T>
struct secure_allocator : public std::allocator<T> { struct secure_allocator : public std::allocator<T> {
// MSVC8 default copy constructor is broken // MSVC8 default copy constructor is broken

View File

@@ -1,13 +1,13 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2013 The Bitcoin Core developers // Copyright (c) 2009-2013 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying // Copyright (c) 2019-2020 The Hush developers
// Distributed under the GPLv3 software license, see the accompanying
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#ifndef BITCOIN_SUPPORT_ALLOCATORS_ZEROAFTERFREE_H #ifndef HUSH_SUPPORT_ALLOCATORS_ZEROAFTERFREE_H
#define BITCOIN_SUPPORT_ALLOCATORS_ZEROAFTERFREE_H #define HUSH_SUPPORT_ALLOCATORS_ZEROAFTERFREE_H
#include "support/cleanse.h" #include "support/cleanse.h"
#include <memory> #include <memory>
#include <vector> #include <vector>
@@ -45,4 +45,4 @@ struct zero_after_free_allocator : public std::allocator<T> {
// Byte-vector that clears its contents before deletion. // Byte-vector that clears its contents before deletion.
typedef std::vector<char, zero_after_free_allocator<char> > CSerializeData; typedef std::vector<char, zero_after_free_allocator<char> > CSerializeData;
#endif // BITCOIN_SUPPORT_ALLOCATORS_ZEROAFTERFREE_H #endif // HUSH_SUPPORT_ALLOCATORS_ZEROAFTERFREE_H

View File

@@ -1,6 +1,7 @@
# Copyright 2014 BitPay, Inc. # Copyright 2014 BitPay, Inc.
# Distributed under the MIT software license, see the accompanying # Copyright (c) 2019-2020 The Hush developers
# file COPYING or https://www.opensource.org/licenses/mit-license.php # Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
import subprocess import subprocess
import json import json

View File

@@ -1,12 +1,9 @@
Description # Data-Driven Hush Tests
------------
This directory contains data-driven tests for various aspects of Bitcoin. This directory contains data-driven tests for various aspects of Hush
License # License
--------
The data files in this directory are distributed under the MIT software Distributed under the GPLv3 software license, see the accompanying
license, see the accompanying file COPYING or file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
https://www.opensource.org/licenses/mit-license.php

View File

@@ -1,7 +1,8 @@
#!/usr/bin/python #!/usr/bin/python
# Copyright 2014 BitPay, Inc. # Copyright 2014 BitPay, Inc.
# Distributed under the MIT software license, see the accompanying # Copyright (c) 2019-2020 The Hush developers
# file COPYING or https://www.opensource.org/licenses/mit-license.php ## Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
import subprocess import subprocess
import os import os
@@ -29,9 +30,9 @@ if __name__ == '__main__':
output = json.loads(outs[0]) output = json.loads(outs[0])
assert_equal(output[0], "13EngsxkRi7SJPPqCyJsKf34U8FoX9E9Av") assert_equal(output[0], "R3EngsxkRi7SJPPqCyJsKf34U8FoX9E9Av")
assert_equal(output[1], "1FKCLGTpPeYBUqfNxktck8k5nqxB8sjim8") assert_equal(output[1], "RFKCLGTpPeYBUqfNxktck8k5nqxB8sjim8")
assert_equal(output[2], "13cdtE9tnNeXCZJ8KQ5WELgEmLSBLnr48F") assert_equal(output[2], "R3cdtE9tnNeXCZJ8KQ5WELgEmLSBLnr48F")
execargs = '-datadir=' + datadir + ' -dumppass' execargs = '-datadir=' + datadir + ' -dumppass'
execrun = execprog + ' ' + execargs execrun = execprog + ' ' + execargs
@@ -45,12 +46,12 @@ if __name__ == '__main__':
output = json.loads(outs[0]) output = json.loads(outs[0])
assert_equal(output[0]['addr'], "13EngsxkRi7SJPPqCyJsKf34U8FoX9E9Av") assert_equal(output[0]['addr'], "R3EngsxkRi7SJPPqCyJsKf34U8FoX9E9Av")
assert_equal(output[0]['pkey'], "5Jz5BWE2WQxp1hGqDZeisQFV1mRFR2AVBAgiXCbNcZyXNjD9aUd") assert_equal(output[0]['pkey'], "UJz5BWE2WQxp1hGqDZeisQFV1mRFR2AVBAgiXCbNcZyXNjD9aUd")
assert_equal(output[1]['addr'], "1FKCLGTpPeYBUqfNxktck8k5nqxB8sjim8") assert_equal(output[1]['addr'], "RFKCLGTpPeYBUqfNxktck8k5nqxB8sjim8")
assert_equal(output[1]['pkey'], "5HsX2b3v2GjngYQ5ZM4mLp2b2apw6aMNVaPELV1YmpiYR1S4jzc") assert_equal(output[1]['pkey'], "UHsX2b3v2GjngYQ5ZM4mLp2b2apw6aMNVaPELV1YmpiYR1S4jzc")
assert_equal(output[2]['addr'], "13cdtE9tnNeXCZJ8KQ5WELgEmLSBLnr48F") assert_equal(output[2]['addr'], "R3cdtE9tnNeXCZJ8KQ5WELgEmLSBLnr48F")
assert_equal(output[2]['pkey'], "5KCWAs1wX2ESiL4PfDR8XYVSSETHFd2jaRGxt1QdanBFTit4XcH") assert_equal(output[2]['pkey'], "UKCWAs1wX2ESiL4PfDR8XYVSSETHFd2jaRGxt1QdanBFTit4XcH")
if os.path.exists(datadir + '/database'): if os.path.exists(datadir + '/database'):
if os.path.isdir(datadir + '/database'): if os.path.isdir(datadir + '/database'):

View File

@@ -1,16 +1,14 @@
// Copyright (c) 2012-2014 The Bitcoin Core developers // Copyright (c) 2012-2014 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying // Copyright (c) 2019-2020 The Hush developers
// Distributed under the GPLv3 software license, see the accompanying
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#include "wallet/wallet.h" #include "wallet/wallet.h"
#include <set> #include <set>
#include <stdint.h> #include <stdint.h>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "test/test_bitcoin.h" #include "test/test_bitcoin.h"
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>