diff --git a/Dockerfile b/Dockerfile index a0334a6f6..b011397d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 FROM ubuntu:16.04 diff --git a/INSTALL.md b/INSTALL.md index c13109788..51edd9fdb 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -2,12 +2,6 @@ Instructions to compile Hush yourself. -## Build HUSH dependencies - -The following build process generally applies to Ubuntu (and similar) Linux -distributions. For best results it is recommended to use Ubuntu Linux 16.04 -or later. - ## Swap Space (Optional) You will need at least 4GB of RAM to build hush from git source, OR you can enable a swap file. To enable a 4GB swap file on modern Linux distributions: @@ -19,7 +13,7 @@ sudo mkswap /swapfile sudo swapon /swapfile ``` -## Build on Linux: +## Build on Debian/Ubuntu: ```sh # install build dependencies @@ -34,6 +28,32 @@ cd hush3 ./build.sh -j3 ``` +## Build on Arch: + +```sh +# install build dependencies +sudo pacman -S gcc libsodium lib32-zlib unzip wget git python rust curl autoconf cmake +# clone git repo +git clone https://git.hush.is/hush/hush3 +cd hush3 +# Build +# This uses 3 build processes, you need 2GB of RAM for each. +./build.sh -j3 +``` + +## Build on Fedora: + +```sh +# install build dependencies +sudo dnf install make automake gcc gcc-c++ kernel-devel cmake libtool ncurses-devel patch -y +# clone git repo +git clone https://git.hush.is/hush/hush3 +cd hush3 +# Build +# This uses 3 build processes, you need 2GB of RAM for each. +./build.sh -j3 +``` + ### Building On Ubuntu 16.04 and older systems Some older compilers may not be able to compile modern code, such as gcc 5.4 which comes with Ubuntu 16.04 by default. Here is how to install gcc 7 on Ubuntu 16.04. Run these commands as root: @@ -46,7 +66,7 @@ apt-get install -y gcc-7 g++-7 && \ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 ``` -### Build on mac +### Build on Mac These instructions are a work in progress. Please report issues to https://hush.is/tg_support diff --git a/Makefile.am b/Makefile.am index 01c95f8b7..ace177a9d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -# Copyright 2016-2023 The Hush developers +# Copyright 2016-2024 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 diff --git a/autogen.sh b/autogen.sh index 3bb329a96..9bcdaf768 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 set -e diff --git a/build.sh b/build.sh index 7bdf5f93d..d73119a08 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 diff --git a/configure.ac b/configure.ac index 77671e2c5..ffcf18ad8 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 3) dnl Must be kept in sync with src/clientversion.h , ugh! define(_CLIENT_VERSION_MINOR, 10) -define(_CLIENT_VERSION_REVISION, 1) +define(_CLIENT_VERSION_REVISION, 2) define(_CLIENT_VERSION_BUILD, 50) define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50))) define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1))) @@ -922,7 +922,7 @@ unset PKG_CONFIG_LIBDIR PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP" ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no --enable-module-recovery" -AC_CONFIG_SUBDIRS([src/secp256k1 src/univalue src/cryptoconditions]) +AC_CONFIG_SUBDIRS([src/secp256k1 src/univalue]) AC_OUTPUT diff --git a/contrib/block_time.pl b/contrib/block_time.pl index 0a9bf6e53..3e3cf014d 100755 --- a/contrib/block_time.pl +++ b/contrib/block_time.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 use warnings; diff --git a/contrib/dragonx_scanner b/contrib/dragonx_scanner new file mode 100755 index 000000000..8e11610ae --- /dev/null +++ b/contrib/dragonx_scanner @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# Copyright (c) 2016-2024 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 + +P2PPORT=21768 RPCPORT=21769 ./hush_scanner diff --git a/contrib/fresh_clone_compile_and_run.sh b/contrib/fresh_clone_compile_and_run.sh index 5566e4474..93b134f83 100755 --- a/contrib/fresh_clone_compile_and_run.sh +++ b/contrib/fresh_clone_compile_and_run.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 diff --git a/contrib/gen-zaddrs.pl b/contrib/gen-zaddrs.pl index 801cc680a..c5abc57e4 100755 --- a/contrib/gen-zaddrs.pl +++ b/contrib/gen-zaddrs.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# Copyright 2019-2023 The Hush developers +# Copyright 2019-2024 The Hush developers # Released under the GPLv3 use warnings; use strict; diff --git a/contrib/hush_halvings b/contrib/hush_halvings index 4d93cfce4..c902f7bbf 100755 --- a/contrib/hush_halvings +++ b/contrib/hush_halvings @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Released under the GPLv3 use strict; diff --git a/contrib/hush_scanner b/contrib/hush_scanner index 5f92586f5..24ffb799b 100755 --- a/contrib/hush_scanner +++ b/contrib/hush_scanner @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 use strict; @@ -16,6 +16,13 @@ print "HOST P2P RPC\n"; while (<>) { chomp; my $host = $_; + + # skip empty lines + next unless $host; + + # skip comment lines + next if ($host =~ m/^#/); + my $p2pport = $ENV{P2PPORT} || 18030; my $rpcport = $ENV{RPCPORT} || $p2pport + 1; my $cmd1 = qq{nc -z -w2 $host $p2pport}; diff --git a/contrib/hush_seed_nodes.txt b/contrib/hush_seed_nodes.txt new file mode 100644 index 000000000..d176dc884 --- /dev/null +++ b/contrib/hush_seed_nodes.txt @@ -0,0 +1,35 @@ +# This is a list of nodes which hushd attempts to connect to automatically +# at start up time. You can check to see if they are up/down with: +# cd contrib; cat hush_seed_nodes.txt | ./hush_scanner + +# IP/tor/i2p seeds from src/chainparamsseeds.h +185.241.61.43 +87.251.76.166 +45.82.68.233 +87.251.76.33 +137.74.4.198 +149.28.102.219 +155.138.228.68 +107.174.70.251 +# hush_scanner uses nc which cannot deal with these +# 56wqzfj6mhxgsv3h3nh3pdocguogxfxud55libqjhjsdh5alfsko2iqd.onion +# hushv3h6mbxd2pptj42reko3jcexcgnz5zvp3mqcu6myto3jhhn4yzyd.onion +# hushv3xvheqh42ms3ld2nh555muscietkib7gycb7s4psbrjsysfywqd.onion +# iljqq7nnmw2ij2ezl334cerwwmgzmmbmoc3n4saditd2xhi3xohq.b32.i2p +# [2a0c:b641:6f1:34::2] +# [2a0c:b641:6f1:c::2] + +# Hostname Seeds from src/hush_utils.h +node1.hush.is +node2.hush.is +node3.hush.is +node4.hush.is +node5.hush.is +node6.hush.is +node7.hush.is +node8.hush.is +node1.hush.land +node2.hush.land +node3.hush.land +node4.hush.land +node5.hush.land diff --git a/contrib/hush_supply b/contrib/hush_supply index 8f3705d81..c02abd66c 100755 --- a/contrib/hush_supply +++ b/contrib/hush_supply @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Released under the GPLv3 use warnings; use strict; diff --git a/contrib/sdl_checkpoints.pl b/contrib/sdl_checkpoints.pl index ef4aa3dbe..8b7ea54ea 100755 --- a/contrib/sdl_checkpoints.pl +++ b/contrib/sdl_checkpoints.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 diff --git a/contrib/seeds/README.md b/contrib/seeds/README.md index 06035bb72..10948e1b4 100644 --- a/contrib/seeds/README.md +++ b/contrib/seeds/README.md @@ -5,6 +5,6 @@ Utility to generate the seeds.txt list that is compiled into the client ## Updating seeds -Update [contrib/seeds/nodes_main.txt](hush/hush3/src/branch/master/contrib/seeds/nodes_main.txt) and run `make seeds` in the root directory of this repo to update [src/chainparamsseeds.h](hush/hush3/src/branch/master/src/chainparamsseeds.h) then commit the result. +Update [contrib/seeds/nodes_main.txt](hush/hush3/src/branch/master/contrib/seeds/nodes_main.txt) and run `make seeds` in the hush root directory of this repo (not the directory of this README) to update [src/chainparamsseeds.h](hush/hush3/src/branch/master/src/chainparamsseeds.h) then commit the result. diff --git a/contrib/seeds/generate-seeds.py b/contrib/seeds/generate-seeds.py index 8b31529f9..46c44ae3e 100755 --- a/contrib/seeds/generate-seeds.py +++ b/contrib/seeds/generate-seeds.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014-2021 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -160,7 +160,7 @@ def main(): sys.exit(1) g = sys.stdout indir = sys.argv[1] - g.write('// Copyright (c) 2016-2023 The Hush developers\n') + g.write('// Copyright (c) 2016-2024 The Hush developers\n') g.write('// Distributed under the GPLv3 software license, see the accompanying\n') g.write('// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html\n') g.write('// THIS FILE IS AUTOGENERATED, DO NOT MODIFY DIRECTLY\n') diff --git a/contrib/seeds/nodes_main.txt b/contrib/seeds/nodes_main.txt index 0d5e68fd4..2fc59ec5e 100644 --- a/contrib/seeds/nodes_main.txt +++ b/contrib/seeds/nodes_main.txt @@ -1,5 +1,5 @@ # node1.hush.land -185.241.61.43 +91.208.127.81 # node2.hush.land 87.251.76.166 @@ -10,8 +10,8 @@ # node4.hush.land 87.251.76.33 -# node2.hush.is -137.74.4.198 +# node5.hush.land +178.250.189.141 # lite.hushpool.is 149.28.102.219 @@ -32,4 +32,4 @@ hushv3xvheqh42ms3ld2nh555muscietkib7gycb7s4psbrjsysfywqd.onion 2a0c:b641:6f1:c::2 # i2p -iljqq7nnmw2ij2ezl334cerwwmgzmmbmoc3n4saditd2xhi3xohq.b32.i2p +7oumuppuzgbzlkahavx7qrtjnvbhkixjqdmeg7f6fhndgfhz7mlq.b32.i2p diff --git a/contrib/verify-commits/gpg.sh b/contrib/verify-commits/gpg.sh index f81b2719a..6a866d79a 100755 --- a/contrib/verify-commits/gpg.sh +++ b/contrib/verify-commits/gpg.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 INPUT=$(. diff --git a/doc/man/hush-tx.1 b/doc/man/hush-tx.1 index 5c1867b46..69b6f9477 100644 --- a/doc/man/hush-tx.1 +++ b/doc/man/hush-tx.1 @@ -1,9 +1,9 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH HUSH-TX "1" "January 2024" "hush-tx v3.10.1" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. +.TH HUSH-TX "1" "February 2024" "hush-tx v3.10.2" "User Commands" .SH NAME -hush-tx \- manual page for hush-tx v3.10.1 +hush-tx \- manual page for hush-tx v3.10.2 .SH DESCRIPTION -hush\-tx utility version v3.10.1\-05ee31891\-dirty +hush\-tx utility version v3.10.2\-138cd7ab6 .SS "Usage:" .TP hush\-tx [options] [commands] diff --git a/doc/man/hushd.1 b/doc/man/hushd.1 index 2f6fe2d2a..4164550cc 100644 --- a/doc/man/hushd.1 +++ b/doc/man/hushd.1 @@ -1,9 +1,9 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH HUSHD "1" "January 2024" "hushd v3.10.1" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. +.TH HUSHD "1" "February 2024" "hushd v3.10.2" "User Commands" .SH NAME -hushd \- manual page for hushd v3.10.1 +hushd \- manual page for hushd v3.10.2 .SH DESCRIPTION -Hush Daemon version v3.10.1\-05ee31891\-dirty +Hush Daemon version v3.10.2\-138cd7ab6 .PP In order to ensure you are adequately protecting your privacy when using Hush, please see . @@ -78,7 +78,7 @@ applied) .HP \fB\-par=\fR .IP -Set the number of script verification threads (\fB\-8\fR to 16, 0 = auto, <0 = +Set the number of script verification threads (\fB\-12\fR to 16, 0 = auto, <0 = leave that many cores free, default: 0) .HP \fB\-pid=\fR @@ -659,7 +659,7 @@ single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times .PP -Hush Smart Chain options: +Hush Arrakis Chain options: .HP \fB\-ac_algo\fR .IP @@ -670,10 +670,6 @@ Equihash (200,9) .IP Block time in seconds, default is 60 .HP -\fB\-ac_cc\fR -.IP -Cryptoconditions, default 0 -.HP \fB\-ac_beam\fR .IP BEAM integration @@ -682,18 +678,6 @@ BEAM integration .IP CODA integration .HP -\fB\-ac_cclib\fR -.IP -Cryptoconditions dynamicly loadable library -.HP -\fB\-ac_ccenable\fR -.IP -Cryptoconditions to enable -.HP -\fB\-ac_ccactivate\fR -.IP -Block height to enable Cryptoconditions -.HP \fB\-ac_decay\fR .IP Percentage of block reward decrease at each halving @@ -751,10 +735,6 @@ default is 64 .IP Block reward in satoshis, default is 0 .HP -\fB\-ac_sapling\fR -.IP -Sapling activation block height -.HP \fB\-ac_script\fR .IP P2SH/multisig address to receive founders rewards diff --git a/doc/overview.md b/doc/overview.md index 334cfe84b..27d991754 100644 --- a/doc/overview.md +++ b/doc/overview.md @@ -14,7 +14,24 @@ Equihash (200,9) (ASIC) ## P2P -TLS1.3 via WolfSSL is enforced for all network connections as of v3.6.1 +TLS1.3 via WolfSSL is enforced for all network connections as of v3.6.1 . +Many ciphersuites are technically supported by TLS1.3 but many of them +are ancient, proved to be less secure than intended or likely backdoored. +Hush only uses what are widely considered to be the most secure and [best ciphersuites](https://ciphersuite.info/cs/). + +New Hush P2P connections randomly choose between these two ciphersuites each +time a new connection to a peer is created: + + * `TLS_AES_256_GCM_SHA384` + * `TLS_CHACHA20_POLY1305_SHA256` + +Encrypted P2P connections are important because it means passive network spies, +such as ISPs, cannot tell what nodes are communicating to each other and also +prevents certain attacks against privacy at the network level, such as looking +for which node was the first to relay a transaction. Bitcoin has no protection +against this which is why it's trivial for network spies to tell which node +(and hence which IP address) created a certain transaction and hence which +IP address owns which addresses. ## RPC diff --git a/doc/relnotes/README.md b/doc/relnotes/README.md index ff09ce3a1..89d526429 100644 --- a/doc/relnotes/README.md +++ b/doc/relnotes/README.md @@ -10,6 +10,39 @@ and no longer on Github, since they banned Duke Leto and also because they censor many people around the world and work with evil organizations. +# Hush 3.10.2 "Fiendish Fenrir" + + * RandomX mining is faster for various reasons + * Large page support is enabled (needs to be enabled at OS level to be used) + * This can lead to a 1-2% speed increase in mining depending on RAM and CPU + * Various small optimizations such as making some variables static or const + and removing unnecessary conditionals + * Mining now starts faster because instead of only using 2 threads to prepare + data needed to mine, now it uses all physical cores https://git.hush.is/hush/hush3/commit/1b5422eb2ddcedd9aabdf4f039144f9eef5c6f95 + * RandomX mining takes slightly less memory + * `ac_sapling` is no longer an option for Arrakis Chains + * All chains enable Sapling at height 1 like Hush + DragonX + * This means there is no need to call `NetworkUpgradeActive` on every block height + which means syncing is faster + * Delete cryptoconditions: https://git.hush.is/hush/hush3/issues/381 + * This means Hush+DragonX full nodes take up a lot less memory and binaries are smaller + * It also means syncing, rescanning and compiling is faster + * CLI options related to CryptoConditions ( `-ac_cc -ac_cclib -ac_ccenable -ac_ccactivate) have been removed + * Upgraded WolfSSL to 5.2.0 on Linux+Mac : https://git.hush.is/hush/hush3/issues/380 + * Upgraded to 4.8.1 on Windows because newer versions do not compile on Windows: https://git.hush.is/hush/hush3/commit/5e5a15018d0e55f094c89282a1983104f4d4387a + * Only Hush + DragonX will automatically connect to various seed nodes https://git.hush.is/hush/hush3/issues/379 + * Other Arrakis Chains must opt-in via -connect or -addnode + * Updated i2p seed node: https://git.hush.is/hush/hush3/commit/8c8b6e88f0c076c86c713e7e22e2d826202cc64d + * Better error message: https://git.hush.is/hush/hush3/commit/f64c10baa9ae6940f434f6ff6750b299c1da548e, https://git.hush.is/hush/hush3/commit/f71f8124c3ffb8df6d83f6fd00201cb11aa0f239 + * Improve `hush_scanner` and seed node contrib file: https://git.hush.is/hush/hush3/commit/16dd3aef74ac312bc8953af34a3d9a297b03d9f4 + * Remove unused Makefile: https://git.hush.is/hush/hush3/issues/291 + * Add script for scanning DragonX nodes: https://git.hush.is/hush/hush3/commit/0679468f609215a0958a95edc70643108ee6530a + * Add Fedora install process: https://git.hush.is/hush/hush3/pulls/384 + * Add Arch install process: https://git.hush.is/hush/hush3/pulls/393 + * More details about p2p encryption: https://git.hush.is/hush/hush3/commit/ccc86839b9774934882fec4cbf3428003cf75fd5, https://git.hush.is/hush/hush3/commit/a358acab0b1a589cebc45846ab54f7fa751c4820, https://git.hush.is/hush/hush3/commit/4ed576a7e256abb46e15d8f3606dc30ac276d461 + * Fix boost download link: https://git.hush.is/hush/hush3/commit/323d2134a1fcc119a4da82f9fc37e912b67e58c6 + * Remove unused code + # Hush 3.10.1 "Oneiric Octopus" This is an OPTIONAL but RECOMMENDED release for Hush full nodes. It fixes an important bug diff --git a/migratecoin.sh b/migratecoin.sh index bd18bd27c..a4b05f417 100644 --- a/migratecoin.sh +++ b/migratecoin.sh @@ -1,5 +1,5 @@ #!/usr/usr/bin/env bash -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 # This script makes the neccesary transactions to migrate diff --git a/qa/hush/create_benchmark_archive.py b/qa/hush/create_benchmark_archive.py index eff50239f..15994b1a6 100644 --- a/qa/hush/create_benchmark_archive.py +++ b/qa/hush/create_benchmark_archive.py @@ -1,4 +1,5 @@ -# Copyright (c) 2016-2023 The Hush developers +#!/usr/bin/env python2 +# Copyright (c) 2016-2024 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 import binascii diff --git a/qa/hush/create_wallet_200k_utxos.py b/qa/hush/create_wallet_200k_utxos.py index 742f9bf61..b06bc3656 100644 --- a/qa/hush/create_wallet_200k_utxos.py +++ b/qa/hush/create_wallet_200k_utxos.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2017 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/hush/full-test-suite.sh b/qa/hush/full-test-suite.sh index 5113c4d8c..d20e52966 100755 --- a/qa/hush/full-test-suite.sh +++ b/qa/hush/full-test-suite.sh @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Execute all of the automated tests related to Hush # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/hush/full_test_suite.py b/qa/hush/full_test_suite.py index 183db1640..e48d4dc64 100755 --- a/qa/hush/full_test_suite.py +++ b/qa/hush/full_test_suite.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 # Execute all of the automated tests related to Hush diff --git a/qa/pull-tester/cc-tests.sh b/qa/pull-tester/cc-tests.sh deleted file mode 100755 index bfce8ff74..000000000 --- a/qa/pull-tester/cc-tests.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env bash -set -e -o pipefail - -CURDIR=$(cd $(dirname "$0"); pwd) -# Get BUILDDIR and REAL_BITCOIND -. "${CURDIR}/tests-config.sh" - -export BITCOINCLI=${BUILDDIR}/qa/pull-tester/run-bitcoin-cli -export BITCOIND=${REAL_BITCOIND} - -#Run the tests -# FAUCET test should be permanently first!!! - -testScripts=( - 'cryptoconditions_faucet.py' - 'cryptoconditions_dice.py' - 'cryptoconditions_oracles.py' - 'cryptoconditions_rewards.py' - 'cryptoconditions_token.py' - #'cryptoconditions_gateways.py' - 'cryptoconditions_heir.py' - # TODO: cant reconnect nodes back in channels test because of crash (seems regtest only specific) - 'cryptoconditions_channels.py' -); - -extArg="-extended" -passOn=${@#$extArg} - -successCount=0 -declare -a failures - -function runTestScript -{ - local testName="$1" - shift - - echo -e "=== Running testscript ${testName} ===" - - if eval "$@" - then - successCount=$(expr $successCount + 1) - echo "--- Success: ${testName} ---" - else - failures[${#failures[@]}]="$testName" - echo "!!! FAIL: ${testName} !!!" - fi - - echo -} - -if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then - for (( i = 0; i < ${#testScripts[@]}; i++ )) - do - if [ -z "$1" ] || [ "${1:0:1}" == "-" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ] - then - runTestScript \ - "${testScripts[$i]}" \ - "${BUILDDIR}/qa/rpc-tests/${testScripts[$i]}" \ - --srcdir "${BUILDDIR}/src" ${passOn} - fi - done - for (( i = 0; i < ${#testScriptsExt[@]}; i++ )) - do - if [ "$1" == $extArg ] || [ "$1" == "${testScriptsExt[$i]}" ] || [ "$1.py" == "${testScriptsExt[$i]}" ] - then - runTestScript \ - "${testScriptsExt[$i]}" \ - "${BUILDDIR}/qa/rpc-tests/${testScriptsExt[$i]}" \ - --srcdir "${BUILDDIR}/src" ${passOn} - fi - done - - echo -e "\n\nTests completed: $(expr $successCount + ${#failures[@]})" - echo "successes $successCount; failures: ${#failures[@]}" - - if [ ${#failures[@]} -gt 0 ] - then - echo -e "\nFailing tests: ${failures[*]}" - exit 1 - else - exit 0 - fi -else - echo "No rpc tests to run. Wallet, utils, and bitcoind must all be enabled" -fi diff --git a/qa/pull-tester/rpc-tests.sh b/qa/pull-tester/rpc-tests.sh index bed1a5417..a2d2ee218 100755 --- a/qa/pull-tester/rpc-tests.sh +++ b/qa/pull-tester/rpc-tests.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Released under the GPLv3 set -e -o pipefail diff --git a/qa/pull-tester/run-bitcoin-cli b/qa/pull-tester/run-bitcoin-cli index dac53df69..2eb67b505 100755 --- a/qa/pull-tester/run-bitcoin-cli +++ b/qa/pull-tester/run-bitcoin-cli @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Released under the GPLv3 # This is a thin wrapper around bitcoin-cli that strips the Windows-style EOLs diff --git a/qa/pull-tester/run-bitcoind-for-test.sh.in b/qa/pull-tester/run-bitcoind-for-test.sh.in index 07491f0a7..327dd4dc9 100755 --- a/qa/pull-tester/run-bitcoind-for-test.sh.in +++ b/qa/pull-tester/run-bitcoind-for-test.sh.in @@ -1,7 +1,7 @@ #!/usr/bin/env bash # THIS FILE IS GENERATED FROM run-bitcoind-for-test.sh.in # Copyright (c) 2013-2014 The Bitcoin Core developers -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Released under the GPLv3 # HUSH_LOAD_TIMEOUT=500 diff --git a/qa/pull-tester/tests-config.sh.in b/qa/pull-tester/tests-config.sh.in index 47546707b..52285f7e4 100755 --- a/qa/pull-tester/tests-config.sh.in +++ b/qa/pull-tester/tests-config.sh.in @@ -1,7 +1,7 @@ #!/usr/bin/env bash # THIS FILE IS GENERATED FROM tests-config.sh.in # Copyright (c) 2013-2014 The Bitcoin Core developers -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Released under the GPLv3 BUILDDIR="@abs_top_builddir@" diff --git a/qa/rpc-tests/README.md b/qa/rpc-tests/README.md index ac61e327e..4f7d116d1 100644 --- a/qa/rpc-tests/README.md +++ b/qa/rpc-tests/README.md @@ -14,8 +14,6 @@ You can run a single test by calling `qa/pull-tester/rpc-tests.sh `. Run all possible tests with `qa/pull-tester/rpc-tests.sh -extended`. -Also it's possible to run CryptoConditions tests only by `qa/pull-tester/cc-tests.sh --noshutdown --tracerpc` - Possible options: ``` diff --git a/qa/rpc-tests/ac_private.py b/qa/rpc-tests/ac_private.py index 323ca36cb..bab8f618c 100755 --- a/qa/rpc-tests/ac_private.py +++ b/qa/rpc-tests/ac_private.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 SuperNET developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/addressindex.py b/qa/rpc-tests/addressindex.py index 942c26abb..cf558f584 100755 --- a/qa/rpc-tests/addressindex.py +++ b/qa/rpc-tests/addressindex.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 # Test addressindex generation and fetching diff --git a/qa/rpc-tests/antispam.py b/qa/rpc-tests/antispam.py index 9913eef56..2610f8f89 100755 --- a/qa/rpc-tests/antispam.py +++ b/qa/rpc-tests/antispam.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 diff --git a/qa/rpc-tests/bip65-cltv-p2p.py b/qa/rpc-tests/bip65-cltv-p2p.py index 729801e07..db979927a 100755 --- a/qa/rpc-tests/bip65-cltv-p2p.py +++ b/qa/rpc-tests/bip65-cltv-p2p.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 diff --git a/qa/rpc-tests/bipdersig-p2p.py b/qa/rpc-tests/bipdersig-p2p.py index 5466ed813..77852d288 100755 --- a/qa/rpc-tests/bipdersig-p2p.py +++ b/qa/rpc-tests/bipdersig-p2p.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Distributed under the GPLv3/X11 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # diff --git a/qa/rpc-tests/blockchain.py b/qa/rpc-tests/blockchain.py index 8718559f3..86f561e96 100755 --- a/qa/rpc-tests/blockchain.py +++ b/qa/rpc-tests/blockchain.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/cryptoconditions.py b/qa/rpc-tests/cryptoconditions.py deleted file mode 100755 index 0a13cb605..000000000 --- a/qa/rpc-tests/cryptoconditions.py +++ /dev/null @@ -1,691 +0,0 @@ -#!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers -# Copyright (c) 2018 SuperNET developers -# Distributed under the GPLv3 software license, see the accompanying -# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html - -from test_framework.test_framework import BitcoinTestFramework -from test_framework.authproxy import JSONRPCException -from test_framework.util import assert_equal, assert_greater_than, \ - initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \ - stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises - -import time -from decimal import Decimal -from random import choice -from string import ascii_uppercase - -def assert_success(result): - assert_equal(result['result'], 'success') - -def assert_error(result): - assert_equal(result['result'], 'error') - -def generate_random_string(length): - random_string = ''.join(choice(ascii_uppercase) for i in range(length)) - return random_string - -class CryptoConditionsTest (BitcoinTestFramework): - - def setup_chain(self): - print("Initializing CC test directory "+self.options.tmpdir) - self.num_nodes = 2 - initialize_chain_clean(self.options.tmpdir, self.num_nodes) - - def setup_network(self, split = False): - print("Setting up network...") - self.addr = "RWPg8B91kfK5UtUN7z6s6TeV9cHSGtVY8D" - self.pubkey = "02676d00110c2cd14ae24f95969e8598f7ccfaa675498b82654a5b5bd57fc1d8cf" - self.privkey = "UqMgxk7ySPNQ4r9nKAFPjkXy6r5t898yhuNCjSZJLg3RAM4WW1m9" - self.addr1 = "RXEXoa1nRmKhMbuZovpcYwQMsicwzccZBp" - self.pubkey1 = "024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0" - self.privkey1 = "UtdydP56pGTFmawHzHr1wDrc4oUwCNW1ttX8Pc3KrvH3MA8P49Wi" - self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, - extra_args=[[ - # always give -ac_name as first extra_arg and port as third - '-ac_name=REGTEST', - '-conf='+self.options.tmpdir+'/node0/REGTEST.conf', - '-port=64367', - '-rpcport=64368', - '-regtest', - '-addressindex=1', - '-spentindex=1', - '-ac_supply=5555555', - '-ac_reward=10000000000000', - '-pubkey=' + self.pubkey, - '-ac_cc=2', - '-allowlist=127.0.0.1', - '-debug', - '--daemon', - '-rpcuser=rt', - '-rpcpassword=rt' - ], - ['-ac_name=REGTEST', - '-conf='+self.options.tmpdir+'/node1/REGTEST.conf', - '-port=64365', - '-rpcport=64366', - '-regtest', - '-addressindex=1', - '-spentindex=1', - '-ac_supply=5555555', - '-ac_reward=10000000000000', - '-pubkey=' + self.pubkey1, - '-ac_cc=2', - '-allowlist=127.0.0.1', - '-debug', - '-addnode=127.0.0.1:64367', - '--daemon', - '-rpcuser=rt', - '-rpcpassword=rt']] - ) - self.is_network_split = split - self.rpc = self.nodes[0] - self.rpc1 = self.nodes[1] - self.sync_all() - print("Done setting up network") - - def send_and_mine(self, xtn, rpc_connection): - txid = rpc_connection.sendrawtransaction(xtn) - assert txid, 'got txid' - # we need the tx above to be confirmed in the next block - rpc_connection.generate(1) - return txid - - def run_faucet_tests(self): - rpc = self.rpc - rpc1 = self.rpc1 - - # basic sanity tests - result = rpc.getwalletinfo() - assert_greater_than(result['txcount'], 100) - assert_greater_than(result['balance'], 0.0) - balance = result['balance'] - - faucet = rpc.faucetaddress() - assert_equal(faucet['result'], 'success') - # verify all keys look like valid AC addrs, could be better - for x in ['myCCAddress(Faucet)', 'FaucetCCAddress', 'FaucetCCTokensAddress', 'myaddress', 'FaucetNormalAddress']: - assert_equal(faucet[x][0], 'R') - - result = rpc.faucetaddress(self.pubkey) - assert_success(result) - # test that additional CCaddress key is returned - for x in ['myCCAddress(Faucet)', 'FaucetCCAddress', 'FaucetCCTokensAddress', 'myaddress', 'FaucetNormalAddress']: - assert_equal(result[x][0], 'R') - - # no funds in the faucet yet - result = rpc.faucetget() - assert_error(result) - - result = rpc.faucetinfo() - assert_success(result) - - result = rpc.faucetfund("0") - assert_error(result) - - result = rpc.faucetfund("-1") - assert_error(result) - - # we need at least 1 + txfee to get - result = rpc.faucetfund("2") - assert_success(result) - assert result['hex'], "hex key found" - - # broadcast the xtn - result = rpc.sendrawtransaction(result['hex']) - txid = result[0] - assert txid, "found txid" - - # we need the tx above to be confirmed in the next block - rpc.generate(1) - self.sync_all() - - result = rpc.getwalletinfo() - # minus one block reward - balance2 = result['balance'] - 100000 - # make sure our balance is less now - assert_greater_than(balance, balance2) - - result = rpc.faucetinfo() - assert_success(result) - assert_greater_than( result['funding'], 0 ) - - # claiming faucet on second node - faucetgethex = rpc1.faucetget() - assert_success(faucetgethex) - assert faucetgethex['hex'], "hex key found" - - balance1 = rpc1.getwalletinfo()['balance'] - - # try to broadcast the faucetget transaction - result = self.send_and_mine(faucetgethex['hex'], rpc1) - assert txid, "transaction broadcasted" - - balance2 = rpc1.getwalletinfo()['balance'] - assert_greater_than(balance2, balance1) - - self.sync_all() - - def run_dice_tests(self): - rpc = self.nodes[0] - rpc1 = self.nodes[1] - self.sync_all() - - # have to generate few blocks on second node to be able to place bets - rpc1.generate(10) - result = rpc1.getbalance() - assert_greater_than(result, 100000) - - dice = rpc.diceaddress() - assert_equal(dice['result'], 'success') - for x in ['myCCAddress(Dice)', 'DiceCCAddress', 'DiceCCTokensAddress', 'myaddress', 'DiceNormalAddress']: - assert_equal(dice[x][0], 'R') - - dice = rpc.diceaddress(self.pubkey) - assert_equal(dice['result'], 'success') - for x in ['myCCAddress(Dice)', 'DiceCCAddress', 'DiceCCTokensAddress', 'myaddress', 'DiceNormalAddress']: - assert_equal(dice[x][0], 'R') - - # no dice created yet - result = rpc.dicelist() - assert_equal(result, []) - - # creating dice plan with too long name (>8 chars) - result = rpc.dicefund("THISISTOOLONG", "10000", "10", "10000", "10", "5") - assert_error(result) - - # creating dice plan with < 100 funding - result = rpc.dicefund("LUCKY","10","1","10000","10","5") - assert_error(result) - - # creating dice plan with 0 blocks timeout - result = rpc.dicefund("LUCKY","10","1","10000","10","0") - assert_error(result) - - # creating dice plan - dicefundtx = rpc.dicefund("LUCKY","1000","1","800","10","5") - diceid = self.send_and_mine(dicefundtx['hex'], rpc) - - # checking if it in plans list now - result = rpc.dicelist() - assert_equal(result[0], diceid) - - # set dice name for futher usage - dicename = "LUCKY" - - # adding zero funds to plan - result = rpc.diceaddfunds(dicename,diceid,"0") - assert_error(result) - - # adding negative funds to plan - result = rpc.diceaddfunds(dicename,diceid,"-1") - assert_error(result) - - # adding funds to plan - addfundstx = rpc.diceaddfunds(dicename,diceid,"1100") - result = self.send_and_mine(addfundstx['hex'], rpc) - - # checking if funds added to plan - result = rpc.diceinfo(diceid) - assert_equal(result["funding"], "2100.00000000") - - # not valid dice info checking - result = rpc.diceinfo("invalid") - assert_error(result) - - # placing 0 amount bet - result = rpc1.dicebet(dicename,diceid,"0","2") - assert_error(result) - - # placing negative amount bet - result = rpc1.dicebet(dicename,diceid,"-1","2") - assert_error(result) - - # placing bet more than maxbet - result = rpc1.dicebet(dicename,diceid,"900","2") - assert_error(result) - - # placing bet with amount more than funding - result = rpc1.dicebet(dicename,diceid,"3000","2") - assert_error(result) - - # placing bet with potential won more than funding - result = rpc1.dicebet(dicename,diceid,"750","9") - assert_error(result) - - # placing 0 odds bet - result = rpc1.dicebet(dicename,diceid,"1","0") - assert_error(result) - - # placing negative odds bet - result = rpc1.dicebet(dicename,diceid,"1","-1") - assert_error(result) - - # placing bet with odds more than allowed - result = rpc1.dicebet(dicename,diceid,"1","11") - assert_error(result) - - # placing bet with not correct dice name - result = rpc1.dicebet("nope",diceid,"100","2") - assert_error(result) - - # placing bet with not correct dice id - result = rpc1.dicebet(dicename,self.pubkey,"100","2") - assert_error(result) - - # have to make some entropy for the next test - entropytx = 0 - fundingsum = 1 - while entropytx < 110: - fundingsuminput = str(fundingsum) - fundinghex = rpc.diceaddfunds(dicename,diceid,fundingsuminput) - result = self.send_and_mine(fundinghex['hex'], rpc) - entropytx = entropytx + 1 - fundingsum = fundingsum + 1 - - rpc.generate(2) - self.sync_all() - - # valid bet placing - placebet = rpc1.dicebet(dicename,diceid,"100","2") - betid = self.send_and_mine(placebet["hex"], rpc1) - assert result, "bet placed" - - # check bet status - result = rpc1.dicestatus(dicename,diceid,betid) - assert_success(result) - - # note initial dice funding state at this point. - # TODO: track player balance somehow (hard to do because of mining and fees) - diceinfo = rpc.diceinfo(diceid) - funding = float(diceinfo['funding']) - - # # placing same amount bets with amount 1 and odds 1:3, checking if balance changed correct - # losscounter = 0 - # wincounter = 0 - # betcounter = 0 - # - # while (betcounter < 10): - # placebet = rpc1.dicebet(dicename,diceid,"1","2") - # betid = self.send_and_mine(placebet["hex"], rpc1) - # time.sleep(3) - # self.sync_all() - # finish = rpc.dicefinish(dicename,diceid,betid) - # self.send_and_mine(finish["hex"], rpc1) - # self.sync_all() - # time.sleep(3) - # betresult = rpc1.dicestatus(dicename,diceid,betid) - # betcounter = betcounter + 1 - # if betresult["status"] == "loss": - # losscounter = losscounter + 1 - # elif betresult["status"] == "win": - # wincounter = wincounter + 1 - # else: - # pass - # - # # funding balance should increase if player loss, decrease if player won - # fundbalanceguess = funding + losscounter - wincounter * 2 - # fundinfoactual = rpc.diceinfo(diceid) - # assert_equal(round(fundbalanceguess),round(float(fundinfoactual['funding']))) - - def run_token_tests(self): - rpc = self.nodes[0] - result = rpc.tokenaddress() - assert_success(result) - for x in ['myCCAddress(Tokens)', 'TokensNormalAddress', 'TokensNormalAddress', 'myaddress','TokensCCAddress']: - assert_equal(result[x][0], 'R') - - result = rpc.tokenaddress(self.pubkey) - assert_success(result) - for x in ['myCCAddress(Tokens)', 'TokensNormalAddress', 'TokensNormalAddress', 'myaddress','TokensCCAddress']: - assert_equal(result[x][0], 'R') - # there are no tokens created yet - result = rpc.tokenlist() - assert_equal(result, []) - - # trying to create token with negaive supply - result = rpc.tokencreate("NUKE", "-1987420", "no bueno supply") - assert_error(result) - - # creating token with name more than 32 chars - result = rpc.tokencreate("NUKE123456789012345678901234567890", "1987420", "name too long") - assert_error(result) - - # creating valid token - result = rpc.tokencreate("DUKE", "1987.420", "Duke's custom token") - assert_success(result) - - tokenid = self.send_and_mine(result['hex'], rpc) - - result = rpc.tokenlist() - assert_equal(result[0], tokenid) - - # get token balance for token with pubkey - result = rpc.tokenbalance(tokenid, self.pubkey) - assert_success(result) - assert_equal(result['balance'], 198742000000) - assert_equal(result['tokenid'], tokenid) - - # get token balance for token without pubkey - result = rpc.tokenbalance(tokenid) - assert_success(result) - assert_equal(result['balance'], 198742000000) - assert_equal(result['tokenid'], tokenid) - - # this is not a valid assetid - result = rpc.tokeninfo(self.pubkey) - assert_error(result) - - # check tokeninfo for valid token - result = rpc.tokeninfo(tokenid) - assert_success(result) - assert_equal(result['tokenid'], tokenid) - assert_equal(result['owner'], self.pubkey) - assert_equal(result['name'], "DUKE") - assert_equal(result['supply'], 198742000000) - assert_equal(result['description'], "Duke's custom token") - - # invalid numtokens ask - result = rpc.tokenask("-1", tokenid, "1") - assert_error(result) - - # invalid numtokens ask - result = rpc.tokenask("0", tokenid, "1") - assert_error(result) - - # invalid price ask - result = rpc.tokenask("1", tokenid, "-1") - assert_error(result) - - # invalid price ask - result = rpc.tokenask("1", tokenid, "0") - assert_error(result) - - # invalid tokenid ask - result = rpc.tokenask("100", "deadbeef", "1") - assert_error(result) - - # valid ask - tokenask = rpc.tokenask("100", tokenid, "7.77") - tokenaskhex = tokenask['hex'] - tokenaskid = self.send_and_mine(tokenask['hex'], rpc) - result = rpc.tokenorders(tokenid) - order = result[0] - assert order, "found order" - - # invalid ask fillunits - result = rpc.tokenfillask(tokenid, tokenaskid, "0") - assert_error(result) - - # invalid ask fillunits - result = rpc.tokenfillask(tokenid, tokenaskid, "-777") - assert_error(result) - - # valid ask fillunits - fillask = rpc.tokenfillask(tokenid, tokenaskid, "777") - result = self.send_and_mine(fillask['hex'], rpc) - txid = result[0] - assert txid, "found txid" - - # should be no token orders - result = rpc.tokenorders(tokenid) - assert_equal(result, []) - - # checking ask cancellation - testorder = rpc.tokenask("100", tokenid, "7.77") - testorderid = self.send_and_mine(testorder['hex'], rpc) - cancel = rpc.tokencancelask(tokenid, testorderid) - self.send_and_mine(cancel["hex"], rpc) - result = rpc.tokenorders(tokenid) - assert_equal(result, []) - - # invalid numtokens bid - result = rpc.tokenbid("-1", tokenid, "1") - assert_error(result) - - # invalid numtokens bid - result = rpc.tokenbid("0", tokenid, "1") - assert_error(result) - - # invalid price bid - result = rpc.tokenbid("1", tokenid, "-1") - assert_error(result) - - # invalid price bid - result = rpc.tokenbid("1", tokenid, "0") - assert_error(result) - - # invalid tokenid bid - result = rpc.tokenbid("100", "deadbeef", "1") - assert_error(result) - - tokenbid = rpc.tokenbid("100", tokenid, "10") - tokenbidhex = tokenbid['hex'] - tokenbidid = self.send_and_mine(tokenbid['hex'], rpc) - result = rpc.tokenorders(tokenid) - order = result[0] - assert order, "found order" - - # invalid bid fillunits - result = rpc.tokenfillbid(tokenid, tokenbidid, "0") - assert_error(result) - - # invalid bid fillunits - result = rpc.tokenfillbid(tokenid, tokenbidid, "-777") - assert_error(result) - - # valid bid fillunits - fillbid = rpc.tokenfillbid(tokenid, tokenbidid, "1000") - result = self.send_and_mine(fillbid['hex'], rpc) - txid = result[0] - assert txid, "found txid" - - # should be no token orders - result = rpc.tokenorders(tokenid) - assert_equal(result, []) - - # checking bid cancellation - testorder = rpc.tokenbid("100", tokenid, "7.77") - testorderid = self.send_and_mine(testorder['hex'], rpc) - cancel = rpc.tokencancelbid(tokenid, testorderid) - self.send_and_mine(cancel["hex"], rpc) - result = rpc.tokenorders(tokenid) - assert_equal(result, []) - - # invalid token transfer amount (have to add status to CC code!) - randompubkey = "021a559101e355c907d9c553671044d619769a6e71d624f68bfec7d0afa6bd6a96" - result = rpc.tokentransfer(tokenid,randompubkey,"0") - assert_error(result) - - # invalid token transfer amount (have to add status to CC code!) - result = rpc.tokentransfer(tokenid,randompubkey,"-1") - assert_error(result) - - # valid token transfer - sendtokens = rpc.tokentransfer(tokenid,randompubkey,"1") - self.send_and_mine(sendtokens["hex"], rpc) - result = rpc.tokenbalance(tokenid,randompubkey) - assert_equal(result["balance"], 1) - - def run_rewards_tests(self): - rpc = self.nodes[0] - result = rpc.rewardsaddress() - for x in ['myCCAddress(Rewards)', 'myaddress', 'RewardsCCAddress', 'RewardsCCTokensAddress', 'RewardsNormalAddress']: - assert_equal(result[x][0], 'R') - - result = rpc.rewardsaddress(self.pubkey) - for x in ['myCCAddress(Rewards)', 'myaddress', 'RewardsCCAddress', 'RewardsCCTokensAddress', 'RewardsNormalAddress']: - assert_equal(result[x][0], 'R') - - # no rewards yet - result = rpc.rewardslist() - assert_equal(result, []) - - # looking up non-existent reward should return error - result = rpc.rewardsinfo("none") - assert_error(result) - - # creating rewards plan with name > 8 chars, should return error - result = rpc.rewardscreatefunding("STUFFSTUFF", "7777", "25", "0", "10", "10") - assert_error(result) - - # creating rewards plan with 0 funding - result = rpc.rewardscreatefunding("STUFF", "0", "25", "0", "10", "10") - assert_error(result) - - # creating rewards plan with 0 maxdays - result = rpc.rewardscreatefunding("STUFF", "7777", "25", "0", "10", "0") - assert_error(result) - - # creating rewards plan with > 25% APR - result = rpc.rewardscreatefunding("STUFF", "7777", "30", "0", "10", "10") - assert_error(result) - - # creating valid rewards plan - result = rpc.rewardscreatefunding("STUFF", "7777", "25", "0", "10", "10") - assert result['hex'], 'got raw xtn' - fundingtxid = rpc.sendrawtransaction(result['hex']) - assert fundingtxid, 'got txid' - - # confirm the above xtn - rpc.generate(1) - result = rpc.rewardsinfo(fundingtxid) - assert_success(result) - assert_equal(result['name'], 'STUFF') - assert_equal(result['APR'], "25.00000000") - assert_equal(result['minseconds'], 0) - assert_equal(result['maxseconds'], 864000) - assert_equal(result['funding'], "7777.00000000") - assert_equal(result['mindeposit'], "10.00000000") - assert_equal(result['fundingtxid'], fundingtxid) - - # checking if new plan in rewardslist - result = rpc.rewardslist() - assert_equal(result[0], fundingtxid) - - # creating reward plan with already existing name, should return error - result = rpc.rewardscreatefunding("STUFF", "7777", "25", "0", "10", "10") - assert_error(result) - - # add funding amount must be positive - result = rpc.rewardsaddfunding("STUFF", fundingtxid, "-1") - assert_error(result) - - # add funding amount must be positive - result = rpc.rewardsaddfunding("STUFF", fundingtxid, "0") - assert_error(result) - - # adding valid funding - result = rpc.rewardsaddfunding("STUFF", fundingtxid, "555") - addfundingtxid = self.send_and_mine(result['hex'], rpc) - assert addfundingtxid, 'got funding txid' - - # checking if funding added to rewardsplan - result = rpc.rewardsinfo(fundingtxid) - assert_equal(result['funding'], "8332.00000000") - - # trying to lock funds, locking funds amount must be positive - result = rpc.rewardslock("STUFF", fundingtxid, "-5") - assert_error(result) - - # trying to lock funds, locking funds amount must be positive - result = rpc.rewardslock("STUFF", fundingtxid, "0") - assert_error(result) - - # trying to lock less than the min amount is an error - result = rpc.rewardslock("STUFF", fundingtxid, "7") - assert_error(result) - - # locking funds in rewards plan - result = rpc.rewardslock("STUFF", fundingtxid, "10") - assert_success(result) - locktxid = result['hex'] - assert locktxid, "got lock txid" - - # locktxid has not been broadcast yet - result = rpc.rewardsunlock("STUFF", fundingtxid, locktxid) - assert_error(result) - - # broadcast xtn - txid = rpc.sendrawtransaction(locktxid) - assert txid, 'got txid from sendrawtransaction' - - # confirm the xtn above - rpc.generate(1) - - # will not unlock since reward amount is less than tx fee - result = rpc.rewardsunlock("STUFF", fundingtxid, locktxid) - assert_error(result) - - def run_oracles_tests(self): - rpc = self.nodes[0] - rpc1 = self.nodes[1] - - result = rpc1.oraclesaddress() - - result = rpc.oraclesaddress() - assert_success(result) - - for x in ['OraclesCCAddress', 'OraclesNormalAddress', 'myCCAddress(Oracles)','OraclesCCTokensAddress', 'myaddress']: - assert_equal(result[x][0], 'R') - - result = rpc.oraclesaddress(self.pubkey) - assert_success(result) - for x in ['OraclesCCAddress', 'OraclesNormalAddress', 'myCCAddress(Oracles)','OraclesCCTokensAddress', 'myaddress']: - assert_equal(result[x][0], 'R') - - # there are no oracles created yet - result = rpc.oracleslist() - assert_equal(result, []) - - # looking up non-existent oracle should return error. - result = rpc.oraclesinfo("none") - assert_error(result) - - # attempt to create oracle with not valid data type should return error - result = rpc.oraclescreate("Test", "Test", "Test") - assert_error(result) - - # attempt to create oracle with description > 32 symbols should return error - too_long_name = generate_random_string(33) - result = rpc.oraclescreate(too_long_name, "Test", "s") - - - # attempt to create oracle with description > 4096 symbols should return error - too_long_description = generate_random_string(4100) - result = rpc.oraclescreate("Test", too_long_description, "s") - assert_error(result) - # # valid creating oracles of different types - # # using such naming to re-use it for data publishing / reading (e.g. oracle_s for s type) - # valid_formats = ["s", "S", "d", "D", "c", "C", "t", "T", "i", "I", "l", "L", "h", "Ihh"] - # for f in valid_formats: - # result = rpc.oraclescreate("Test", "Test", f) - # assert_success(result) - # globals()["oracle_{}".format(f)] = self.send_and_mine(result['hex'], rpc) - - def run_test (self): - print("Mining blocks...") - rpc = self.nodes[0] - rpc1 = self.nodes[1] - # utxos from block 1 become mature in block 101 - rpc.generate(101) - self.sync_all() - rpc.getinfo() - rpc1.getinfo() - # this corresponds to -pubkey above - print("Importing privkeys") - rpc.importprivkey(self.privkey) - rpc1.importprivkey(self.privkey1) - self.run_faucet_tests() - self.sync_all() - self.run_rewards_tests() - self.sync_all() - self.run_dice_tests() - self.sync_all() - self.run_token_tests() - self.sync_all() - self.run_oracles_tests() - - -if __name__ == '__main__': - CryptoConditionsTest ().main() diff --git a/qa/rpc-tests/cryptoconditions_channels.py b/qa/rpc-tests/cryptoconditions_channels.py deleted file mode 100755 index 2f6487f84..000000000 --- a/qa/rpc-tests/cryptoconditions_channels.py +++ /dev/null @@ -1,261 +0,0 @@ -#!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers -# Copyright (c) 2018 SuperNET developers -# Distributed under the GPLv3 software license, see the accompanying -# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html - - -import time -from test_framework.test_framework import CryptoconditionsTestFramework -from test_framework.authproxy import JSONRPCException -from test_framework.util import assert_equal, assert_greater_than, \ - initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \ - stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises -from cryptoconditions import assert_success, assert_error, generate_random_string - - -class CryptoconditionsChannelsTest(CryptoconditionsTestFramework): - - def run_channels_tests(self): - - - """!!! for testing needed test daemon which built with custom flag - export CONFIGURE_FLAGS='CPPFLAGS=-DTESTMODE' - since in usual mode 101 confirmations are needed for payment/refund - """ - - rpc = self.nodes[0] - rpc1 = self.nodes[1] - - # checking channelsaddress call - - result = rpc.channelsaddress(self.pubkey) - assert_success(result) - # test that additional CCaddress key is returned - - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - # getting empty channels list - result = rpc.channelslist() - assert_equal(len(result), 2) - assert_equal(result["result"], "success") - assert_equal(result["name"], "Channels List") - - # 10 payments, 100000 sat denomination channel opening with second node pubkey - new_channel_hex = rpc.channelsopen(self.pubkey1, "10", "100000") - assert_success(new_channel_hex) - channel_txid = self.send_and_mine(new_channel_hex["hex"], rpc) - assert channel_txid, "got channel txid" - - # checking if our new channel in common channels list - result = rpc.channelslist() - assert_equal(len(result), 3) - - # checking info about channel directly - result = rpc.channelsinfo(channel_txid) - assert_success(result) - assert_equal(result["Transactions"][0]["Open"], channel_txid) - - # open transaction should be confirmed - rpc.generate(1) - - # trying to make wrong denomination channel payment - result = rpc.channelspayment(channel_txid, "199000") - assert_error(result) - - # trying to make 0 channel payment - result = rpc.channelspayment(channel_txid, "0") - assert_error(result) - - # trying to make negative channel payment - result = rpc.channelspayment(channel_txid, "-1") - assert_error(result) - - # valid channel payment - result = rpc.channelspayment(channel_txid, "100000") - assert_success(result) - payment_tx_id = self.send_and_mine(result["hex"], rpc) - assert payment_tx_id, "got txid" - - # now in channelinfo payment information should appear - result = rpc.channelsinfo(channel_txid) - assert_equal(result["Transactions"][1]["Payment"], payment_tx_id) - - # number of payments should be equal 1 (one denomination used) - result = rpc.channelsinfo(channel_txid)["Transactions"][1]["Number of payments"] - assert_equal(result, 1) - # payments left param should reduce 1 and be equal 9 now ( 10 - 1 = 9 ) - result = rpc.channelsinfo(channel_txid)["Transactions"][1]["Payments left"] - assert_equal(result, 9) - - # lets try payment with x2 amount to ensure that counters works correct - result = rpc.channelspayment(channel_txid, "200000") - assert_success(result) - payment_tx_id = self.send_and_mine(result["hex"], rpc) - assert payment_tx_id, "got txid" - - result = rpc.channelsinfo(channel_txid) - assert_equal(result["Transactions"][2]["Payment"], payment_tx_id) - - result = rpc.channelsinfo(channel_txid)["Transactions"][2]["Number of payments"] - assert_equal(result, 2) - - result = rpc.channelsinfo(channel_txid)["Transactions"][2]["Payments left"] - assert_equal(result, 7) - - # check if payment value really transferred - raw_transaction = rpc.getrawtransaction(payment_tx_id, 1) - - result = raw_transaction["vout"][3]["valueSat"] - assert_equal(result, 200000) - - result = rpc1.validateaddress(raw_transaction["vout"][3]["scriptPubKey"]["addresses"][0])["ismine"] - assert_equal(result, True) - - # have to check that second node have coins to cover txfee at least - rpc.sendtoaddress(rpc1.getnewaddress(), 1) - rpc.sendtoaddress(rpc1.getnewaddress(), 1) - rpc.generate(2) - self.sync_all() - result = rpc1.getbalance() - assert_greater_than(result, 0.1) - - # trying to initiate channels payment from node B without any secret - # TODO: have to add RPC validation - payment_hex = rpc1.channelspayment(channel_txid, "100000") - try: - result = rpc1.sendrawtransaction(payment_hex["hex"]) - except Exception as e: - pass - - # trying to initiate channels payment from node B with secret from previous payment - result = rpc1.channelspayment(channel_txid, "100000", rpc1.channelsinfo(channel_txid)["Transactions"][1]["Secret"]) - #result = rpc1.sendrawtransaction(payment_hex["hex"]) - assert_error(result) - - # executing channel close - result = rpc.channelsclose(channel_txid) - assert_success(result) - channel_close_txid = self.send_and_mine(result["hex"], rpc) - assert channel_close_txid, "got txid" - - rpc.generate(2) - self.sync_all() - - # now in channelinfo closed flag should appear - result = rpc.channelsinfo(channel_txid) - assert_equal(result["Transactions"][3]["Close"], channel_close_txid) - - # executing channel refund - result = rpc.channelsrefund(channel_txid, channel_close_txid) - assert_success(result) - refund_txid = self.send_and_mine(result["hex"], rpc) - assert refund_txid, "got txid" - - # checking if it refunded to opener address - raw_transaction = rpc.getrawtransaction(refund_txid, 1) - - result = raw_transaction["vout"][2]["valueSat"] - assert_equal(result, 700000) - - result = rpc.validateaddress(raw_transaction["vout"][2]["scriptPubKey"]["addresses"][0])["ismine"] - assert_equal(result, True) - - - # creating and draining channel (10 payment by 100000 satoshies in total to fit full capacity) - new_channel_hex1 = rpc.channelsopen(self.pubkey1, "10", "100000") - assert_success(new_channel_hex1) - channel1_txid = self.send_and_mine(new_channel_hex1["hex"], rpc) - assert channel1_txid, "got channel txid" - - # need to have 2+ confirmations in the test mode - rpc.generate(2) - self.sync_all() - - for i in range(10): - result = rpc.channelspayment(channel1_txid, "100000") - assert_success(result) - payment_tx_id = self.send_and_mine(result["hex"], rpc) - assert payment_tx_id, "got txid" - - # last payment should indicate that 0 payments left - result = rpc.channelsinfo(channel1_txid)["Transactions"][10]["Payments left"] - assert_equal(result, 0) - - # no more payments possible - result = rpc.channelspayment(channel1_txid, "100000") - assert_error(result) - - # creating new channel to test the case when node B initiate payment when node A revealed secret in offline - # 10 payments, 100000 sat denomination channel opening with second node pubkey - new_channel_hex2 = rpc.channelsopen(self.pubkey1, "10", "100000") - assert_success(new_channel_hex) - channel2_txid = self.send_and_mine(new_channel_hex2["hex"], rpc) - assert channel2_txid, "got channel txid" - - rpc.generate(2) - self.sync_all() - - # disconnecting first node from network - rpc.setban("127.0.0.0/24","add") - assert_equal(rpc.getinfo()["connections"], 0) - assert_equal(rpc1.getinfo()["connections"], 0) - - rpc1.generate(1) - - # sending one payment to mempool to reveal the secret but not mine it - payment_hex = rpc.channelspayment(channel2_txid, "100000") - result = rpc.sendrawtransaction(payment_hex["hex"]) - assert result, "got payment txid" - - secret = rpc.channelsinfo(channel2_txid)["Transactions"][1]["Secret"] - assert secret, "Secret revealed" - - # secret shouldn't be available for node B - secret_not_revealed = None - try: - rpc1.channelsinfo(channel2_txid)["Transactions"][1]["Secret"] - except Exception: - secret_not_revealed = True - assert_equal(secret_not_revealed, True) - - # trying to initiate payment from second node with revealed secret - assert_equal(rpc1.getinfo()["connections"], 0) - dc_payment_hex = rpc1.channelspayment(channel2_txid, "100000", secret) - assert_success(dc_payment_hex) - result = rpc1.sendrawtransaction(dc_payment_hex["hex"]) - assert result, "got channelspayment transaction id" - - # TODO: it crash first node after block generating on mempools merging - # # restoring connection between nodes - # rpc.setban("127.0.0.0/24","remove") - # #rpc.generate(1) - # #rpc1.generate(1) - # sync_blocks(self.nodes) - # rpc.generate(1) - # sync_blocks(self.nodes) - # sync_mempools(self.nodes) - # assert_equal(rpc.getinfo()["connections"], 1) - # assert_equal(rpc1.getinfo()["connections"], 1) - - def run_test(self): - print("Mining blocks...") - rpc = self.nodes[0] - rpc1 = self.nodes[1] - # utxos from block 1 become mature in block 101 - if not self.options.noshutdown: - rpc.generate(101) - self.sync_all() - rpc.getinfo() - rpc1.getinfo() - # this corresponds to -pubkey above - print("Importing privkeys") - rpc.importprivkey(self.privkey) - rpc1.importprivkey(self.privkey1) - self.run_channels_tests() - - -if __name__ == '__main__': - CryptoconditionsChannelsTest().main() diff --git a/qa/rpc-tests/cryptoconditions_dice.py b/qa/rpc-tests/cryptoconditions_dice.py deleted file mode 100755 index 4a3a202a4..000000000 --- a/qa/rpc-tests/cryptoconditions_dice.py +++ /dev/null @@ -1,204 +0,0 @@ -#!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers -# Copyright (c) 2018 SuperNET developers -# Distributed under the GPLv3 software license, see the accompanying -# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html - - -from test_framework.test_framework import CryptoconditionsTestFramework -from test_framework.authproxy import JSONRPCException -from test_framework.util import assert_equal, assert_greater_than, \ - initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \ - stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises -from cryptoconditions import assert_success, assert_error, generate_random_string - - -class CryptoconditionsDiceTest(CryptoconditionsTestFramework): - - def run_dice_tests(self): - rpc = self.nodes[0] - rpc1 = self.nodes[1] - self.sync_all() - - # have to generate few blocks on second node to be able to place bets - rpc1.generate(10) - result = rpc1.getbalance() - assert_greater_than(result, 100000) - - result = rpc.diceaddress() - assert_equal(result['result'], 'success') - - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - result = rpc.diceaddress(self.pubkey) - for x in result.keys(): - print(x+": "+str(result[x])) - assert_equal(result['result'], 'success') - - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - # no dice created yet - result = rpc.dicelist() - assert_equal(result, []) - - # creating dice plan with too long name (>8 chars) - result = rpc.dicefund("THISISTOOLONG", "10000", "10", "10000", "10", "5") - assert_error(result) - - # creating dice plan with < 100 funding - result = rpc.dicefund("LUCKY","10","1","10000","10","5") - assert_error(result) - - # creating dice plan with 0 blocks timeout - result = rpc.dicefund("LUCKY","10","1","10000","10","0") - assert_error(result) - - # creating dice plan - dicefundtx = rpc.dicefund("LUCKY","1000","1","800","10","5") - diceid = self.send_and_mine(dicefundtx['hex'], rpc) - - # checking if it in plans list now - result = rpc.dicelist() - assert_equal(result[0], diceid) - - # set dice name for futher usage - dicename = "LUCKY" - - # adding zero funds to plan - result = rpc.diceaddfunds(dicename,diceid,"0") - assert_error(result) - - # adding negative funds to plan - result = rpc.diceaddfunds(dicename,diceid,"-1") - assert_error(result) - - # adding funds to plan - addfundstx = rpc.diceaddfunds(dicename,diceid,"1100") - result = self.send_and_mine(addfundstx['hex'], rpc) - - # checking if funds added to plan - result = rpc.diceinfo(diceid) - assert_equal(result["funding"], "2100.00000000") - - # not valid dice info checking - result = rpc.diceinfo("invalid") - assert_error(result) - - # placing 0 amount bet - result = rpc1.dicebet(dicename,diceid,"0","2") - assert_error(result) - - # placing negative amount bet - result = rpc1.dicebet(dicename,diceid,"-1","2") - assert_error(result) - - # placing bet more than maxbet - result = rpc1.dicebet(dicename,diceid,"900","2") - assert_error(result) - - # placing bet with amount more than funding - result = rpc1.dicebet(dicename,diceid,"3000","2") - assert_error(result) - - # placing bet with potential won more than funding - result = rpc1.dicebet(dicename,diceid,"750","9") - assert_error(result) - - # placing 0 odds bet - result = rpc1.dicebet(dicename,diceid,"1","0") - assert_error(result) - - # placing negative odds bet - result = rpc1.dicebet(dicename,diceid,"1","-1") - assert_error(result) - - # placing bet with odds more than allowed - result = rpc1.dicebet(dicename,diceid,"1","11") - assert_error(result) - - # placing bet with not correct dice name - result = rpc1.dicebet("nope",diceid,"100","2") - assert_error(result) - - # placing bet with not correct dice id - result = rpc1.dicebet(dicename,self.pubkey,"100","2") - assert_error(result) - - # have to make some entropy for the next test - entropytx = 0 - fundingsum = 1 - while entropytx < 110: - fundingsuminput = str(fundingsum) - fundinghex = rpc.diceaddfunds(dicename,diceid,fundingsuminput) - result = self.send_and_mine(fundinghex['hex'], rpc) - entropytx = entropytx + 1 - fundingsum = fundingsum + 1 - - rpc.generate(2) - self.sync_all() - - # valid bet placing - placebet = rpc1.dicebet(dicename,diceid,"100","2") - betid = self.send_and_mine(placebet["hex"], rpc1) - assert result, "bet placed" - - # check bet status - result = rpc1.dicestatus(dicename,diceid,betid) - assert_success(result) - - # note initial dice funding state at this point. - # TODO: track player balance somehow (hard to do because of mining and fees) - diceinfo = rpc.diceinfo(diceid) - funding = float(diceinfo['funding']) - - # # placing same amount bets with amount 1 and odds 1:3, checking if balance changed correct - # losscounter = 0 - # wincounter = 0 - # betcounter = 0 - # - # while (betcounter < 10): - # placebet = rpc1.dicebet(dicename,diceid,"1","2") - # betid = self.send_and_mine(placebet["hex"], rpc1) - # time.sleep(3) - # self.sync_all() - # finish = rpc.dicefinish(dicename,diceid,betid) - # self.send_and_mine(finish["hex"], rpc1) - # self.sync_all() - # time.sleep(3) - # betresult = rpc1.dicestatus(dicename,diceid,betid) - # betcounter = betcounter + 1 - # if betresult["status"] == "loss": - # losscounter = losscounter + 1 - # elif betresult["status"] == "win": - # wincounter = wincounter + 1 - # else: - # pass - # - # # funding balance should increase if player loss, decrease if player won - # fundbalanceguess = funding + losscounter - wincounter * 2 - # fundinfoactual = rpc.diceinfo(diceid) - # assert_equal(round(fundbalanceguess),round(float(fundinfoactual['funding']))) - - def run_test(self): - print("Mining blocks...") - rpc = self.nodes[0] - rpc1 = self.nodes[1] - # utxos from block 1 become mature in block 101 - if not self.options.noshutdown: - rpc.generate(101) - self.sync_all() - rpc.getinfo() - rpc1.getinfo() - # this corresponds to -pubkey above - print("Importing privkeys") - rpc.importprivkey(self.privkey) - rpc1.importprivkey(self.privkey1) - self.run_dice_tests() - - -if __name__ == '__main__': - CryptoconditionsDiceTest ().main() diff --git a/qa/rpc-tests/cryptoconditions_faucet.py b/qa/rpc-tests/cryptoconditions_faucet.py deleted file mode 100755 index ba7648c4d..000000000 --- a/qa/rpc-tests/cryptoconditions_faucet.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers -# Copyright (c) 2018 SuperNET developers -# Distributed under the GPLv3 software license, see the accompanying -# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html - - -from test_framework.test_framework import CryptoconditionsTestFramework -from test_framework.authproxy import JSONRPCException -from test_framework.util import assert_equal, assert_greater_than, \ - initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \ - stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises -from cryptoconditions import assert_success, assert_error, generate_random_string - - -class CryptoconditionsFaucetTest(CryptoconditionsTestFramework): - - def run_faucet_tests(self): - rpc = self.rpc - rpc1 = self.rpc1 - - # basic sanity tests - result = rpc.getwalletinfo() - assert_greater_than(result['txcount'], 100) - assert_greater_than(result['balance'], 0.0) - balance = result['balance'] - - result = rpc.faucetaddress() - assert_equal(result['result'], 'success') - - # verify all keys look like valid AC addrs, could be better - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - result = rpc.faucetaddress(self.pubkey) - assert_success(result) - for x in result.keys(): - print(x+": "+str(result[x])) - # test that additional CCaddress key is returned - - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - # no funds in the faucet yet - result = rpc.faucetget() - assert_error(result) - - result = rpc.faucetinfo() - assert_success(result) - - result = rpc.faucetfund("0") - assert_error(result) - - result = rpc.faucetfund("-1") - assert_error(result) - - # we need at least 1 + txfee to get - result = rpc.faucetfund("2") - assert_success(result) - assert result['hex'], "hex key found" - - # broadcast the xtn - result = rpc.sendrawtransaction(result['hex']) - txid = result[0] - assert txid, "found txid" - - # we need the tx above to be confirmed in the next block - rpc.generate(1) - self.sync_all() - - result = rpc.getwalletinfo() - # minus one block reward - balance2 = result['balance'] - 100000 - # make sure our balance is less now - assert_greater_than(balance, balance2) - - result = rpc.faucetinfo() - assert_success(result) - assert_greater_than( result['funding'], 0 ) - - # claiming faucet on second node - faucetgethex = rpc1.faucetget() - assert_success(faucetgethex) - assert faucetgethex['hex'], "hex key found" - - balance1 = rpc1.getwalletinfo()['balance'] - - # try to broadcast the faucetget transaction - result = self.send_and_mine(faucetgethex['hex'], rpc1) - assert txid, "transaction broadcasted" - - balance2 = rpc1.getwalletinfo()['balance'] - assert_greater_than(balance2, balance1) - - self.sync_all() - - def run_test(self): - print("Mining blocks...") - rpc = self.nodes[0] - rpc1 = self.nodes[1] - # utxos from block 1 become mature in block 101 - rpc.generate(101) - self.sync_all() - rpc.getinfo() - rpc1.getinfo() - # this corresponds to -pubkey above - print("Importing privkeys") - rpc.importprivkey(self.privkey) - rpc1.importprivkey(self.privkey1) - self.run_faucet_tests() - - -if __name__ == '__main__': - CryptoconditionsFaucetTest ().main() diff --git a/qa/rpc-tests/cryptoconditions_gateways.py b/qa/rpc-tests/cryptoconditions_gateways.py deleted file mode 100755 index d31e89d9f..000000000 --- a/qa/rpc-tests/cryptoconditions_gateways.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers -# Copyright (c) 2018 SuperNET developers -# Distributed under the GPLv3 software license, see the accompanying -# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html - - -from test_framework.test_framework import CryptoconditionsTestFramework -from test_framework.authproxy import JSONRPCException -from test_framework.util import assert_equal, assert_greater_than, \ - initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \ - stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises -from cryptoconditions import assert_success, assert_error, generate_random_string - - -class CryptoconditionsGatewaysTest(CryptoconditionsTestFramework): - - def run_gateways_tests(self): - rpc = self.nodes[0] - rpc1 = self.nodes[1] - - result = rpc.gatewaysaddress() - assert_success(result) - - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - assert_equal("03ea9c062b9652d8eff34879b504eda0717895d27597aaeb60347d65eed96ccb40", result["GatewaysPubkey"]) - - # getting an empty gateways list - - result = rpc.gatewayslist() - assert_equal(result, []) - - # Gateways binding preparation - - # creating oracle - oracle_hex = rpc.oraclescreate("Test", "Testing", "Ihh") - assert_success(oracle_hex) - oracle_txid = self.send_and_mine(oracle_hex["hex"], rpc) - assert oracle_txid, "got txid" - - # registering as an oracle publisher - reg_hex = rpc.oraclesregister(oracle_txid, "10000") - assert_success(reg_hex) - reg_txid = self.send_and_mine(reg_hex["hex"], rpc) - assert reg_txid, "got txid" - - # subscribing on oracle - sub_hex = rpc.oraclessubscribe(oracle_txid, self.pubkey, "1") - assert_success(sub_hex) - sub_txid = self.send_and_mine(sub_hex["hex"], rpc) - assert sub_txid, "got txid" - - # creating token - token_hex = rpc.tokencreate("Test", "1", "Testing") - assert_success(token_hex) - token_txid = self.send_and_mine(token_hex["hex"], rpc) - assert token_txid, "got txid" - - # converting tokens - convertion_hex = rpc.tokenconvert("241",token_txid,"03ea9c062b9652d8eff34879b504eda0717895d27597aaeb60347d65eed96ccb40","100000000") - assert_success(convertion_hex) - convertion_txid = self.send_and_mine(convertion_hex["hex"], rpc) - assert convertion_txid, "got txid" - - # binding gateway - bind_hex = rpc.gatewaysbind(token_txid, oracle_txid, "KMD", "100000000", "1", "1", self.pubkey) - assert_success(bind_hex) - bind_txid = self.send_and_mine(bind_hex["hex"], rpc) - assert bind_txid, "got txid" - - # checking if created gateway in list - result = rpc.gatewayslist() - assert_equal(result[0], bind_txid) - - - def run_test(self): - print("Mining blocks...") - rpc = self.nodes[0] - rpc1 = self.nodes[1] - # utxos from block 1 become mature in block 101 - if not self.options.noshutdown: - rpc.generate(101) - self.sync_all() - rpc.getinfo() - rpc1.getinfo() - # this corresponds to -pubkey above - print("Importing privkeys") - rpc.importprivkey(self.privkey) - rpc1.importprivkey(self.privkey1) - self.run_gateways_tests() - - -if __name__ == '__main__': - CryptoconditionsGatewaysTest().main() diff --git a/qa/rpc-tests/cryptoconditions_heir.py b/qa/rpc-tests/cryptoconditions_heir.py deleted file mode 100755 index be248bb53..000000000 --- a/qa/rpc-tests/cryptoconditions_heir.py +++ /dev/null @@ -1,177 +0,0 @@ -#!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers -# Copyright (c) 2018 SuperNET developers -# Distributed under the GPLv3 software license, see the accompanying -# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html - - -import time -from test_framework.test_framework import CryptoconditionsTestFramework -from test_framework.authproxy import JSONRPCException -from test_framework.util import assert_equal, assert_greater_than, \ - initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \ - stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises -from cryptoconditions import assert_success, assert_error, generate_random_string - - -class CryptoconditionsHeirTest(CryptoconditionsTestFramework): - - def run_heir_tests(self): - - rpc = self.nodes[0] - rpc1 = self.nodes[1] - - result = rpc.heiraddress('') - assert_success(result) - - # verify all keys look like valid AC addrs, could be better - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - result = rpc.heiraddress(self.pubkey) - assert_success(result) - - # test that additional CCaddress key is returned - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - # getting empty heir list - result = rpc.heirlist() - assert_equal(result, []) - - # valid heirfund case with coins - result = rpc.heirfund("0", "1000", "UNITHEIR", self.pubkey1, "10", "TESTMEMO") - assert_success(result) - - heir_fund_txid = self.send_and_mine(result["hex"], rpc) - assert heir_fund_txid, "got heir funding txid" - - # heir fund txid should be in heirlist now - result = rpc.heirlist() - assert_equal(result, [heir_fund_txid]) - - # checking heirinfo - result = rpc.heirinfo(heir_fund_txid) - assert_success(result) - assert_equal(result["fundingtxid"], heir_fund_txid) - assert_equal(result["name"], "UNITHEIR") - assert_equal(result["owner"], self.pubkey) - assert_equal(result["heir"], self.pubkey1) - assert_equal(result["memo"], "TESTMEMO") - assert_equal(result["lifetime"], "1000.00000000") - assert_equal(result["type"], "coins") - assert_equal(result["InactivityTimeSetting"], "10") - assert_equal(result["InactivityTime"], "0") - assert_equal(result["IsHeirSpendingAllowed"], "false") - - # waiting for 11 seconds to be sure that needed time passed for heir claiming - time.sleep(11) - rpc.generate(1) - self.sync_all() - result = rpc.heirinfo(heir_fund_txid) - assert_equal(result["lifetime"], "1000.00000000") - assert_equal(result["IsHeirSpendingAllowed"], "true") - - # have to check that second node have coins to cover txfee at least - rpc.sendtoaddress(rpc1.getnewaddress(), 1) - rpc.sendtoaddress(rpc1.getnewaddress(), 1) - rpc.generate(2) - self.sync_all() - second_node_balance = rpc1.getbalance() - assert_greater_than(second_node_balance, 0.1) - - # let's claim whole heir sum from second node - result = rpc1.heirclaim("0", "1000", heir_fund_txid) - assert_success(result) - - heir_claim_txid = self.send_and_mine(result["hex"], rpc1) - assert heir_claim_txid, "got claim txid" - - # balance of second node after heirclaim should increase for 1000 coins - txfees - # + get one block reward when broadcasted heir_claim_txid - result = round(rpc1.getbalance()) - round(second_node_balance) - assert_greater_than(result, 100999) - - self.sync_all() - - # no more funds should be available for claiming - result = rpc.heirinfo(heir_fund_txid) - assert_equal(result["lifetime"], "1000.00000000") - assert_equal(result["available"], "0.00000000") - - # creating tokens which we put to heir contract - token_hex = rpc.tokencreate("TEST", "1", "TESTING") - token_txid = self.send_and_mine(token_hex["hex"], rpc) - assert token_txid, "got token txid" - - # checking possesion over the tokens and balance - result = rpc.tokenbalance(token_txid, self.pubkey)["balance"] - assert_equal(result, 100000000) - - # valid heir case with tokens - token_heir_hex = rpc.heirfund("0", "100000000", "UNITHEIR", self.pubkey1, "10", "TESTMEMO", token_txid) - token_heir_txid = self.send_and_mine(token_heir_hex["hex"], rpc) - assert token_heir_txid, "got txid of heirfund with tokens" - - self.sync_all() - - # checking heirinfo - result = rpc.heirinfo(token_heir_txid) - assert_success(result) - assert_equal(result["fundingtxid"], token_heir_txid) - assert_equal(result["name"], "UNITHEIR") - assert_equal(result["owner"], self.pubkey) - assert_equal(result["heir"], self.pubkey1) - assert_equal(result["lifetime"], "100000000") - assert_equal(result["type"], "tokens") - assert_equal(result["InactivityTimeSetting"], "10") - assert_equal(result["InactivityTime"], "0") - assert_equal(result["IsHeirSpendingAllowed"], "false") - - # waiting for 11 seconds to be sure that needed time passed for heir claiming - time.sleep(11) - rpc.generate(1) - self.sync_all() - result = rpc.heirinfo(token_heir_txid) - assert_equal(result["lifetime"], "100000000") - assert_equal(result["IsHeirSpendingAllowed"], "true") - - # let's claim whole heir sum from second node - result = rpc1.heirclaim("0", "100000000", token_heir_txid) - assert_success(result) - - heir_tokens_claim_txid = self.send_and_mine(result["hex"], rpc1) - assert heir_tokens_claim_txid, "got claim txid" - - # claiming node should have correct token balance now - result = rpc1.tokenbalance(token_txid, self.pubkey1)["balance"] - assert_equal(result, 100000000) - - self.sync_all() - - # no more funds should be available for claiming - result = rpc.heirinfo(token_heir_txid) - assert_equal(result["lifetime"], "100000000") - assert_equal(result["available"], "0") - - def run_test(self): - print("Mining blocks...") - rpc = self.nodes[0] - rpc1 = self.nodes[1] - # utxos from block 1 become mature in block 101 - if not self.options.noshutdown: - rpc.generate(101) - self.sync_all() - rpc.getinfo() - rpc1.getinfo() - # this corresponds to -pubkey above - print("Importing privkeys") - rpc.importprivkey(self.privkey) - rpc1.importprivkey(self.privkey1) - self.run_heir_tests() - - -if __name__ == '__main__': - CryptoconditionsHeirTest().main() diff --git a/qa/rpc-tests/cryptoconditions_oracles.py b/qa/rpc-tests/cryptoconditions_oracles.py deleted file mode 100755 index d07389542..000000000 --- a/qa/rpc-tests/cryptoconditions_oracles.py +++ /dev/null @@ -1,265 +0,0 @@ -#!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers -# Copyright (c) 2018 SuperNET developers -# Distributed under the GPLv3 software license, see the accompanying -# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html - -from test_framework.test_framework import CryptoconditionsTestFramework -from test_framework.authproxy import JSONRPCException -from test_framework.util import assert_equal, assert_greater_than, \ - initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \ - stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises -from cryptoconditions import assert_success, assert_error, generate_random_string - -class CryptoconditionsOraclesTest(CryptoconditionsTestFramework): - - def run_oracles_tests(self): - rpc = self.nodes[0] - rpc1 = self.nodes[1] - result = rpc1.oraclesaddress() - - result = rpc.oraclesaddress() - assert_success(result) - - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - result = rpc.oraclesaddress(self.pubkey) - assert_success(result) - - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - # there are no oracles created yet - result = rpc.oracleslist() - assert_equal(result, []) - - # looking up non-existent oracle should return error. - result = rpc.oraclesinfo("none") - assert_error(result) - - # attempt to create oracle with not valid data type should return error - result = rpc.oraclescreate("Test", "Test", "Test") - assert_error(result) - - # attempt to create oracle with description > 32 symbols should return error - too_long_name = generate_random_string(33) - result = rpc.oraclescreate(too_long_name, "Test", "s") - - # attempt to create oracle with description > 4096 symbols should return error - too_long_description = generate_random_string(4100) - result = rpc.oraclescreate("Test", too_long_description, "s") - assert_error(result) - - # need uxtos to create oracle? Crashes if without generate - rpc.generate(2) - - # valid creating oracles of different types - # using such naming to re-use it for data publishing / reading (e.g. oracle_s for s type) - - valid_formats = ["s", "S", "d", "D", "c", "C", "t", "T", "i", "I", "l", "L", "h", "Ihh"] - for f in valid_formats: - result = rpc.oraclescreate("Test_"+f, "Test_"+f, f) - assert_success(result) - globals()["oracle_{}".format(f)] = self.send_and_mine(result['hex'], rpc) - - # trying to register with negative datafee - result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "-100") - assert_error(result) - - # trying to register with zero datafee - result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "0") - assert_error(result) - - # trying to register with datafee less than txfee - result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "500") - assert_error(result) - - # trying to register valid (unfunded) - result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "10000") - assert_error(result) - - # Fund the oracles - result = rpc.oraclesfund(globals()["oracle_{}".format(f)]) - assert_success(result) - fund_txid = self.send_and_mine(result["hex"], rpc) - assert fund_txid, "got txid" - - # trying to register valid (funded) - result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "10000") - print(f) - assert_success(result) - register_txid = self.send_and_mine(result["hex"], rpc) - assert register_txid, "got txid" - - # TODO: for most of the non valid oraclesregister and oraclessubscribe transactions generating and broadcasting now - # so trying only valid oraclessubscribe atm - result = rpc.oraclessubscribe(globals()["oracle_{}".format(f)], self.pubkey, "1") - assert_success(result) - subscribe_txid = self.send_and_mine(result["hex"], rpc) - assert register_txid, "got txid" - - rpc.generate(1) - - # now lets publish and read valid data for each oracle type - - # s type - result = rpc.oraclesdata(globals()["oracle_{}".format("s")], "05416e746f6e") - assert_success(result) - oraclesdata_s = self.send_and_mine(result["hex"], rpc) - info = rpc.oraclesinfo(globals()["oracle_{}".format("s")]) - batonaddr = info['registered'][0]['baton'] - result = rpc.oraclessamples(globals()["oracle_{}".format("s")], batonaddr, "1") - assert_equal("[u'Anton']", str(result["samples"][0]['data']), "Data match") - - # S type - result = rpc.oraclesdata(globals()["oracle_{}".format("S")], "000161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161") - assert_success(result) - oraclesdata_S = self.send_and_mine(result["hex"], rpc) - info = rpc.oraclesinfo(globals()["oracle_{}".format("S")]) - batonaddr = info['registered'][0]['baton'] - result = rpc.oraclessamples(globals()["oracle_{}".format("S")], batonaddr, "1") - assert_equal("[u'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa']", str(result["samples"][0]['data']), "Data match") - - # d type - result = rpc.oraclesdata(globals()["oracle_{}".format("d")], "0101") - assert_success(result) - # baton - oraclesdata_d = self.send_and_mine(result["hex"], rpc) - info = rpc.oraclesinfo(globals()["oracle_{}".format("d")]) - batonaddr = info['registered'][0]['baton'] - result = rpc.oraclessamples(globals()["oracle_{}".format("d")], batonaddr, "1") - assert_equal("[u'01']", str(result["samples"][0]['data']), "Data match") - - # D type - result = rpc.oraclesdata(globals()["oracle_{}".format("D")], "010001") - assert_success(result) - # baton - oraclesdata_D = self.send_and_mine(result["hex"], rpc) - info = rpc.oraclesinfo(globals()["oracle_{}".format("D")]) - batonaddr = info['registered'][0]['baton'] - result = rpc.oraclessamples(globals()["oracle_{}".format("D")], batonaddr, "1") - assert_equal("[u'01']", str(result["samples"][0]['data']), "Data match") - - # c type - result = rpc.oraclesdata(globals()["oracle_{}".format("c")], "ff") - assert_success(result) - # baton - oraclesdata_c = self.send_and_mine(result["hex"], rpc) - info = rpc.oraclesinfo(globals()["oracle_{}".format("c")]) - batonaddr = info['registered'][0]['baton'] - result = rpc.oraclessamples(globals()["oracle_{}".format("c")], batonaddr, "1") - assert_equal("[u'-1']", str(result["samples"][0]['data']), "Data match") - - # C type - result = rpc.oraclesdata(globals()["oracle_{}".format("C")], "ff") - assert_success(result) - # baton - oraclesdata_C = self.send_and_mine(result["hex"], rpc) - info = rpc.oraclesinfo(globals()["oracle_{}".format("C")]) - batonaddr = info['registered'][0]['baton'] - result = rpc.oraclessamples(globals()["oracle_{}".format("C")], batonaddr, "1") - assert_equal("[u'255']", str(result["samples"][0]['data']), "Data match") - - # t type - result = rpc.oraclesdata(globals()["oracle_{}".format("t")], "ffff") - assert_success(result) - # baton - oraclesdata_t = self.send_and_mine(result["hex"], rpc) - info = rpc.oraclesinfo(globals()["oracle_{}".format("t")]) - batonaddr = info['registered'][0]['baton'] - result = rpc.oraclessamples(globals()["oracle_{}".format("t")], batonaddr, "1") - assert_equal("[u'-1']", str(result["samples"][0]['data']), "Data match") - - # T type - result = rpc.oraclesdata(globals()["oracle_{}".format("T")], "ffff") - assert_success(result) - # baton - oraclesdata_T = self.send_and_mine(result["hex"], rpc) - info = rpc.oraclesinfo(globals()["oracle_{}".format("T")]) - batonaddr = info['registered'][0]['baton'] - result = rpc.oraclessamples(globals()["oracle_{}".format("T")], batonaddr, "1") - assert_equal("[u'65535']", str(result["samples"][0]['data']), "Data match") - - # i type - result = rpc.oraclesdata(globals()["oracle_{}".format("i")], "ffffffff") - assert_success(result) - # baton - oraclesdata_i = self.send_and_mine(result["hex"], rpc) - info = rpc.oraclesinfo(globals()["oracle_{}".format("i")]) - batonaddr = info['registered'][0]['baton'] - result = rpc.oraclessamples(globals()["oracle_{}".format("i")], batonaddr, "1") - assert_equal("[u'-1']", str(result["samples"][0]['data']), "Data match") - - # I type - result = rpc.oraclesdata(globals()["oracle_{}".format("I")], "ffffffff") - assert_success(result) - # baton - oraclesdata_I = self.send_and_mine(result["hex"], rpc) - info = rpc.oraclesinfo(globals()["oracle_{}".format("I")]) - batonaddr = info['registered'][0]['baton'] - result = rpc.oraclessamples(globals()["oracle_{}".format("I")], batonaddr, "1") - assert_equal("[u'4294967295']", str(result["samples"][0]['data']), "Data match") - - # l type - result = rpc.oraclesdata(globals()["oracle_{}".format("l")], "00000000ffffffff") - assert_success(result) - # baton - oraclesdata_l = self.send_and_mine(result["hex"], rpc) - info = rpc.oraclesinfo(globals()["oracle_{}".format("l")]) - batonaddr = info['registered'][0]['baton'] - result = rpc.oraclessamples(globals()["oracle_{}".format("l")], batonaddr, "1") - assert_equal("[u'-4294967296']", str(result["samples"][0]['data']), "Data match") - - # L type - result = rpc.oraclesdata(globals()["oracle_{}".format("L")], "00000000ffffffff") - assert_success(result) - # baton - oraclesdata_L = self.send_and_mine(result["hex"], rpc) - info = rpc.oraclesinfo(globals()["oracle_{}".format("L")]) - batonaddr = info['registered'][0]['baton'] - result = rpc.oraclessamples(globals()["oracle_{}".format("L")], batonaddr, "1") - assert_equal("[u'18446744069414584320']", str(result["samples"][0]['data']), "Data match") - - # h type - result = rpc.oraclesdata(globals()["oracle_{}".format("h")], "00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff") - assert_success(result) - # baton - oraclesdata_h = self.send_and_mine(result["hex"], rpc) - info = rpc.oraclesinfo(globals()["oracle_{}".format("h")]) - batonaddr = info['registered'][0]['baton'] - result = rpc.oraclessamples(globals()["oracle_{}".format("h")], batonaddr, "1") - assert_equal("[u'ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000']", str(result["samples"][0]['data']), "Data match") - - # Ihh type - result = rpc.oraclesdata(globals()["oracle_{}".format("Ihh")], "ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff") - assert_success(result) - # baton - oraclesdata_Ihh = self.send_and_mine(result["hex"], rpc) - info = rpc.oraclesinfo(globals()["oracle_{}".format("Ihh")]) - batonaddr = info['registered'][0]['baton'] - result = rpc.oraclessamples(globals()["oracle_{}".format("Ihh")], batonaddr, "1") - print(result) - assert_equal("[u'4294967295', u'ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000', u'ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000']", str(result["samples"][0]['data']), "Data match") - - def run_test(self): - print("Mining blocks...") - rpc = self.nodes[0] - rpc1 = self.nodes[1] - # utxos from block 1 become mature in block 101 - if not self.options.noshutdown: - rpc.generate(101) - self.sync_all() - rpc.getinfo() - rpc1.getinfo() - # this corresponds to -pubkey above - print("Importing privkeys") - rpc.importprivkey(self.privkey) - rpc1.importprivkey(self.privkey1) - self.run_oracles_tests() - - -if __name__ == '__main__': - CryptoconditionsOraclesTest().main() diff --git a/qa/rpc-tests/cryptoconditions_rewards.py b/qa/rpc-tests/cryptoconditions_rewards.py deleted file mode 100755 index 2144ba673..000000000 --- a/qa/rpc-tests/cryptoconditions_rewards.py +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers -# Copyright (c) 2018 SuperNET developers -# Distributed under the GPLv3 software license, see the accompanying -# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html - - -from test_framework.test_framework import CryptoconditionsTestFramework -from test_framework.authproxy import JSONRPCException -from test_framework.util import assert_equal, assert_greater_than, \ - initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \ - stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises -from cryptoconditions import assert_success, assert_error, generate_random_string - - -class CryptoconditionsRewardsTest(CryptoconditionsTestFramework): - - def run_rewards_tests(self): - - rpc = self.nodes[0] - - result = rpc.rewardsaddress() - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - result = rpc.rewardsaddress(self.pubkey) - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - # no rewards yet - result = rpc.rewardslist() - assert_equal(result, []) - - # looking up non-existent reward should return error - result = rpc.rewardsinfo("none") - assert_error(result) - - # creating rewards plan with name > 8 chars, should return error - result = rpc.rewardscreatefunding("STUFFSTUFF", "7777", "25", "0", "10", "10") - assert_error(result) - - # creating rewards plan with 0 funding - result = rpc.rewardscreatefunding("STUFF", "0", "25", "0", "10", "10") - assert_error(result) - - # creating rewards plan with 0 maxdays - result = rpc.rewardscreatefunding("STUFF", "7777", "25", "0", "10", "0") - assert_error(result) - - # creating rewards plan with > 25% APR - result = rpc.rewardscreatefunding("STUFF", "7777", "30", "0", "10", "10") - assert_error(result) - - # creating valid rewards plan - result = rpc.rewardscreatefunding("STUFF", "7777", "25", "0", "10", "10") - assert result['hex'], 'got raw xtn' - fundingtxid = rpc.sendrawtransaction(result['hex']) - assert fundingtxid, 'got txid' - - # confirm the above xtn - rpc.generate(1) - result = rpc.rewardsinfo(fundingtxid) - assert_success(result) - assert_equal(result['name'], 'STUFF') - assert_equal(result['APR'], "25.00000000") - assert_equal(result['minseconds'], 0) - assert_equal(result['maxseconds'], 864000) - assert_equal(result['funding'], "7777.00000000") - assert_equal(result['mindeposit'], "10.00000000") - assert_equal(result['fundingtxid'], fundingtxid) - - # checking if new plan in rewardslist - result = rpc.rewardslist() - assert_equal(result[0], fundingtxid) - - # creating reward plan with already existing name, should return error - result = rpc.rewardscreatefunding("STUFF", "7777", "25", "0", "10", "10") - assert_error(result) - - # add funding amount must be positive - result = rpc.rewardsaddfunding("STUFF", fundingtxid, "-1") - assert_error(result) - - # add funding amount must be positive - result = rpc.rewardsaddfunding("STUFF", fundingtxid, "0") - assert_error(result) - - # adding valid funding - result = rpc.rewardsaddfunding("STUFF", fundingtxid, "555") - addfundingtxid = self.send_and_mine(result['hex'], rpc) - assert addfundingtxid, 'got funding txid' - - # checking if funding added to rewardsplan - result = rpc.rewardsinfo(fundingtxid) - assert_equal(result['funding'], "8332.00000000") - - # trying to lock funds, locking funds amount must be positive - result = rpc.rewardslock("STUFF", fundingtxid, "-5") - assert_error(result) - - # trying to lock funds, locking funds amount must be positive - result = rpc.rewardslock("STUFF", fundingtxid, "0") - assert_error(result) - - # trying to lock less than the min amount is an error - result = rpc.rewardslock("STUFF", fundingtxid, "7") - assert_error(result) - - # locking funds in rewards plan - result = rpc.rewardslock("STUFF", fundingtxid, "10") - assert_success(result) - locktxid = result['hex'] - assert locktxid, "got lock txid" - - # locktxid has not been broadcast yet - result = rpc.rewardsunlock("STUFF", fundingtxid, locktxid) - assert_error(result) - - # broadcast xtn - txid = rpc.sendrawtransaction(locktxid) - assert txid, 'got txid from sendrawtransaction' - - # confirm the xtn above - rpc.generate(1) - - # will not unlock since reward amount is less than tx fee - result = rpc.rewardsunlock("STUFF", fundingtxid, locktxid) - assert_error(result) - - def run_test(self): - print("Mining blocks...") - rpc = self.nodes[0] - rpc1 = self.nodes[1] - # utxos from block 1 become mature in block 101 - if not self.options.noshutdown: - rpc.generate(101) - self.sync_all() - rpc.getinfo() - rpc1.getinfo() - # this corresponds to -pubkey above - print("Importing privkeys") - rpc.importprivkey(self.privkey) - rpc1.importprivkey(self.privkey1) - self.run_rewards_tests() - -if __name__ == '__main__': - CryptoconditionsRewardsTest().main() diff --git a/qa/rpc-tests/cryptoconditions_token.py b/qa/rpc-tests/cryptoconditions_token.py deleted file mode 100755 index 3c00279e8..000000000 --- a/qa/rpc-tests/cryptoconditions_token.py +++ /dev/null @@ -1,264 +0,0 @@ -#!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers -# Copyright (c) 2018 SuperNET developers -# Distributed under the GPLv3 software license, see the accompanying -# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html - - -from test_framework.test_framework import CryptoconditionsTestFramework -from test_framework.authproxy import JSONRPCException -from test_framework.util import assert_equal, assert_greater_than, \ - initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \ - stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises -from cryptoconditions import assert_success, assert_error, generate_random_string - - -class CryptoconditionsTokenTest(CryptoconditionsTestFramework): - - def run_token_tests(self): - - rpc = self.nodes[0] - rpc1 = self.nodes[1] - - result = rpc.tokenaddress() - assert_success(result) - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - result = rpc.tokenaddress(self.pubkey) - assert_success(result) - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - result = rpc.assetsaddress() - assert_success(result) - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - result = rpc.assetsaddress(self.pubkey) - assert_success(result) - for x in result.keys(): - if x.find('ddress') > 0: - assert_equal(result[x][0], 'R') - - # there are no tokens created yet - result = rpc.tokenlist() - assert_equal(result, []) - - # trying to create token with negative supply - result = rpc.tokencreate("NUKE", "-1987420", "no bueno supply") - assert_error(result) - - # creating token with name more than 32 chars - result = rpc.tokencreate("NUKE123456789012345678901234567890", "1987420", "name too long") - assert_error(result) - - # creating valid token - result = rpc.tokencreate("DUKE", "1987.420", "Duke's custom token") - assert_success(result) - - tokenid = self.send_and_mine(result['hex'], rpc) - - result = rpc.tokenlist() - assert_equal(result[0], tokenid) - - # there are no token orders yet - result = rpc.tokenorders(tokenid) - assert_equal(result, []) - - # getting token balance for non existing tokenid - result = rpc.tokenbalance(self.pubkey) - assert_error(result) - - # get token balance for token with pubkey - result = rpc.tokenbalance(tokenid, self.pubkey) - assert_success(result) - assert_equal(result['balance'], 198742000000) - assert_equal(result['tokenid'], tokenid) - - # get token balance for token without pubkey - result = rpc.tokenbalance(tokenid) - assert_success(result) - assert_equal(result['balance'], 198742000000) - assert_equal(result['tokenid'], tokenid) - - # this is not a valid assetid - result = rpc.tokeninfo(self.pubkey) - assert_error(result) - - # check tokeninfo for valid token - result = rpc.tokeninfo(tokenid) - assert_success(result) - assert_equal(result['tokenid'], tokenid) - assert_equal(result['owner'], self.pubkey) - assert_equal(result['name'], "DUKE") - assert_equal(result['supply'], 198742000000) - assert_equal(result['description'], "Duke's custom token") - - # invalid numtokens ask - result = rpc.tokenask("-1", tokenid, "1") - assert_error(result) - - # invalid numtokens ask - result = rpc.tokenask("0", tokenid, "1") - assert_error(result) - - # invalid price ask - result = rpc.tokenask("1", tokenid, "-1") - assert_error(result) - - # invalid price ask - result = rpc.tokenask("1", tokenid, "0") - assert_error(result) - - # invalid tokenid ask - result = rpc.tokenask("100", "deadbeef", "1") - assert_error(result) - - # valid ask - tokenask = rpc.tokenask("100", tokenid, "7.77") - tokenaskhex = tokenask['hex'] - tokenaskid = self.send_and_mine(tokenask['hex'], rpc) - result = rpc.tokenorders(tokenid) - order = result[0] - assert order, "found order" - - # invalid ask fillunits - result = rpc.tokenfillask(tokenid, tokenaskid, "0") - assert_error(result) - - # invalid ask fillunits - result = rpc.tokenfillask(tokenid, tokenaskid, "-777") - assert_error(result) - - # valid ask fillunits - fillask = rpc.tokenfillask(tokenid, tokenaskid, "777") - result = self.send_and_mine(fillask['hex'], rpc) - txid = result[0] - assert txid, "found txid" - - # should be no token orders - result = rpc.tokenorders(tokenid) - assert_equal(result, []) - - # checking ask cancellation - testorder = rpc.tokenask("100", tokenid, "7.77") - testorderid = self.send_and_mine(testorder['hex'], rpc) - # from other node (ensuring that second node have enough balance to cover txfee - # to get the actual error - not "not enough balance" one - rpc.sendtoaddress(rpc1.getnewaddress(), 1) - rpc.sendtoaddress(rpc1.getnewaddress(), 1) - rpc.generate(2) - self.sync_all() - result = rpc1.getbalance() - assert_greater_than(result, 0.1) - - result = rpc1.tokencancelask(tokenid, testorderid) - assert_error(result) - - # from valid node - cancel = rpc.tokencancelask(tokenid, testorderid) - self.send_and_mine(cancel["hex"], rpc) - result = rpc.tokenorders(tokenid) - assert_equal(result, []) - - - # invalid numtokens bid - result = rpc.tokenbid("-1", tokenid, "1") - assert_error(result) - - # invalid numtokens bid - result = rpc.tokenbid("0", tokenid, "1") - assert_error(result) - - # invalid price bid - result = rpc.tokenbid("1", tokenid, "-1") - assert_error(result) - - # invalid price bid - result = rpc.tokenbid("1", tokenid, "0") - assert_error(result) - - # invalid tokenid bid - result = rpc.tokenbid("100", "deadbeef", "1") - assert_error(result) - - tokenbid = rpc.tokenbid("100", tokenid, "10") - tokenbidhex = tokenbid['hex'] - tokenbidid = self.send_and_mine(tokenbid['hex'], rpc) - result = rpc.tokenorders(tokenid) - order = result[0] - assert order, "found order" - - # invalid bid fillunits - result = rpc.tokenfillbid(tokenid, tokenbidid, "0") - assert_error(result) - - # invalid bid fillunits - result = rpc.tokenfillbid(tokenid, tokenbidid, "-777") - assert_error(result) - - # valid bid fillunits - fillbid = rpc.tokenfillbid(tokenid, tokenbidid, "1000") - result = self.send_and_mine(fillbid['hex'], rpc) - txid = result[0] - assert txid, "found txid" - - # should be no token orders - result = rpc.tokenorders(tokenid) - assert_equal(result, []) - - # checking bid cancellation - testorder = rpc.tokenbid("100", tokenid, "7.77") - testorderid = self.send_and_mine(testorder['hex'], rpc) - - # from other node - result = rpc1.getbalance() - assert_greater_than(result, 0.1) - - result = rpc1.tokencancelbid(tokenid, testorderid) - assert_error(result) - - # from valid node - cancel = rpc.tokencancelbid(tokenid, testorderid) - self.send_and_mine(cancel["hex"], rpc) - result = rpc.tokenorders(tokenid) - assert_equal(result, []) - - # invalid token transfer amount (have to add status to CC code!) - randompubkey = "021a559101e355c907d9c553671044d619769a6e71d624f68bfec7d0afa6bd6a96" - result = rpc.tokentransfer(tokenid,randompubkey,"0") - assert_error(result) - - # invalid token transfer amount (have to add status to CC code!) - result = rpc.tokentransfer(tokenid,randompubkey,"-1") - assert_error(result) - - # valid token transfer - sendtokens = rpc.tokentransfer(tokenid,randompubkey,"1") - self.send_and_mine(sendtokens["hex"], rpc) - result = rpc.tokenbalance(tokenid,randompubkey) - assert_equal(result["balance"], 1) - - def run_test(self): - print("Mining blocks...") - rpc = self.nodes[0] - rpc1 = self.nodes[1] - # utxos from block 1 become mature in block 101 - if not self.options.noshutdown: - rpc.generate(101) - self.sync_all() - rpc.getinfo() - rpc1.getinfo() - # this corresponds to -pubkey above - print("Importing privkeys") - rpc.importprivkey(self.privkey) - rpc1.importprivkey(self.privkey1) - self.run_token_tests() - - -if __name__ == '__main__': - CryptoconditionsTokenTest().main() diff --git a/qa/rpc-tests/decodescript.py b/qa/rpc-tests/decodescript.py index 2a971be35..87f58f279 100755 --- a/qa/rpc-tests/decodescript.py +++ b/qa/rpc-tests/decodescript.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/disablewallet.py b/qa/rpc-tests/disablewallet.py index c405b4ffa..311ee254e 100755 --- a/qa/rpc-tests/disablewallet.py +++ b/qa/rpc-tests/disablewallet.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/dpowconfs.py b/qa/rpc-tests/dpowconfs.py index 1cc75dace..a3cc278d5 100755 --- a/qa/rpc-tests/dpowconfs.py +++ b/qa/rpc-tests/dpowconfs.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2019 Duke Leto who wrote "The SuperNET developers" while never agreeing to the developer agreement nor being listed in AUTHORS # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/feature_walletfile.py b/qa/rpc-tests/feature_walletfile.py index 769445cc5..1c0c5d30a 100755 --- a/qa/rpc-tests/feature_walletfile.py +++ b/qa/rpc-tests/feature_walletfile.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 """Test wallet file location.""" diff --git a/qa/rpc-tests/finalsaplingroot.py b/qa/rpc-tests/finalsaplingroot.py index fb3b3ec9a..84f31774d 100755 --- a/qa/rpc-tests/finalsaplingroot.py +++ b/qa/rpc-tests/finalsaplingroot.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/forknotify.py b/qa/rpc-tests/forknotify.py index e1636b98c..ce743f5e5 100755 --- a/qa/rpc-tests/forknotify.py +++ b/qa/rpc-tests/forknotify.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/fundrawtransaction.py b/qa/rpc-tests/fundrawtransaction.py index f0e3bfbe2..3badadc6d 100755 --- a/qa/rpc-tests/fundrawtransaction.py +++ b/qa/rpc-tests/fundrawtransaction.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/getblocktemplate.py b/qa/rpc-tests/getblocktemplate.py index 8c4343b32..ed67dd52f 100755 --- a/qa/rpc-tests/getblocktemplate.py +++ b/qa/rpc-tests/getblocktemplate.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2016 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/getblocktemplate_longpoll.py b/qa/rpc-tests/getblocktemplate_longpoll.py index 911e22efd..b836fe8e5 100755 --- a/qa/rpc-tests/getblocktemplate_longpoll.py +++ b/qa/rpc-tests/getblocktemplate_longpoll.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/getblocktemplate_proposals.py b/qa/rpc-tests/getblocktemplate_proposals.py index d718774b0..a0426d35b 100755 --- a/qa/rpc-tests/getblocktemplate_proposals.py +++ b/qa/rpc-tests/getblocktemplate_proposals.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/getchaintips.py b/qa/rpc-tests/getchaintips.py index 89062f232..ccc7f57fa 100755 --- a/qa/rpc-tests/getchaintips.py +++ b/qa/rpc-tests/getchaintips.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/hardforkdetection.py b/qa/rpc-tests/hardforkdetection.py index 2ba4584ce..5d97d9ec0 100755 --- a/qa/rpc-tests/hardforkdetection.py +++ b/qa/rpc-tests/hardforkdetection.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # # Test hard fork detection diff --git a/qa/rpc-tests/httpbasics.py b/qa/rpc-tests/httpbasics.py index 525d48b2a..f5a92efe9 100755 --- a/qa/rpc-tests/httpbasics.py +++ b/qa/rpc-tests/httpbasics.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/invalidateblock.py b/qa/rpc-tests/invalidateblock.py index a63ccc15d..33890765d 100755 --- a/qa/rpc-tests/invalidateblock.py +++ b/qa/rpc-tests/invalidateblock.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/invalidblockrequest.py b/qa/rpc-tests/invalidblockrequest.py index 001ef8a23..2e4d0a50e 100755 --- a/qa/rpc-tests/invalidblockrequest.py +++ b/qa/rpc-tests/invalidblockrequest.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # # Distributed under the GPLv3/X11 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/ivk_import_export.py b/qa/rpc-tests/ivk_import_export.py index 8fb943cbb..8bdd09fcc 100755 --- a/qa/rpc-tests/ivk_import_export.py +++ b/qa/rpc-tests/ivk_import_export.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2019 Bartlomiej Lisiecki # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/key_import_export.py b/qa/rpc-tests/key_import_export.py index 469a0589a..5f6511a8f 100755 --- a/qa/rpc-tests/key_import_export.py +++ b/qa/rpc-tests/key_import_export.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2017 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/keypool.py b/qa/rpc-tests/keypool.py index d2461f699..f05f74707 100755 --- a/qa/rpc-tests/keypool.py +++ b/qa/rpc-tests/keypool.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/listtransactions.py b/qa/rpc-tests/listtransactions.py index c5b91ea1d..27e2a4a16 100755 --- a/qa/rpc-tests/listtransactions.py +++ b/qa/rpc-tests/listtransactions.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/maxblocksinflight.py b/qa/rpc-tests/maxblocksinflight.py index e2a301708..770198c35 100755 --- a/qa/rpc-tests/maxblocksinflight.py +++ b/qa/rpc-tests/maxblocksinflight.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # # Distributed under the GPLv3/X11 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/mempool_nu_activation.py b/qa/rpc-tests/mempool_nu_activation.py index 581f9ba76..bebc5a9da 100755 --- a/qa/rpc-tests/mempool_nu_activation.py +++ b/qa/rpc-tests/mempool_nu_activation.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/mempool_reorg.py b/qa/rpc-tests/mempool_reorg.py index 9d7f36341..789082860 100755 --- a/qa/rpc-tests/mempool_reorg.py +++ b/qa/rpc-tests/mempool_reorg.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/mempool_resurrect_test.py b/qa/rpc-tests/mempool_resurrect_test.py index 94f1d4af7..a6683554f 100755 --- a/qa/rpc-tests/mempool_resurrect_test.py +++ b/qa/rpc-tests/mempool_resurrect_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/mempool_spendcoinbase.py b/qa/rpc-tests/mempool_spendcoinbase.py index edd484af7..056f5d2a2 100755 --- a/qa/rpc-tests/mempool_spendcoinbase.py +++ b/qa/rpc-tests/mempool_spendcoinbase.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/mempool_tx_expiry.py b/qa/rpc-tests/mempool_tx_expiry.py index 795ec9666..fbd1de614 100755 --- a/qa/rpc-tests/mempool_tx_expiry.py +++ b/qa/rpc-tests/mempool_tx_expiry.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/mempool_tx_input_limit.py b/qa/rpc-tests/mempool_tx_input_limit.py index 2c4b50572..a85aa4b14 100755 --- a/qa/rpc-tests/mempool_tx_input_limit.py +++ b/qa/rpc-tests/mempool_tx_input_limit.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2017 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/merkle_blocks.py b/qa/rpc-tests/merkle_blocks.py index 151c3cb71..7b4f88aca 100755 --- a/qa/rpc-tests/merkle_blocks.py +++ b/qa/rpc-tests/merkle_blocks.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/nodehandling.py b/qa/rpc-tests/nodehandling.py index 67b0ec313..dc8d891f7 100755 --- a/qa/rpc-tests/nodehandling.py +++ b/qa/rpc-tests/nodehandling.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/nspv_client_test.py b/qa/rpc-tests/nspv_client_test.py index 989059058..250c97f65 100755 --- a/qa/rpc-tests/nspv_client_test.py +++ b/qa/rpc-tests/nspv_client_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 import sys diff --git a/qa/rpc-tests/p2p-acceptblock.py b/qa/rpc-tests/p2p-acceptblock.py index cd17190d0..d49d64bc7 100755 --- a/qa/rpc-tests/p2p-acceptblock.py +++ b/qa/rpc-tests/p2p-acceptblock.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # # Distributed under the GPLv3/X11 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/p2p_node_bloom.py b/qa/rpc-tests/p2p_node_bloom.py index ed17c2323..d5fb35ca7 100755 --- a/qa/rpc-tests/p2p_node_bloom.py +++ b/qa/rpc-tests/p2p_node_bloom.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/p2p_txexpiry_dos.py b/qa/rpc-tests/p2p_txexpiry_dos.py index 251195ca5..e94ec4fc0 100755 --- a/qa/rpc-tests/p2p_txexpiry_dos.py +++ b/qa/rpc-tests/p2p_txexpiry_dos.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/prioritisetransaction.py b/qa/rpc-tests/prioritisetransaction.py index bfdfa8ae5..143ffe465 100755 --- a/qa/rpc-tests/prioritisetransaction.py +++ b/qa/rpc-tests/prioritisetransaction.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2017 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/proxy_test.py b/qa/rpc-tests/proxy_test.py index 8fb1a4fa0..6a24ae49a 100755 --- a/qa/rpc-tests/proxy_test.py +++ b/qa/rpc-tests/proxy_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/pruning.py b/qa/rpc-tests/pruning.py index f4edea46c..1dc50daf3 100755 --- a/qa/rpc-tests/pruning.py +++ b/qa/rpc-tests/pruning.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/rawtransactions.py b/qa/rpc-tests/rawtransactions.py index e5a66f2e6..49f020da8 100755 --- a/qa/rpc-tests/rawtransactions.py +++ b/qa/rpc-tests/rawtransactions.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/receivedby.py b/qa/rpc-tests/receivedby.py index 73cc6b9ac..9893cf188 100755 --- a/qa/rpc-tests/receivedby.py +++ b/qa/rpc-tests/receivedby.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/regtest_signrawtransaction.py b/qa/rpc-tests/regtest_signrawtransaction.py index e47bcebac..d4129ee59 100755 --- a/qa/rpc-tests/regtest_signrawtransaction.py +++ b/qa/rpc-tests/regtest_signrawtransaction.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/reindex.py b/qa/rpc-tests/reindex.py index a6ffda7f4..fa1454bae 100755 --- a/qa/rpc-tests/reindex.py +++ b/qa/rpc-tests/reindex.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Released under the GPLv3 # # Test -reindex with CheckBlockIndex diff --git a/qa/rpc-tests/rest.py b/qa/rpc-tests/rest.py index 3368f7b2f..d801b5e9f 100755 --- a/qa/rpc-tests/rest.py +++ b/qa/rpc-tests/rest.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/rewind_index.py b/qa/rpc-tests/rewind_index.py index d08ef4f50..460f9b81f 100755 --- a/qa/rpc-tests/rewind_index.py +++ b/qa/rpc-tests/rewind_index.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/rpcbind_test.py b/qa/rpc-tests/rpcbind_test.py index 78e13879f..efe2e8d49 100755 --- a/qa/rpc-tests/rpcbind_test.py +++ b/qa/rpc-tests/rpcbind_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/script_test.py b/qa/rpc-tests/script_test.py index b64df0654..fbd0c674c 100755 --- a/qa/rpc-tests/script_test.py +++ b/qa/rpc-tests/script_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # # Distributed under the GPLv3/X11 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/signrawtransaction_offline.py b/qa/rpc-tests/signrawtransaction_offline.py index 1abf5d93d..dc5aea88b 100755 --- a/qa/rpc-tests/signrawtransaction_offline.py +++ b/qa/rpc-tests/signrawtransaction_offline.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 diff --git a/qa/rpc-tests/signrawtransactions.py b/qa/rpc-tests/signrawtransactions.py index f44903368..ff3cd2d45 100755 --- a/qa/rpc-tests/signrawtransactions.py +++ b/qa/rpc-tests/signrawtransactions.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/smartfees.py b/qa/rpc-tests/smartfees.py index 690eb2c52..288be21cb 100755 --- a/qa/rpc-tests/smartfees.py +++ b/qa/rpc-tests/smartfees.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/spentindex.py b/qa/rpc-tests/spentindex.py index a9456343f..5527f0e04 100755 --- a/qa/rpc-tests/spentindex.py +++ b/qa/rpc-tests/spentindex.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/test_framework/authproxy.py b/qa/rpc-tests/test_framework/authproxy.py index 99eec966a..366140aab 100644 --- a/qa/rpc-tests/test_framework/authproxy.py +++ b/qa/rpc-tests/test_framework/authproxy.py @@ -1,4 +1,5 @@ -# Copyright (c) 2016-2023 The Hush developers +#!/usr/bin/env python2 +# Copyright (c) 2016-2024 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 diff --git a/qa/rpc-tests/test_framework/bignum.py b/qa/rpc-tests/test_framework/bignum.py index 3ac80f28b..de5bf3f0e 100644 --- a/qa/rpc-tests/test_framework/bignum.py +++ b/qa/rpc-tests/test_framework/bignum.py @@ -1,4 +1,5 @@ -# Copyright (c) 2016-2023 The Hush developers +#!/usr/bin/env python2 +# Copyright (c) 2016-2024 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 # This file is from python-bitcoinlib. diff --git a/qa/rpc-tests/test_framework/blockstore.py b/qa/rpc-tests/test_framework/blockstore.py index a72e299c2..5a3e911e2 100644 --- a/qa/rpc-tests/test_framework/blockstore.py +++ b/qa/rpc-tests/test_framework/blockstore.py @@ -1,4 +1,5 @@ -# Copyright (c) 2016-2023 The Hush developers +#!/usr/bin/env python2 +# Copyright (c) 2016-2024 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 # BlockStore: a helper class that keeps a map of blocks and implements diff --git a/qa/rpc-tests/test_framework/blocktools.py b/qa/rpc-tests/test_framework/blocktools.py index c3dbe1e91..6f111f3bf 100644 --- a/qa/rpc-tests/test_framework/blocktools.py +++ b/qa/rpc-tests/test_framework/blocktools.py @@ -1,4 +1,5 @@ -# Copyright (c) 2016-2023 The Hush developers +#!/usr/bin/env python2 +# Copyright (c) 2016-2024 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 # blocktools.py - utilities for manipulating blocks and transactions diff --git a/qa/rpc-tests/test_framework/comptool.py b/qa/rpc-tests/test_framework/comptool.py index 6cc86b7ee..fb6084284 100755 --- a/qa/rpc-tests/test_framework/comptool.py +++ b/qa/rpc-tests/test_framework/comptool.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 diff --git a/qa/rpc-tests/test_framework/equihash.py b/qa/rpc-tests/test_framework/equihash.py index 0687e146c..7a182274d 100755 --- a/qa/rpc-tests/test_framework/equihash.py +++ b/qa/rpc-tests/test_framework/equihash.py @@ -1,4 +1,5 @@ -# Copyright (c) 2016-2023 The Hush developers +#!/usr/bin/env python2 +# Copyright (c) 2016-2024 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 from operator import itemgetter diff --git a/qa/rpc-tests/test_framework/mininode.py b/qa/rpc-tests/test_framework/mininode.py index cf6e27573..69120e5b8 100755 --- a/qa/rpc-tests/test_framework/mininode.py +++ b/qa/rpc-tests/test_framework/mininode.py @@ -1,4 +1,5 @@ -# Copyright (c) 2016-2023 The Hush developers +#!/usr/bin/env python2 +# Copyright (c) 2016-2024 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 # mininode.py - Bitcoin P2P network half-a-node diff --git a/qa/rpc-tests/test_framework/netutil.py b/qa/rpc-tests/test_framework/netutil.py index 58ca50f4b..cbccaf2e8 100644 --- a/qa/rpc-tests/test_framework/netutil.py +++ b/qa/rpc-tests/test_framework/netutil.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/test_framework/script.py b/qa/rpc-tests/test_framework/script.py index fac036afe..29ac60ab7 100644 --- a/qa/rpc-tests/test_framework/script.py +++ b/qa/rpc-tests/test_framework/script.py @@ -1,4 +1,5 @@ -# Copyright (c) 2016-2023 The Hush developers +#!/usr/bin/env python2 +# Copyright (c) 2016-2024 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 # This file is modified from python-bitcoinlib. diff --git a/qa/rpc-tests/test_framework/socks5.py b/qa/rpc-tests/test_framework/socks5.py index 3ea71119c..16a2d4cbe 100644 --- a/qa/rpc-tests/test_framework/socks5.py +++ b/qa/rpc-tests/test_framework/socks5.py @@ -1,4 +1,5 @@ -# Copyright (c) 2016-2023 The Hush developers +#!/usr/bin/env python2 +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/test_framework/test_framework.py b/qa/rpc-tests/test_framework/test_framework.py index 2fdfe028e..ff9cfaea6 100755 --- a/qa/rpc-tests/test_framework/test_framework.py +++ b/qa/rpc-tests/test_framework/test_framework.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 # Base class for RPC testing diff --git a/qa/rpc-tests/timestampindex.py b/qa/rpc-tests/timestampindex.py index 770f54554..2116e9c4c 100755 --- a/qa/rpc-tests/timestampindex.py +++ b/qa/rpc-tests/timestampindex.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/txindex.py b/qa/rpc-tests/txindex.py index 6d2c45c5a..2283a9e92 100755 --- a/qa/rpc-tests/txindex.py +++ b/qa/rpc-tests/txindex.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/txn_doublespend.py b/qa/rpc-tests/txn_doublespend.py index 5c6a28357..66780cea6 100755 --- a/qa/rpc-tests/txn_doublespend.py +++ b/qa/rpc-tests/txn_doublespend.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py index 2047f9e0b..8c159e50d 100755 --- a/qa/rpc-tests/wallet.py +++ b/qa/rpc-tests/wallet.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_1941.py b/qa/rpc-tests/wallet_1941.py index 039008b22..aa2dbd1ee 100755 --- a/qa/rpc-tests/wallet_1941.py +++ b/qa/rpc-tests/wallet_1941.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2016 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_addresses.py b/qa/rpc-tests/wallet_addresses.py index 7c3a1f6b2..fabd5be06 100755 --- a/qa/rpc-tests/wallet_addresses.py +++ b/qa/rpc-tests/wallet_addresses.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_anchorfork.py b/qa/rpc-tests/wallet_anchorfork.py index 59be606f0..75784b92d 100755 --- a/qa/rpc-tests/wallet_anchorfork.py +++ b/qa/rpc-tests/wallet_anchorfork.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_changeindicator.py b/qa/rpc-tests/wallet_changeindicator.py index 4ce3126ef..201f7ab6d 100755 --- a/qa/rpc-tests/wallet_changeindicator.py +++ b/qa/rpc-tests/wallet_changeindicator.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_import_export.py b/qa/rpc-tests/wallet_import_export.py index 502cc3936..81e8d2450 100755 --- a/qa/rpc-tests/wallet_import_export.py +++ b/qa/rpc-tests/wallet_import_export.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_listnotes.py b/qa/rpc-tests/wallet_listnotes.py index 6172cc45a..7d7fc38b3 100755 --- a/qa/rpc-tests/wallet_listnotes.py +++ b/qa/rpc-tests/wallet_listnotes.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_listreceived.py b/qa/rpc-tests/wallet_listreceived.py index 2856c642d..4d3d5cf18 100755 --- a/qa/rpc-tests/wallet_listreceived.py +++ b/qa/rpc-tests/wallet_listreceived.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_mergetoaddress.py b/qa/rpc-tests/wallet_mergetoaddress.py index 8a2e2cf8f..452f031d9 100755 --- a/qa/rpc-tests/wallet_mergetoaddress.py +++ b/qa/rpc-tests/wallet_mergetoaddress.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2017 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_nullifiers.py b/qa/rpc-tests/wallet_nullifiers.py index 6322ef4d8..d7b039b97 100755 --- a/qa/rpc-tests/wallet_nullifiers.py +++ b/qa/rpc-tests/wallet_nullifiers.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2016 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_overwintertx.py b/qa/rpc-tests/wallet_overwintertx.py index c6d764eb6..78fc4f009 100755 --- a/qa/rpc-tests/wallet_overwintertx.py +++ b/qa/rpc-tests/wallet_overwintertx.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_persistence.py b/qa/rpc-tests/wallet_persistence.py index b40782879..a3b7a8c72 100755 --- a/qa/rpc-tests/wallet_persistence.py +++ b/qa/rpc-tests/wallet_persistence.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_protectcoinbase.py b/qa/rpc-tests/wallet_protectcoinbase.py index 98ca1fe11..c23f67567 100755 --- a/qa/rpc-tests/wallet_protectcoinbase.py +++ b/qa/rpc-tests/wallet_protectcoinbase.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2016 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_sapling.py b/qa/rpc-tests/wallet_sapling.py index cca928c44..d7beed817 100755 --- a/qa/rpc-tests/wallet_sapling.py +++ b/qa/rpc-tests/wallet_sapling.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_shieldcoinbase.py b/qa/rpc-tests/wallet_shieldcoinbase.py index 889b6ad36..cd2601103 100755 --- a/qa/rpc-tests/wallet_shieldcoinbase.py +++ b/qa/rpc-tests/wallet_shieldcoinbase.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2017 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_shieldcoinbase_sapling.py b/qa/rpc-tests/wallet_shieldcoinbase_sapling.py index 0c0aafe93..7aeb73c7b 100755 --- a/qa/rpc-tests/wallet_shieldcoinbase_sapling.py +++ b/qa/rpc-tests/wallet_shieldcoinbase_sapling.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 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 import inspect diff --git a/qa/rpc-tests/wallet_treestate.py b/qa/rpc-tests/wallet_treestate.py index 20f3d4569..6d32ea9eb 100755 --- a/qa/rpc-tests/wallet_treestate.py +++ b/qa/rpc-tests/wallet_treestate.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2016 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/walletbackup.py b/qa/rpc-tests/walletbackup.py index 66d67c7d2..7b5154608 100755 --- a/qa/rpc-tests/walletbackup.py +++ b/qa/rpc-tests/walletbackup.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/zapwallettxes.py b/qa/rpc-tests/zapwallettxes.py index 824c05c65..98c7926d4 100755 --- a/qa/rpc-tests/zapwallettxes.py +++ b/qa/rpc-tests/zapwallettxes.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/zkey_import_export.py b/qa/rpc-tests/zkey_import_export.py index 6c7baa35d..e55e46fff 100755 --- a/qa/rpc-tests/zkey_import_export.py +++ b/qa/rpc-tests/zkey_import_export.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2016-2024 The Hush developers # Copyright (c) 2017 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/share/genbuild.sh b/share/genbuild.sh index 65720456b..08fb91dc5 100755 --- a/share/genbuild.sh +++ b/share/genbuild.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2018-2023 The Hush developers +# Copyright (c) 2018-2024 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 if [ $# -gt 1 ]; then diff --git a/src/Makefile.am b/src/Makefile.am index 7869af310..846c941fb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,8 +1,8 @@ -# Copyright 2016-2023 The Hush developers +# Copyright 2016-2024 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 -DIST_SUBDIRS = secp256k1 univalue cryptoconditions +DIST_SUBDIRS = secp256k1 univalue AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) $(SAN_LDFLAGS) $(HARDENED_LDFLAGS) AM_CXXFLAGS = $(SAN_CXXFLAGS) $(HARDENED_CXXFLAGS) $(ERROR_CXXFLAGS) @@ -35,9 +35,6 @@ BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BDB_CPPFLAGS) $(BOOST_CPPFLAG BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include BITCOIN_INCLUDES += -I$(srcdir)/cc/includes -BITCOIN_INCLUDES += -I$(srcdir)/cryptoconditions/include -BITCOIN_INCLUDES += -I$(srcdir)/cryptoconditions/src -BITCOIN_INCLUDES += -I$(srcdir)/cryptoconditions/src/asn BITCOIN_INCLUDES += -I$(srcdir)/univalue/include BITCOIN_INCLUDES += -I$(srcdir)/leveldb/include @@ -57,7 +54,6 @@ LIBBITCOIN_CLI=libbitcoin_cli.a LIBBITCOIN_UTIL=libbitcoin_util.a LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a LIBSECP256K1=secp256k1/libsecp256k1.la -LIBCRYPTOCONDITIONS=cryptoconditions/libcryptoconditions_core.la LIBUNIVALUE=univalue/libunivalue.la LIBZCASH=libzcash.a LIBHUSH=libhush.a @@ -76,9 +72,6 @@ $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*) $(LIBUNIVALUE): $(wildcard univalue/lib/*) $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) OPTFLAGS="-O2 -march=$(PLATFORM_VARIANT) -g " -$(LIBCRYPTOCONDITIONS): $(wildcard cryptoconditions/src/*) $(wildcard cryptoconditions/include/*) - $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) OPTFLAGS="-O2 -march=$(PLATFORM_VARIANT) -g " - # Make is not made aware of per-object dependencies to avoid limiting building parallelization # But to build the less dependent modules first, we manually select their order here: EXTRA_LIBRARIES += \ @@ -272,28 +265,9 @@ libbitcoin_server_a_SOURCES = \ asyncrpcqueue.cpp \ bloom.cpp \ cc/eval.cpp \ - cc/import.cpp \ - cc/importgateway.cpp \ - cc/CCassetsCore.cpp \ cc/CCcustom.cpp \ cc/CCtx.cpp \ cc/CCutils.cpp \ - cc/CCtokens.cpp \ - cc/assets.cpp \ - cc/faucet.cpp \ - cc/rewards.cpp \ - cc/dice.cpp \ - cc/lotto.cpp \ - cc/fsm.cpp \ - cc/heir.cpp \ - cc/oracles.cpp \ - cc/prices.cpp \ - cc/pegs.cpp \ - cc/payments.cpp \ - cc/gateways.cpp \ - cc/channels.cpp \ - cc/auction.cpp \ - cc/betprotocol.cpp \ chain.cpp \ checkpoints.cpp \ fs.cpp \ @@ -347,9 +321,6 @@ libbitcoin_wallet_a_SOURCES = \ zcash/Note.cpp \ transaction_builder.cpp \ wallet/rpcdump.cpp \ - cc/CCtokens.cpp \ - cc/CCassetsCore.cpp \ - cc/CCassetstx.cpp \ cc/CCtx.cpp \ wallet/rpcwallet.cpp \ wallet/rpchushwallet.cpp \ @@ -414,7 +385,6 @@ libbitcoin_common_a_SOURCES = \ core_read.cpp \ core_write.cpp \ hash.cpp \ - importcoin.cpp \ key.cpp \ key_io.cpp \ keystore.cpp \ @@ -433,7 +403,6 @@ libbitcoin_common_a_SOURCES = \ script/sign.cpp \ script/standard.cpp \ transaction_builder.cpp \ - cc/CCtokenutils.cpp \ cc/CCutilbits.cpp \ $(BITCOIN_CORE_H) \ $(LIBZCASH_H) @@ -471,10 +440,6 @@ if GLIBC_BACK_COMPAT libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp endif -if ENABLE_TESTS -libbitcoin_server_a_SOURCES += rpc/testtransactions.cpp -endif - # cli libbitcoin_cli_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) @@ -508,7 +473,6 @@ hushd_LDADD = \ $(LIBLEVELDB) \ $(LIBMEMENV) \ $(LIBSECP256K1) \ - $(LIBCRYPTOCONDITIONS) \ $(LIBRANDOMX) if ENABLE_WALLET @@ -586,7 +550,6 @@ wallet_utility_LDADD = \ $(CRYPTO_LIBS) \ $(LIBZCASH) \ $(LIBZCASH_LIBS)\ - $(LIBCRYPTOCONDITIONS) \ $(LIBRANDOMX) endif @@ -609,7 +572,6 @@ hush_tx_LDADD = \ $(LIBHUSH) \ $(LIBBITCOIN_CRYPTO) \ $(LIBZCASH_LIBS) \ - $(LIBCRYPTOCONDITIONS) \ $(LIBRANDOMX) hush_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS) @@ -661,7 +623,7 @@ endif libzcashconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS) libzcashconsensus_la_LIBADD = $(LIBSECP256K1) -libzcashconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -I$(srcdir)/cryptoconditions/include -DBUILD_BITCOIN_INTERNAL +libzcashconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL libzcashconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) endif @@ -721,7 +683,7 @@ endif $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $( pubkeys,uint8_t p1,uint8_t p2,uint8_t p3,uint8_t p4); -UniValue GatewaysDeposit(const CPubKey& pk, uint64_t txfee,uint256 bindtxid,int32_t height,std::string refcoin,uint256 cointxid,int32_t claimvout,std::string deposithex,std::vectorproof,CPubKey destpub,int64_t amount); -UniValue GatewaysClaim(const CPubKey& pk, uint64_t txfee,uint256 bindtxid,std::string refcoin,uint256 deposittxid,CPubKey destpub,int64_t amount); -UniValue GatewaysWithdraw(const CPubKey& pk, uint64_t txfee,uint256 bindtxid,std::string refcoin,CPubKey withdrawpub,int64_t amount); -UniValue GatewaysPartialSign(const CPubKey& pk, uint64_t txfee,uint256 txidaddr,std::string refcoin,std::string hex); -UniValue GatewaysCompleteSigning(const CPubKey& pk, uint64_t txfee,uint256 txidaddr,std::string refcoin,std::string hex); -UniValue GatewaysMarkDone(const CPubKey& pk, uint64_t txfee,uint256 withdrawtxid,std::string refcoin); -UniValue GatewaysPendingDeposits(const CPubKey& pk, uint256 bindtxid,std::string refcoin); -UniValue GatewaysPendingWithdraws(const CPubKey& pk, uint256 bindtxid,std::string refcoin); -UniValue GatewaysProcessedWithdraws(const CPubKey& pk, uint256 bindtxid,std::string refcoin); - -// CCcustom -UniValue GatewaysInfo(uint256 bindtxid); -UniValue GatewaysExternalAddress(uint256 bindtxid,CPubKey pubkey); -UniValue GatewaysDumpPrivKey(uint256 bindtxid,CKey privkey); -UniValue GatewaysList(); - -#endif diff --git a/src/cc/CCHeir.h b/src/cc/CCHeir.h deleted file mode 100644 index 2701251b3..000000000 --- a/src/cc/CCHeir.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2016-2023 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 -/****************************************************************************** - * Copyright © 2014-2019 The SuperNET Developers. * - * * - * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * - * the top-level directory of this distribution for the individual copyright * - * holder information and the developer policies on copyright and licensing. * - * * - * Unless otherwise agreed in a custom licensing agreement, no part of the * - * SuperNET software, including this file may be copied, modified, propagated * - * or distributed except according to the terms contained in the LICENSE file * - * * - * Removal or modification of this copyright notice is prohibited. * - * * - ******************************************************************************/ - -#ifndef CC_HEIR_H -#define CC_HEIR_H - -#include "CCinclude.h" -#include "CCtokens.h" - -//#define EVAL_HEIR 0xea - -bool HeirValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn); - -class CoinHelper; -class TokenHelper; - -UniValue HeirFundCoinCaller(int64_t txfee, int64_t coins, std::string heirName, CPubKey heirPubkey, int64_t inactivityTimeSec, std::string memo); -UniValue HeirFundTokenCaller(int64_t txfee, int64_t satoshis, std::string heirName, CPubKey heirPubkey, int64_t inactivityTimeSec, std::string memo, uint256 tokenid); -UniValue HeirClaimCaller(uint256 fundingtxid, int64_t txfee, std::string amount); -UniValue HeirAddCaller(uint256 fundingtxid, int64_t txfee, std::string amount); -UniValue HeirInfo(uint256 fundingtxid); -UniValue HeirList(); - -#endif diff --git a/src/cc/CCImportGateway.h b/src/cc/CCImportGateway.h deleted file mode 100644 index ec75faec1..000000000 --- a/src/cc/CCImportGateway.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2016-2023 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 -/****************************************************************************** - * Copyright © 2014-2018 The SuperNET Developers. * - * * - * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * - * the top-level directory of this distribution for the individual copyright * - * holder information and the developer policies on copyright and licensing. * - * * - * Unless otherwise agreed in a custom licensing agreement, no part of the * - * SuperNET software, including this file may be copied, modified, propagated * - * or distributed except according to the terms contained in the LICENSE file * - * * - * Removal or modification of this copyright notice is prohibited. * - * * - ******************************************************************************/ - - -#ifndef CC_IMPORTGATEWAY_H -#define CC_IMPORTGATEWAY_H - -#include "CCinclude.h" - -// CCcustom -bool ImportGatewayValidate(struct CCcontract_info *cp,Eval *eval,const CTransaction &tx, uint32_t nIn); -bool ImportGatewayExactAmounts(bool goDeeper, struct CCcontract_info *cpTokens, int64_t &inputs, int64_t &outputs, Eval* eval, const CTransaction &tx, uint256 tokenid); -std::string ImportGatewayBind(uint64_t txfee,std::string coin,uint256 oracletxid,uint8_t M,uint8_t N,std::vector pubkeys,uint8_t p1,uint8_t p2,uint8_t p3,uint8_t p4); -std::string ImportGatewayDeposit(uint64_t txfee,uint256 bindtxid,int32_t height,std::string refcoin,uint256 burntxid,int32_t burnvout,std::string rawburntx,std::vectorproof,CPubKey destpub,int64_t amount); -std::string ImportGatewayWithdraw(uint64_t txfee,uint256 bindtxid,std::string refcoin,CPubKey withdrawpub,int64_t amount); -std::string ImportGatewayPartialSign(uint64_t txfee,uint256 lasttxid,std::string refcoin, std::string hex); -std::string ImportGatewayCompleteSigning(uint64_t txfee,uint256 lasttxid,std::string refcoin,std::string hex); -std::string ImportGatewayMarkDone(uint64_t txfee,uint256 completetxid,std::string refcoin); -UniValue ImportGatewayPendingWithdraws(uint256 bindtxid,std::string refcoin); -UniValue ImportGatewayProcessedWithdraws(uint256 bindtxid,std::string refcoin); -UniValue ImportGatewayExternalAddress(uint256 bindtxid,CPubKey pubkey); -UniValue ImportGatewayDumpPrivKey(uint256 bindtxid,CKey key); -UniValue ImportGatewayList(); -UniValue ImportGatewayInfo(uint256 bindtxid); -#endif diff --git a/src/cc/CCOracles.h b/src/cc/CCOracles.h deleted file mode 100644 index 9ab6082a4..000000000 --- a/src/cc/CCOracles.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2016-2023 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 -/****************************************************************************** - * Copyright © 2014-2019 The SuperNET Developers. * - * * - * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * - * the top-level directory of this distribution for the individual copyright * - * holder information and the developer policies on copyright and licensing. * - * * - * Unless otherwise agreed in a custom licensing agreement, no part of the * - * SuperNET software, including this file may be copied, modified, propagated * - * or distributed except according to the terms contained in the LICENSE file * - * * - * Removal or modification of this copyright notice is prohibited. * - * * - ******************************************************************************/ - - -#ifndef CC_ORACLES_H -#define CC_ORACLES_H - -#include "CCinclude.h" - -bool OraclesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn); -UniValue OracleCreate(const CPubKey& pk, int64_t txfee,std::string name,std::string description,std::string format); -UniValue OracleFund(const CPubKey& pk, int64_t txfee,uint256 oracletxid); -UniValue OracleRegister(const CPubKey& pk, int64_t txfee,uint256 oracletxid,int64_t datafee); -UniValue OracleSubscribe(const CPubKey& pk, int64_t txfee,uint256 oracletxid,CPubKey publisher,int64_t amount); -UniValue OracleData(const CPubKey& pk, int64_t txfee,uint256 oracletxid,std::vector data); -// CCcustom -UniValue OracleDataSample(uint256 reforacletxid,uint256 txid); -UniValue OracleDataSamples(uint256 reforacletxid,char* batonaddr,int32_t num); -UniValue OracleInfo(uint256 origtxid); -UniValue OraclesList(); - -#endif diff --git a/src/cc/CCPayments.h b/src/cc/CCPayments.h deleted file mode 100644 index 246a980d1..000000000 --- a/src/cc/CCPayments.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2016-2023 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 -/****************************************************************************** - * Copyright © 2014-2019 The SuperNET Developers. * - * * - * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * - * the top-level directory of this distribution for the individual copyright * - * holder information and the developer policies on copyright and licensing. * - * * - * Unless otherwise agreed in a custom licensing agreement, no part of the * - * SuperNET software, including this file may be copied, modified, propagated * - * or distributed except according to the terms contained in the LICENSE file * - * * - * Removal or modification of this copyright notice is prohibited. * - * * - ******************************************************************************/ - - -#ifndef CC_PAYMENTS_H -#define CC_PAYMENTS_H - -#include "CCinclude.h" -#include -#include - -#define PAYMENTS_TXFEE 10000 -#define PAYMENTS_MERGEOFSET 60 // 1H extra. -extern std::vector > vAddressSnapshot; -extern int32_t lastSnapShotHeight; - -bool PaymentsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn); - -// CCcustom -UniValue PaymentsRelease(struct CCcontract_info *cp,char *jsonstr); -UniValue PaymentsFund(struct CCcontract_info *cp,char *jsonstr); -UniValue PaymentsMerge(struct CCcontract_info *cp,char *jsonstr); -UniValue PaymentsTxidopret(struct CCcontract_info *cp,char *jsonstr); -UniValue PaymentsCreate(struct CCcontract_info *cp,char *jsonstr); -UniValue PaymentsAirdrop(struct CCcontract_info *cp,char *jsonstr); -UniValue PaymentsAirdropTokens(struct CCcontract_info *cp,char *jsonstr); -UniValue PaymentsInfo(struct CCcontract_info *cp,char *jsonstr); -UniValue PaymentsList(struct CCcontract_info *cp,char *jsonstr); - -#endif - diff --git a/src/cc/CCPegs.h b/src/cc/CCPegs.h deleted file mode 100644 index 197af430f..000000000 --- a/src/cc/CCPegs.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2016-2023 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 -/****************************************************************************** - * Copyright © 2014-2019 The SuperNET Developers. * - * * - * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * - * the top-level directory of this distribution for the individual copyright * - * holder information and the developer policies on copyright and licensing. * - * * - * Unless otherwise agreed in a custom licensing agreement, no part of the * - * SuperNET software, including this file may be copied, modified, propagated * - * or distributed except according to the terms contained in the LICENSE file * - * * - * Removal or modification of this copyright notice is prohibited. * - * * - ******************************************************************************/ - - -#ifndef CC_PEGS_H -#define CC_PEGS_H - -#include "CCinclude.h" - -bool PegsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn); - -// CCcustom -UniValue PegsCreate(const CPubKey& pk,uint64_t txfee,int64_t amount,std::vector bindtxids); -UniValue PegsFund(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid, int64_t amount); -UniValue PegsGet(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid, int64_t amount); -UniValue PegsRedeem(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid); -UniValue PegsLiquidate(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid, uint256 liquidatetxid); -UniValue PegsExchange(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid, int64_t amount); -UniValue PegsAccountHistory(const CPubKey& pk,uint256 pegstxid); -UniValue PegsAccountInfo(const CPubKey& pk,uint256 pegstxid); -UniValue PegsWorstAccounts(uint256 pegstxid); -UniValue PegsInfo(uint256 pegstxid); - -#endif diff --git a/src/cc/CCPrices.h b/src/cc/CCPrices.h deleted file mode 100644 index 592a63136..000000000 --- a/src/cc/CCPrices.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2016-2023 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 -/****************************************************************************** - * Copyright © 2014-2019 The SuperNET Developers. * - * * - * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * - * the top-level directory of this distribution for the individual copyright * - * holder information and the developer policies on copyright and licensing. * - * * - * Unless otherwise agreed in a custom licensing agreement, no part of the * - * SuperNET software, including this file may be copied, modified, propagated * - * or distributed except according to the terms contained in the LICENSE file * - * * - * Removal or modification of this copyright notice is prohibited. * - * * - ******************************************************************************/ - - -#ifndef CC_PRICES_H -#define CC_PRICES_H - -#include "hush_defs.h" -#include "CCinclude.h" - -int32_t hush_priceget(int64_t *buf64,int32_t ind,int32_t height,int32_t numblocks); -extern void GetHushEarlytxidScriptPub(); -extern CScript HUSH_EARLYTXID_SCRIPTPUB; - -// #define PRICES_DAYWINDOW ((3600*24/ASSETCHAINS_BLOCKTIME) + 1) // defined in hush_defs.h -#define PRICES_TXFEE 10000 -#define PRICES_MAXLEVERAGE 777 -#define PRICES_SMOOTHWIDTH 1 -#define HUSH_MAXPRICES 2048 // must be power of 2 and less than 8192 -#define HUSH_PRICEMASK (~(HUSH_MAXPRICES - 1)) // actually 1111 1000 0000 0000 -#define PRICES_WEIGHT (HUSH_MAXPRICES * 1) // 0000 1000 0000 0000 -#define PRICES_MULT (HUSH_MAXPRICES * 2) // 0001 0000 0000 0000 -#define PRICES_DIV (HUSH_MAXPRICES * 3) // 0001 1000 0000 0000 -#define PRICES_INV (HUSH_MAXPRICES * 4) // 0010 0000 0000 0000 -#define PRICES_MDD (HUSH_MAXPRICES * 5) // 0010 1000 0000 0000 -#define PRICES_MMD (HUSH_MAXPRICES * 6) // 0011 0000 0000 0000 -#define PRICES_MMM (HUSH_MAXPRICES * 7) // 0011 1000 0000 0000 -#define PRICES_DDD (HUSH_MAXPRICES * 8) // 0100 0000 0000 0000 - -//#define PRICES_NORMFACTOR (int64_t)(SATOSHIDEN) -//#define PRICES_POINTFACTOR (int64_t)10000 - -#define PRICES_REVSHAREDUST 10000 -#define PRICES_SUBREVSHAREFEE(amount) ((amount) * 199 / 200) // revshare fee percentage == 0.005 -#define PRICES_MINAVAILFUNDFRACTION 0.1 // leveraged bet limit < fund fraction - -bool PricesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn); - -// CCcustom -UniValue PricesBet(int64_t txfee,int64_t amount,int16_t leverage,std::vector synthetic); -UniValue PricesAddFunding(int64_t txfee,uint256 bettxid,int64_t amount); -UniValue PricesSetcostbasis(int64_t txfee,uint256 bettxid); -UniValue PricesRekt(int64_t txfee,uint256 bettxid,int32_t rektheight); -UniValue PricesCashout(int64_t txfee,uint256 bettxid); -UniValue PricesInfo(uint256 bettxid,int32_t refheight); -UniValue PricesList(uint32_t filter, CPubKey mypk); -UniValue PricesGetOrderbook(); -UniValue PricesRefillFund(int64_t amount); - - -#endif diff --git a/src/cc/CC_made_easy.md b/src/cc/CC_made_easy.md deleted file mode 100644 index 146b7389c..000000000 --- a/src/cc/CC_made_easy.md +++ /dev/null @@ -1,715 +0,0 @@ -// Copyright (c) 2016-2023 The Hush developers -/****************************************************************************** - * Copyright © 2014-2019 The SuperNET Developers. * - * * - * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * - * the top-level directory of this distribution for the individual copyright * - * holder information and the developer policies on copyright and licensing. * - * * - * Unless otherwise agreed in a custom licensing agreement, no part of the * - * SuperNET software, including this file may be copied, modified, propagated * - * or distributed except according to the terms contained in the LICENSE file * - * * - * Removal or modification of this copyright notice is prohibited. * - * * - ******************************************************************************/ - -How to write utxo based CryptoConditions contracts for HUSH chains -by jl777 - -This is not the only smart contracts methodology that is possible to build on top of OP_CHECKCRYPTOCONDITION, just the first one. All the credit for getting OP_CHECKCRYPTOCONDITION working in the Hush codebase goes to @libscott. I am just hooking into the code that he made and tried to make it just a little easier to make new contracts. - -There is probably some fancy marketing name to use, but for now, I will just call it "CC contract" for short, knowing that it is not 100% technically accurate as the CryptoConditions aspect is not really the main attribute. However, the HUSH contracts were built to make the CryptoConditions codebase that was integrated into it to be more accessible. - -Since CC contracts run native C/C++ code, it is turing complete and that means that any contract that is possible to do on any other platform will be possible to create via CC contract. - -utxo based contracts are a bit harder to start writing than for balance based contracts. However, they are much more secure as they leverage the existing bitcoin utxo system. That makes it much harder to have bugs that issue a zillion new coins from a bug, since all the CC contract operations needs to also obey the existing bitcoin utxo protocol. - -This document will be heavily example based so it will utilize many of the existing reference CC contracts. After understanding this document, you should be in a good position to start creating either a new CC contract to be integrated into hushd or to make rpc based dapps directly. - -Chapter 0 - Bitcoin Protocol Basics -There are many aspects of the bitcoin protocol that isnt needed to understand the CC contracts dependence on it. Such details will not be discussed. The primary aspect is the utxo, unspent transaction output. Just a fancy name for txid/vout, so when you sendtoaddress some coins, it creates a txid and the first output is vout.0, combine it and txid/0 is a specific utxo. - -Of course, to understand even this level of detail requires that you understand what a txid is, but there are plenty of reference materials on that. It is basically the 64 char long set of letters and numbers that you get when you send funds. - -Implicit with the utxo is that it prevents double spends. Once you spend a utxo, you cant spend it again. This is quite an important characteristic and while advanced readers will point out chain reorgs can allow a double spend, we will not confuse the issue with such details. The important thing is that given a blockchain at a specific height's blockhash, you can know if a txid/vout has been spent or not. - -There are also the transactions that are in memory waiting to be mined, the mempool. And it is possible for the utxo to be spent by a tx in the mempool. However since it isnt confirmed yet, it is still unspent at the current height, even if we are pretty sure it will be spent in the next block. - -A useful example is to think about a queue of people lined up to get into an event. They need to have a valid ticket and also to get into the queue. After some time passes, they get their ticket stamped and allowed into the event. - -In the utxo case, the ticket is the spending transaction and the event is the confirmed blockchain. The queue is the mempool. - - -Chapter 1 - OP_CHECKCRYPTOCONDITION -In the prior chapter the utxo was explained. However, the specific mechanism used to send a payment was not explained. Contrary to what most people might think, on the blockchain there are not entries that say "pay X amount to address". Instead what exists is a bitcoin script that must be satisfied in order for the funds to be able to be spent. - -Originally, there was the pay to pubkey script: - - -About as simple of a payment script that you can get. Basically the pubkey's signature is checked and if it is valid, you get to spend it. One problem satoshi realized was that with Quantum Computers such payment scripts are vulnerable! So, he made a way to have a cold address, ie. an address whose pubkey isnt known. At least it isnt known until it is spent, so it is only Quantum resistant prior to the first spend. This line of reasoning is why we have one time use addresses and a new change address for each transaction. Maybe in some ways, this is too forward thinking as it makes things a lot more confusing to use and easier to lose track of all the required private keys. - -However, it is here to stay and its script is: - - -With this, the blockchain has what maps to "pay to address", just that the address is actually a base58 encoded (prefix + pubkeyhash). Hey, if it wasnt complicated, it would be easy! - -In order to spend a p2pkh (pay to pubkey hash) utxo, you need to divulge the pubkey in addition to having a valid signature. After the first spend from an address, its security is degraded to p2pk (pay to pubkey) as its pubkey is now known. The net result is that each reused address takes 25 extra bytes on the blockchain, and that is why for addresses that are expected to be reused, I just use the p2pk script. - -Originally, bitcoin allowed any type of script opcodes to be used directly. The problem was some of them caused problems and satoshi decided to disable them and only allow standard forms of payments. Thus the p2pk and p2pkh became 99%+ of bitcoin transactions. However, going from having a fully scriptable language that can create countless payment scripts (and bugs!), to having just 2... well it was a "short term" limitation. It did last for some years but eventually a compromise p2sh script was allowed to be standard. This is a pay to script hash, so it can have a standard format as the normal p2pkh, but have infinitely more flexibility. - -