Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spark integration #1246

Merged
merged 201 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
960c380
Squash
AaronFeickert Dec 7, 2021
3dee12a
Replace coin cover sets with Merkle roots for transcript purposes
AaronFeickert Feb 14, 2022
1516c8c
Support multiple output coins in mint transactions
AaronFeickert Feb 22, 2022
1aa3915
Use aggregate Schnorr proofs for multiple-output mint transactions
AaronFeickert Feb 22, 2022
59c8013
Add versioning to proving system transcript labels
AaronFeickert Mar 11, 2022
70bdf50
Merge remote-tracking branch 'aaron/spark'
levonpetrosyan93 Mar 27, 2022
2b1d563
Merge branch 'master' into spark
levonpetrosyan93 Oct 17, 2022
7d5097a
Refactoring mobile api for Lelantus
levonpetrosyan93 Aug 26, 2021
1ef76de
Typo fixed
levonpetrosyan93 Aug 29, 2021
3aecf36
Updating getanonymityset rpc to get part of the set
levonpetrosyan93 Nov 1, 2021
82864b3
Adding getfeerate rpc
levonpetrosyan93 Nov 1, 2021
81a8c66
Parsing issue fixed
levonpetrosyan93 Nov 9, 2021
48f76d2
Fixing typo in getfeerate rpc
levonpetrosyan93 Nov 16, 2021
5f0b4c5
Adding getcoinsforrecovery rpc
levonpetrosyan93 Nov 22, 2021
a6e8a60
Including block hash into recovery rpc
levonpetrosyan93 Nov 25, 2021
aa03340
Fixed json creation in getcoinsforrecovery rpc
levonpetrosyan93 Nov 27, 2021
f7b2436
Putting tx hash instead of block hash into coin list for recovery
levonpetrosyan93 Dec 5, 2021
50cfa23
Pushing sets as vector of json files
levonpetrosyan93 Dec 7, 2021
3e346f0
Fixed json creation
levonpetrosyan93 Dec 8, 2021
7f364e6
Returning sets separately during restoration
levonpetrosyan93 Dec 13, 2021
96520de
Merge branch 'spark' into spark_
levonpetrosyan93 May 19, 2023
62345ff
getanonymityset and getusedcoinserials rpc calls refactored
levonpetrosyan93 Feb 19, 2022
a9fc275
Compilation fixed
levonpetrosyan93 Feb 19, 2022
ba96c1b
Fixed getusedcoinserials argument number bug
levonpetrosyan93 Feb 20, 2022
2b98715
Spark address/key serialization functions implemented
levonpetrosyan93 May 31, 2022
41a100d
CSparkWallet and mint db functions added
levonpetrosyan93 May 31, 2022
d1799e5
Spark mint tx creation, GetAvailableSparkCoins() implemented
levonpetrosyan93 May 31, 2022
9ba7eb9
Bind serial commitments to chain context
AaronFeickert Jun 2, 2022
54e704e
Use default curve generator for spend component
AaronFeickert Jun 2, 2022
508ab86
Completed merge
levonpetrosyan93 Jun 4, 2022
ed03245
Use default address when auto minting
levonpetrosyan93 Jun 5, 2022
8e6ae10
Adding domain separators when doing hashes
levonpetrosyan93 Jun 6, 2022
a98be5f
Adding version and checksum in address serialization
levonpetrosyan93 Jun 6, 2022
b720944
Saving serial_context into CSparkMintMeta
levonpetrosyan93 Jun 12, 2022
17836f4
Moving Spark related code into separate directory
levonpetrosyan93 Jun 16, 2022
ff4e4c2
Spark state implemented
levonpetrosyan93 Jun 27, 2022
20c75da
More state functionality implemented
levonpetrosyan93 Jun 27, 2022
9c3ade8
Adding Spark state into mempool
levonpetrosyan93 Jul 6, 2022
3b01ebc
More spark state functionality implemented
levonpetrosyan93 Aug 29, 2022
944d2c7
Embed KDF derived key size into hash instantiation
AaronFeickert Jun 22, 2022
0d043e5
Generalize range proofs to arbitrary set sizes
AaronFeickert Jun 22, 2022
de620af
WIP: spend verification batching
AaronFeickert Jun 24, 2022
72e8a1a
Use a key-committing AEAD construction
AaronFeickert Aug 9, 2022
2d6ea6d
Use base64 to make transferred data smaller
levonpetrosyan93 Sep 11, 2022
eb27133
Spark balance proof fixed
levonpetrosyan93 Sep 13, 2022
af04947
Index for mobile api optimized
levonpetrosyan93 Sep 14, 2022
852d73f
Adds an encoding method for address scrambling
AaronFeickert Sep 5, 2022
002eef2
Fix a typo
levonpetrosyan93 Sep 16, 2022
c334ccb
Switch from hex to `bech32m` encoding
AaronFeickert Sep 16, 2022
fb9a3a8
Add tests
AaronFeickert Sep 16, 2022
b1e209f
SpendTransaction refactored and added serialization for it
levonpetrosyan93 Sep 18, 2022
ca09978
Review comment applied and fixed a bug in mint generation
levonpetrosyan93 Sep 18, 2022
3cd5bee
Spark spend creation
levonpetrosyan93 Sep 26, 2022
be0469a
Spark spend verification
levonpetrosyan93 Oct 3, 2022
c4cf08c
More state functionality implemented and bug fixes
levonpetrosyan93 Oct 17, 2022
af959f1
Some bug fixes and cleanup
levonpetrosyan93 Oct 23, 2022
5c8f1cd
Bug fixes and review comments resolved
levonpetrosyan93 Oct 27, 2022
ee72bbf
More review comments resolved
levonpetrosyan93 Oct 28, 2022
f054741
Adding several rpc calls for spark
levonpetrosyan93 Oct 28, 2022
0d0d993
Adding more rpc calls
levonpetrosyan93 Oct 29, 2022
cf395e2
Failing unittests fixed
levonpetrosyan93 Oct 31, 2022
e8c4da1
Devnet Spark HF block
levonpetrosyan93 Nov 3, 2022
afca6ca
Version bump
levonpetrosyan93 Nov 3, 2022
776544c
LelantusToSpark function implemented
levonpetrosyan93 Nov 21, 2022
fb1b5c9
Refactoring of file paths
levonpetrosyan93 Nov 24, 2022
4621aad
lelantustospark rpc name refactored
levonpetrosyan93 Nov 24, 2022
387c37e
Adding check to stop lelantus on consensus level
levonpetrosyan93 Nov 24, 2022
bb3e6ac
Fixing bug resulting batch verification fail
levonpetrosyan93 Nov 27, 2022
e386937
Minor fixes on lelantustospark rpc
levonpetrosyan93 Nov 27, 2022
e357778
Use new thread to recognize spark mints/spends
levonpetrosyan93 Nov 27, 2022
686e2b8
Recognizing spark mints and spends during wallet scan
levonpetrosyan93 Nov 28, 2022
2391d9b
Wallet spark tx scanning
levonpetrosyan93 Dec 5, 2022
507f030
Spark limits
levonpetrosyan93 Dec 8, 2022
064e9fa
Version bump
levonpetrosyan93 Dec 8, 2022
529fa5c
Review fixes (#1218)
AaronFeickert Dec 11, 2022
217a9b0
Fix minor corner case issue
levonpetrosyan93 Dec 14, 2022
449ec45
Review fixes
levonpetrosyan93 Dec 14, 2022
9f3694d
Add spark fee into gettransaction rpc
levonpetrosyan93 Dec 15, 2022
35e94db
Fixing crashes on some platforms
levonpetrosyan93 Dec 16, 2022
133af22
Rpc tests fixed
levonpetrosyan93 Dec 23, 2022
1dfa94e
Rpc tests fixed
levonpetrosyan93 Dec 23, 2022
28481ce
Adding RPC tests for Spark
levonpetrosyan93 Dec 23, 2022
101a104
Merge branch 'master' into spark_
levonpetrosyan93 May 19, 2023
ce55d0a
Crashing issue and failing tests fixed
levonpetrosyan93 Jan 22, 2023
9796f26
Fixing unstable unittest
levonpetrosyan93 Jan 23, 2023
2a0d528
Fixed remining conflict
levonpetrosyan93 Feb 13, 2023
03c0b75
Adding several more unitests
levonpetrosyan93 Feb 19, 2023
db1a27d
Adding one more rpc test
levonpetrosyan93 Feb 20, 2023
a77d07f
Keeping some additional data in block index for mobile/light wallet
levonpetrosyan93 Feb 20, 2023
0542177
Memo encryption fixed and test added
levonpetrosyan93 Feb 22, 2023
6034303
Keep additional mint data for Lelantus only when -mobile passed
levonpetrosyan93 Feb 23, 2023
a16a56c
Spark mobile api
levonpetrosyan93 Feb 25, 2023
58e31c9
Minor inprovements
levonpetrosyan93 Feb 27, 2023
4c0d0f2
Adding more unitests
levonpetrosyan93 Feb 27, 2023
33e9246
Minor fixes
levonpetrosyan93 Mar 5, 2023
e1c5b20
Add one more unittest
levonpetrosyan93 Mar 10, 2023
7fbcd12
Detect zero challenges
levonpetrosyan93 Mar 20, 2023
e01e3db
isAddressMine implemented
levonpetrosyan93 Mar 30, 2023
f1b41ab
Typo fix
levonpetrosyan93 Mar 30, 2023
61dc3c5
Script tests fixed
levonpetrosyan93 Apr 5, 2023
7594d66
Spark state reset in tests
levonpetrosyan93 Apr 5, 2023
ff5ee24
isMine() fixed
levonpetrosyan93 Apr 6, 2023
a444b4a
Spark tx index
levonpetrosyan93 Apr 9, 2023
e4e44ae
Rpc test fix and more
levonpetrosyan93 Apr 10, 2023
cf36d94
Add mint limit in tx creation
levonpetrosyan93 Apr 10, 2023
1316f93
Devnet graceful period extended
levonpetrosyan93 Apr 10, 2023
5ddbdd5
Remove mint limit
levonpetrosyan93 Apr 10, 2023
13c3db4
Version bump
levonpetrosyan93 Apr 10, 2023
638341b
Spend limits fixed
levonpetrosyan93 Apr 17, 2023
48a83c8
Using json object instead of array
levonpetrosyan93 Apr 17, 2023
fd47c93
A little cleanup
levonpetrosyan93 Apr 24, 2023
6b63793
Add subtractFeeFromAmount in spark mint creation
levonpetrosyan93 May 8, 2023
a725327
Spend input number limit removed
levonpetrosyan93 May 8, 2023
b3bff1b
Offloaded signing (#1237)
AaronFeickert May 8, 2023
1fcd281
Version bump
levonpetrosyan93 May 8, 2023
510fc4a
Spark address prefix changed
levonpetrosyan93 May 8, 2023
f21a851
Compile error fixed
levonpetrosyan93 May 13, 2023
0716c95
GetChange for spark spend
levonpetrosyan93 May 14, 2023
0b52999
Rpc tests fixed
levonpetrosyan93 May 15, 2023
9937c98
Failing unitests fixed
levonpetrosyan93 May 15, 2023
14fc1ef
Rpc test failing
levonpetrosyan93 May 16, 2023
6ad10e7
Improve GetAvailableCredit performance
levonpetrosyan93 May 19, 2023
842b951
Merge branch 'master' into spark_
levonpetrosyan93 May 19, 2023
cbed257
Fixed undefined behavior and compilation for macOS
psolstice Mar 28, 2023
3530d43
Rebase finished
levonpetrosyan93 May 19, 2023
2596e4f
Spend conflict issue fixed
levonpetrosyan93 May 22, 2023
bccaab1
devnet restart
psolstice May 22, 2023
4ba6f0a
Smarter change recognition scheme implemented
levonpetrosyan93 May 25, 2023
6de1a79
Typo fixed
levonpetrosyan93 May 26, 2023
b959b41
LelantusToSpark fixed
levonpetrosyan93 May 26, 2023
4b6bd29
Added anonymize all rpc for spark
levonpetrosyan93 May 27, 2023
33d6d5c
fix spendspark corner case crash
levonpetrosyan93 Jun 4, 2023
e946fce
Fix one more minor bug in spark spend verification
levonpetrosyan93 Jun 5, 2023
6a7c0f9
Add getMintAmount function
levonpetrosyan93 Jun 7, 2023
6338e4b
Fix typo in automintspark RPC call (#1253)
justanwar Jun 8, 2023
d8059ec
Possible fix for crash on windows
levonpetrosyan93 Jun 12, 2023
94ed1a7
Update Spark addresses in RPC help with new format (#1256)
justanwar Jun 13, 2023
b92b5ec
Wallet refactoring
levonpetrosyan93 Jun 18, 2023
37cb204
Abandon spark transactions
levonpetrosyan93 Jun 18, 2023
ae69a23
Version bump
levonpetrosyan93 Jun 18, 2023
2952760
Recognize incoming spark mint
levonpetrosyan93 Jun 21, 2023
dfd34b7
Batch verification fixed
levonpetrosyan93 Jun 23, 2023
9dc82be
Recognize transparent output fixed
levonpetrosyan93 Jun 24, 2023
a350494
Anonymity set size changed
levonpetrosyan93 Jun 24, 2023
c5d398a
Testnet HF blocks set
levonpetrosyan93 Jul 2, 2023
8902456
Typo fixed
levonpetrosyan93 Jul 8, 2023
e33fd67
Lelantus graceful period check in rpc calls
levonpetrosyan93 Jul 9, 2023
0855b34
spendspark rpc refactored
levonpetrosyan93 Jul 10, 2023
ed7a36a
Help string updated
levonpetrosyan93 Jul 10, 2023
07c731d
Include spark balance into gettotalbalance rpc result
levonpetrosyan93 Jul 10, 2023
c170b6a
Fix crash for Apple's recent compiler on ARM64
psolstice Jul 10, 2023
ce29de5
Fix for compilation with recent Apple compiler
psolstice Jul 10, 2023
ede060b
Merge branch 'master' into spark
levonpetrosyan93 Jul 15, 2023
7f39073
rpc tests fixed
levonpetrosyan93 Jul 17, 2023
f72a9c5
getusedcoinserials fixed
levonpetrosyan93 Jul 28, 2023
f463bda
getusedcoinstags fixed
levonpetrosyan93 Jul 28, 2023
da8a7c1
Add spark mempool clear
levonpetrosyan93 Jul 31, 2023
4490b38
fix RPC syntax in help (#1289)
levoncrypto Aug 2, 2023
ddb04d8
Locked Wallet case covered
levonpetrosyan93 Aug 2, 2023
6b19882
french typo issue fixed (#1295)
levoncrypto Aug 4, 2023
239edee
lelantus manual-anonymize page fixed (#1293)
levoncrypto Aug 4, 2023
bf9e797
spark available balance included in getprivatebalance (#1296)
levoncrypto Aug 5, 2023
d41e5d0
Subtract fee issue fix
levonpetrosyan93 Aug 7, 2023
9506e7a
Reverting commit ddb04d8
levonpetrosyan93 Aug 10, 2023
30bcc53
Add a method to request wallet unlock.
Aug 7, 2023
66390e9
Drop buggy TableViewLastColumnResizingFixer class. bitcoin/bitcoin@fd…
levoncrypto Aug 10, 2023
aa843c6
fix Transaction tab resize issue
levoncrypto Aug 10, 2023
9ffd44b
Fixing tx not mined issue
levonpetrosyan93 Aug 12, 2023
8582fa4
switcher fix
levoncrypto Aug 12, 2023
e36b3ac
Merge pull request #1305 from firoorg/columns_resize
levonpetrosyan93 Aug 12, 2023
1a8a4f0
Making conditions look better
levonpetrosyan93 Aug 13, 2023
b0bea3b
Fix receive detail tab size issue (#1306)
levoncrypto Aug 18, 2023
39510e3
Spark IS fixed
levonpetrosyan93 Aug 20, 2023
29c9ec4
ZapSparkMints
levonpetrosyan93 Aug 20, 2023
a06df90
Test for Spark IS
levonpetrosyan93 Aug 20, 2023
3a77e84
Fixed broken spark state (#1307)
psolstice Aug 20, 2023
834bb8e
Bumped spark start block numbers for mainnet
psolstice Aug 25, 2023
3bc6419
Don't throw an exception in CSparkState::RemoveBlock
psolstice Aug 28, 2023
d563a22
QT: Transaction tab columns size fix (#1335)
levoncrypto Sep 21, 2023
5f4487b
Fixed crash when -mobile passed
levonpetrosyan93 Sep 25, 2023
cfbe51a
Unlock screen for spark first run
levonpetrosyan93 Oct 8, 2023
2139866
Temporarily bypass check for walletpassphrase rpc
levonpetrosyan93 Oct 9, 2023
0414c97
Depends NO_WALLET=1 setting fix (#1321)
levoncrypto Oct 12, 2023
4a91cbb
Spend remaining sigma coins in lelantustospark rpc
levonpetrosyan93 Oct 28, 2023
21586cb
Fix removetxmempool rpc
levonpetrosyan93 Oct 30, 2023
881ff26
Fix help strings for mint/spendspark rpc calls
levonpetrosyan93 Oct 30, 2023
d784332
Fix for #1328
levonpetrosyan93 Nov 6, 2023
a9adf57
Integrate Spark into QT (#1263)
giangnamnabka Nov 10, 2023
defcf05
Build fixed
levonpetrosyan93 Nov 12, 2023
33e39f6
RPC tests and more fixed
levonpetrosyan93 Nov 13, 2023
fc13c9d
Fix Github Actions (#1355)
justanwar Nov 14, 2023
3ba735d
Fixed QT crash on startup (#1312)
psolstice Nov 15, 2023
92a2050
Libspark fuzzing harness (#1340)
man2706kum Nov 16, 2023
e5e15f7
Fix getsparkanonymityset
levonpetrosyan93 Nov 16, 2023
5da3235
Fix second anonymity set bug
levonpetrosyan93 Nov 16, 2023
d2d27eb
Detect zero challenges in schnorr
levonpetrosyan93 Nov 17, 2023
f6f6c0f
Verion bump
levonpetrosyan93 Nov 17, 2023
a6e073b
Fix rpc help strings
levonpetrosyan93 Nov 17, 2023
54fb00f
Spark mainnet HF blocks set
levonpetrosyan93 Nov 20, 2023
cd3781a
Extended spork support for 1 more year
levonpetrosyan93 Nov 20, 2023
1a2d024
Set lelantus graceful period 2 years
levonpetrosyan93 Nov 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
working-directory: ${{ env.SOURCE_ARTIFACT }}
- name: Build Firo
run: |
./configure --disable-jni --enable-elysium --prefix=$(realpath depends/x86_64-w64-mingw32)
./configure --without-libs --disable-jni --enable-elysium --prefix=$(realpath depends/x86_64-w64-mingw32)
make -j$(nproc)
working-directory: ${{ env.SOURCE_ARTIFACT }}
- name: Prepare Files for Artifact
Expand Down Expand Up @@ -167,6 +167,9 @@ jobs:
run: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
- name: Install Required Packages
run: brew install automake coreutils pkg-config
# Workaround for macOS: https://github.com/actions/runner/issues/2958
- name: Install setuptools
run: sudo -H pip install setuptools
- name: Build Dependencies
run: make -C depends -j$(sysctl -n hw.activecpu)
working-directory: ${{ env.SOURCE_ARTIFACT }}
Expand Down
30 changes: 25 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 14)
define(_CLIENT_VERSION_REVISION, 12)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_BUILD, 6)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2023)
define(_COPYRIGHT_HOLDERS,[The %s developers])
Expand Down Expand Up @@ -92,7 +92,18 @@ AC_PATH_TOOL(OBJCOPY, objcopy)
AC_ARG_VAR(PYTHONPATH, Augments the default search path for python module files)

# Enable wallet
enable_wallet=yes
AC_ARG_ENABLE([wallet],
[AS_HELP_STRING([--disable-wallet],
[disable wallet (enabled by default)])],
[enable_wallet=$enableval],
[enable_wallet=yes])

AC_ARG_WITH([bdb],
[AS_HELP_STRING([--without-bdb],
[disable bdb wallet support (default is enabled if wallet is enabled)])],
[use_bdb=$withval],
[use_bdb=auto])


AC_ARG_ENABLE([elysium],
[AS_HELP_STRING([--enable-elysium],[enable elysium (disabled by default)])],
Expand Down Expand Up @@ -651,9 +662,11 @@ AC_SUBST(LEVELDB_CPPFLAGS)
AC_SUBST(LIBLEVELDB)
AC_SUBST(LIBMEMENV)

if test x$enable_wallet != xno; then
dnl Check for libdb_cxx only if wallet enabled
BITCOIN_FIND_BDB48
if test "$enable_wallet" != "no"; then
dnl Check for libdb_cxx only if wallet enabled
if test "$use_bdb" != "no"; then
BITCOIN_FIND_BDB48
fi
fi

dnl Check for libminiupnpc (optional)
Expand Down Expand Up @@ -1168,6 +1181,7 @@ AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
AM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes])
AM_CONDITIONAL([ENABLE_SSE42],[test x$enable_sse42 = xyes])
AM_CONDITIONAL([USE_BDB], [test "$use_bdb" = "yes"])

AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
Expand Down Expand Up @@ -1222,6 +1236,7 @@ AC_SUBST(ZMQ_LIBS)
AC_SUBST(PROTOBUF_LIBS)
AC_SUBST(QR_LIBS)
AC_SUBST(DSYMUTIL_FLAT)
AC_SUBST(USE_BDB)
AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
AC_CONFIG_FILES([qa/pull-tester/tests_config.py],[chmod +x qa/pull-tester/tests_config.py])
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
Expand Down Expand Up @@ -1291,6 +1306,11 @@ if test x$bitcoin_enable_qt != xno; then
echo " qt version = $bitcoin_qt_got_major_vers"
echo " with qr = $use_qr"
fi

if test "$enable_wallet" != "no"; then
echo " with bdb = $use_bdb"
fi

echo " with zmq = $use_zmq"
echo " with test = $use_tests"
echo " with bench = $use_bench"
Expand Down
3 changes: 3 additions & 0 deletions qa/pull-tester/rpc-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
raise

testScripts = [
'spark_mint.py',
'spark_spend_gettransaction.py',
'spark_setmintstatus_validation.py',
'lelantus_mint.py',
'lelantus_setmintstatus_validation.py',
'lelantus_mintspend.py',
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/bip47-sendreceive.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def setup_network(self, split=False):

def run_test(self):

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

try:
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/lelantus_mint.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def run_test(self):

assert_raises_message(
JSONRPCException,
"Lelantus is not activated yet",
"Lelantus is not active",
self.nodes[0].mintlelantus, 1)

self.nodes[0].generate(activation_block - self.nodes[0].getblockcount())
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/lelantus_mintspend.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self):
def run_test(self):
# Decimal formating: 6 digits for balance will be enought 000.000
getcontext().prec = 6
self.nodes[0].generate(401)
self.nodes[0].generate(201)
self.sync_all()

start_bal = self.nodes[0].getbalance()
Expand Down
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 @@ -39,7 +39,7 @@ def run_test(self):
self.nodes[0].sendtoaddress(self.payment_address, 1)

# mine many blocks, wait for chainlock
while self.nodes[0].getblockcount() < 1000:
while self.nodes[0].getblockcount() < 800:
self.nodes[0].generate(20)
self.wait_for_chainlock_tip_all_nodes()

Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/llmq-is-lelantus.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def run_test(self):
self.mine_quorum()
self.wait_for_chainlocked_block_all_nodes(self.nodes[0].getbestblockhash())

self.nodes[0].generate(1000 - self.nodes[0].getblockcount())
self.nodes[0].generate(401 - self.nodes[0].getblockcount())
for i in range(0, 3):
mintTxids = self.nodes[0].mintlelantus(1)

Expand Down
58 changes: 58 additions & 0 deletions qa/rpc-tests/llmq-is-spark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2018 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

from test_framework.mininode import *
from test_framework.test_framework import EvoZnodeTestFramework
from test_framework.util import sync_blocks, set_node_times, \
isolate_node, reconnect_isolated_node, set_mocktime, get_mocktime
from test_framework.util import assert_equal, assert_raises_jsonrpc, \
bitcoind_processes, start_nodes, start_node, connect_nodes_bi

from decimal import Decimal

'''
llmq-is-spark.py

Testing Instantsend for Spark transactions
'''

class LLMQ_IS_Lelantus(EvoZnodeTestFramework):
def __init__(self):
super().__init__(6, 5, extra_args=[['-debug=instantsend']] * 6 )
self.sporkprivkey = "cW2YM2xaeCaebfpKguBahUAgEzLXgSserWRuD29kSyKHq1TTgwRQ"

def run_test(self):
self.sporkAddress = self.nodes[0].getaccountaddress("")
self.mine_quorum()
self.wait_for_chainlocked_block_all_nodes(self.nodes[0].getbestblockhash())

self.nodes[0].generate(1001 - self.nodes[0].getblockcount())

sparkaddress = self.nodes[0].getnewsparkaddress()[0]
for i in range(0, 3):
mintTxids = self.nodes[0].mintspark({sparkaddress: {"amount": 1, "memo":"Test memo"}})

for mintTxid in mintTxids:
mintTx = self.nodes[0].getrawtransaction(mintTxid, 1)
val = 0
for vi in mintTx['vin']:
val += vi['valueSat']
if val > 10000:
break;
val = Decimal((val - 10000) / 1e+8).quantize(Decimal('1e-7'))

assert(self.wait_for_instantlock(mintTxid, self.nodes[0]))

mintDspend = self.nodes[0].createrawtransaction(mintTx['vin'], {self.nodes[0].getnewaddress(): str(val)})
assert_raises_jsonrpc(-26, 'tx-txlock-conflict', self.nodes[0].sendrawtransaction, mintDspend)

self.nodes[0].generate(3)
assert (self.nodes[0].getrawtransaction(mintTxid, True)['confirmations'] > 0)

spendTxid = self.nodes[0].spendspark({self.sporkAddress: {"amount": 0.1, "subtractFee": False}})
assert(self.wait_for_instantlock(spendTxid, self.nodes[0]))

if __name__ == '__main__':
LLMQ_IS_Lelantus().main()
83 changes: 83 additions & 0 deletions qa/rpc-tests/spark_mint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_raises_message, JSONRPCException

class SparkMintTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 1
self.setup_clean_chain = False

def run_test(self):
assert_raises_message(
JSONRPCException,
"Spark is not activated yet",
self.nodes[0].mintspark, 1)

self.nodes[0].generate(1001)

# generate coins
amounts = [1, 1.1, 2, 10]

# 10 confirmations
address = self.nodes[0].getnewsparkaddress()[0]
self.nodes[0].mintspark({address: {"amount": amounts[0], "memo":"Test memo"}})
self.nodes[0].mintspark({address: {"amount": amounts[1], "memo": "Test memo"}})
self.nodes[0].generate(5)

# 5 confirmations
self.nodes[0].mintspark({address: {"amount": amounts[2], "memo": "Test memo"}})
self.nodes[0].mintspark({address: {"amount": amounts[3], "memo": "Test memo"}})
self.nodes[0].generate(5)

# get all mints and utxos
mints = self.verify_listsparkmints(amounts)
self.verify_listunspentsparkmints(amounts)
assert_equal([False, False, False, False], list(map(lambda m : m["isUsed"], mints)))

# state modification test
# mark two coins as used
self.nodes[0].setsparkmintstatus(mints[2]["lTagHash"], True)
self.nodes[0].setsparkmintstatus(mints[3]["lTagHash"], True)

mints = self.verify_listsparkmints(amounts)
self.verify_listunspentsparkmints([1, 1.1])
assert_equal([False, False, True, True], list(map(lambda m : m["isUsed"], mints)))

# set a coin as unused
self.nodes[0].setsparkmintstatus(mints[3]["lTagHash"], False)
mints = self.verify_listsparkmints(amounts)
self.verify_listunspentsparkmints([1, 1.1, 10])
assert_equal([False, False, True, False], list(map(lambda m : m["isUsed"], mints)))

self.nodes[0].setsparkmintstatus(mints[0]["lTagHash"], False)
self.nodes[0].setsparkmintstatus(mints[1]["lTagHash"], False)
self.nodes[0].setsparkmintstatus(mints[2]["lTagHash"], False)
self.nodes[0].setsparkmintstatus(mints[3]["lTagHash"], False)

mints = self.verify_listsparkmints(amounts)
self.verify_listunspentsparkmints(amounts)
assert_equal([False, False, False, False], list(map(lambda m : m["isUsed"], mints)))

def verify_listsparkmints(self, expected_amounts):
mints = self.nodes[0].listsparkmints()
mints = sorted(mints, key = lambda u: u['amount'])

assert_equal(
sorted(expected_amounts),
list(map(lambda u: float(u['amount']), mints)))

return mints

def verify_listunspentsparkmints(self, expected_amounts):
mints = self.nodes[0].listunspentsparkmints()
mints = sorted(mints, key = lambda u: float(u['amount']))

assert_equal(
sorted(expected_amounts),
list(map(lambda u: float(u['amount']), mints)))

return mints

if __name__ == '__main__':
SparkMintTest().main()
Loading
Loading