Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into elysium-lelantus
Browse files Browse the repository at this point in the history
  • Loading branch information
sproxet committed Jun 17, 2021
2 parents bbd92d8 + 237d229 commit 06a8d07
Show file tree
Hide file tree
Showing 81 changed files with 5,675 additions and 177 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 14)
define(_CLIENT_VERSION_REVISION, 6)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_REVISION, 7)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2021)
define(_COPYRIGHT_HOLDERS,[The %s developers])
Expand Down
1 change: 1 addition & 0 deletions contrib/bitcoin-qt.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FORMS += \
../src/qt/forms/openuridialog.ui \
../src/qt/forms/optionsdialog.ui \
../src/qt/forms/overviewpage.ui \
../src/qt/forms/paymentcodepage.ui \
../src/qt/forms/receivecoinsdialog.ui \
../src/qt/forms/receiverequestdialog.ui \
../src/qt/forms/debugwindow.ui \
Expand Down
4 changes: 4 additions & 0 deletions qa/pull-tester/rpc-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@

# Unstable tests
#, 'dip4-coinbasemerkleroots.py'

# bip47
'bip47-sendreceive.py',
'bip47-walletrestore.py'
]
# if ENABLE_ZMQ:
# testScripts.append('zmq_test.py')
Expand Down
60 changes: 60 additions & 0 deletions qa/rpc-tests/bip47-sendreceive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env python3
# Copyright (c) 2017-2021 The Firo Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""dip47 sending receiving RPCs QA test.
"""

from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *

class Bip47SendReceive(BitcoinTestFramework):

def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.num_nodes = 3

def setup_network(self, split=False):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir)
connect_nodes_bi(self.nodes,0,1)
connect_nodes_bi(self.nodes,1,2)
connect_nodes_bi(self.nodes,0,2)
self.is_network_split=False
self.sync_all()

def run_test(self):

self.nodes[1].generate(1010)
node0_pcode = self.nodes[0].createpcode("node0-pcode0")

try:
self.nodes[1].setupchannel(node0_pcode)
raise AssertionError('Lelantus balance should be zero')
except JSONRPCException as e:
assert(e.error['code']==-6)

self.nodes[1].mintlelantus(1)
self.nodes[1].mintlelantus(1)
self.nodes[1].generate(10)
self.nodes[1].setupchannel(node0_pcode)
self.nodes[1].generate(1)
sync_blocks(self.nodes)
self.nodes[1].sendtopcode(node0_pcode, 10)

self.nodes[1].generate(1)
self.sync_all()

assert_equal(self.nodes[0].getbalance(), Decimal("10.0001"))

self.nodes[0].sendtoaddress(self.nodes[2].getaccountaddress(""), 9.99)

self.sync_all()
self.nodes[1].generate(1)
sync_blocks(self.nodes)

assert_equal(self.nodes[2].getbalance(), Decimal("9.99"))


if __name__ == '__main__':
Bip47SendReceive().main()
40 changes: 40 additions & 0 deletions qa/rpc-tests/bip47-walletrestore.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python3
# Copyright (c) 2017-2021 The Firo Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""dip47 sending receiving RPCs QA test.
"""

from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *

class Bip47WalletRestore(BitcoinTestFramework):

def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.num_nodes = 1

def setup_network(self, split=False):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir)

def run_test(self):
backup_file = os.path.join(self.options.tmpdir, "cleanwallet.bak")
wallet_file = os.path.join(self.options.tmpdir, "node0/regtest/wallet.dat")
self.nodes[0].backupwallet(backup_file)
initial_pcodes = [self.nodes[0].createpcode("pcode" + str(num)) for num in range(0,200)]
assert(len(initial_pcodes) == 200)

stop_node(self.nodes[0], 0)
os.remove(wallet_file)
shutil.copy(backup_file, wallet_file)

self.nodes[0] = start_node(0, self.options.tmpdir)
assert(len(self.nodes[0].listpcodes()) == 0)

for i in range(0, 200):
assert(initial_pcodes[i] == self.nodes[0].createpcode("pcode" + str(i)))


if __name__ == '__main__':
Bip47WalletRestore().main()
2 changes: 1 addition & 1 deletion qa/rpc-tests/llmq-cl-evospork.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def wait_for_chainlock_tip(self, node):

def wait_for_chainlock(self, node, block_hash):
t = time()
while time() - t < 15:
while time() - t < 30:
try:
block = node.getblock(block_hash)
if block["confirmations"] > 0 and block["chainlock"]:
Expand Down
11 changes: 11 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ BITCOIN_CORE_H = \
hdmint/mintpool.h \
hdmint/tracker.h \
hdmint/wallet.h \
bip47/defs.h \
bip47/account.h \
bip47/paymentchannel.h \
bip47/bip47utils.h \
bip47/paymentcode.h \
bip47/secretpoint.h \
sigma.h \
lelantus.h \
blacklists.h \
Expand Down Expand Up @@ -495,6 +501,11 @@ libbitcoin_wallet_a_SOURCES = \
wallet/authhelper.cpp \
hdmint/tracker.cpp \
policy/rbf.cpp \
bip47/account.cpp \
bip47/paymentchannel.cpp \
bip47/bip47utils.cpp \
bip47/paymentcode.cpp \
bip47/secretpoint.cpp \
primitives/mint_spend.cpp \
$(BITCOIN_CORE_H)

Expand Down
18 changes: 15 additions & 3 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ QT_FORMS_UI = \
qt/forms/debugwindow.ui \
qt/forms/sendcoinsdialog.ui \
qt/forms/sendcoinsentry.ui \
qt/forms/sendtopcodedialog.ui \
qt/forms/signverifymessagedialog.ui \
qt/forms/transactiondescdialog.ui \
qt/forms/sendmpdialog.ui \
Expand All @@ -127,7 +128,8 @@ QT_FORMS_UI = \
qt/forms/lookuptxdialog.ui \
qt/forms/txhistorydialog.ui \
qt/forms/elyassetsdialog.ui \
qt/forms/lelantusdialog.ui
qt/forms/lelantusdialog.ui \
qt/forms/createpcodedialog.ui

QT_MOC_CPP = \
qt/moc_addressbookpage.cpp \
Expand All @@ -147,6 +149,7 @@ QT_MOC_CPP = \
qt/moc_manualmintdialog.cpp \
qt/moc_coincontroltreewidget.cpp \
qt/moc_csvmodelwriter.cpp \
qt/moc_createpcodedialog.cpp \
qt/moc_editaddressdialog.cpp \
qt/moc_guiutil.cpp \
qt/moc_intro.cpp \
Expand All @@ -171,6 +174,7 @@ QT_MOC_CPP = \
qt/moc_rpcconsole.cpp \
qt/moc_sendcoinsdialog.cpp \
qt/moc_sendcoinsentry.cpp \
qt/moc_sendtopcodedialog.cpp \
qt/moc_signverifymessagedialog.cpp \
qt/moc_splashscreen.cpp \
qt/moc_trafficgraphwidget.cpp \
Expand All @@ -193,7 +197,8 @@ QT_MOC_CPP = \
qt/moc_lelantusdialog.cpp \
qt/moc_lelantuscoincontroldialog.cpp \
qt/moc_automintmodel.cpp \
qt/moc_automintnotification.cpp
qt/moc_automintnotification.cpp \
qt/moc_pcodemodel.cpp

BITCOIN_MM = \
qt/macdockiconhandler.mm \
Expand Down Expand Up @@ -230,6 +235,7 @@ BITCOIN_QT_H = \
qt/bitcoinunits.h \
qt/clientmodel.h \
qt/coincontroldialog.h \
qt/createpcodedialog.h \
qt/manualmintdialog.h \
qt/coincontroltreewidget.h \
qt/csvmodelwriter.h \
Expand All @@ -251,6 +257,7 @@ BITCOIN_QT_H = \
qt/overviewpage.h \
qt/paymentrequestplus.h \
qt/paymentserver.h \
qt/pcodemodel.h \
qt/peertablemodel.h \
qt/platformstyle.h \
qt/qvalidatedlineedit.h \
Expand All @@ -261,6 +268,7 @@ BITCOIN_QT_H = \
qt/rpcconsole.h \
qt/sendcoinsdialog.h \
qt/sendcoinsentry.h \
qt/sendtopcodedialog.h \
qt/signverifymessagedialog.h \
qt/splashscreen.h \
qt/trafficgraphwidget.h \
Expand Down Expand Up @@ -300,6 +308,7 @@ RES_ICONS = \
qt/res/icons/firo.png \
qt/res/icons/zerocoin.png \
qt/res/icons/sigma.png \
qt/res/icons/paymentcode.png \
qt/res/icons/masternodes.png \
qt/res/icons/qrcode.png \
qt/res/icons/chevron.png \
Expand Down Expand Up @@ -408,18 +417,21 @@ BITCOIN_QT_WALLET_CPP = \
qt/addresstablemodel.cpp \
qt/askpassphrasedialog.cpp \
qt/coincontroldialog.cpp \
qt/manualmintdialog.cpp \
qt/coincontroltreewidget.cpp \
qt/createpcodedialog.cpp \
qt/editaddressdialog.cpp \
qt/manualmintdialog.cpp \
qt/openuridialog.cpp \
qt/overviewpage.cpp \
qt/pcodemodel.cpp \
qt/paymentrequestplus.cpp \
qt/paymentserver.cpp \
qt/receivecoinsdialog.cpp \
qt/receiverequestdialog.cpp \
qt/recentrequeststablemodel.cpp \
qt/sendcoinsdialog.cpp \
qt/sendcoinsentry.cpp \
qt/sendtopcodedialog.cpp \
qt/signverifymessagedialog.cpp \
qt/transactiondesc.cpp \
qt/transactiondescdialog.cpp \
Expand Down
3 changes: 3 additions & 0 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ BITCOIN_TESTS = \
test/base58_tests.cpp \
test/base64_tests.cpp \
test/bip32_tests.cpp \
test/bip47_test_data.h \
test/bip47_tests.cpp \
test/bip47_serialization_tests.cpp \
test/blockencodings_tests.cpp \
test/bloom_tests.cpp \
test/bswap_tests.cpp \
Expand Down
4 changes: 2 additions & 2 deletions src/base58.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn);
* Decode a base58-encoded string (psz) that includes a checksum into a byte
* vector (vchRet), return true if decoding is successful
*/
inline bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet);
bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet);

/**
* Decode a base58-encoded string (str) that includes a checksum into a byte
* vector (vchRet), return true if decoding is successful
*/
inline bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet);
bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet);

/**
* Base class for all base58-encoded data
Expand Down
Loading

0 comments on commit 06a8d07

Please sign in to comment.