Thomas Kerin
1cdbea7f74
bitcoinconsensus: invalid flags should be set to bitcoinconsensus_error type, add test cases covering bitcoinconsensus error codes
...
Github-Pull: #13655
Rebased-From: 417b6c1d2990ffc78c029442e027797d724a101f
6 years ago
Johnson Lau
d353dd121b
Add constant scriptCode policy in non-segwit scripts
...
This disables OP_CODESEPARATOR in non-segwit scripts (even in an unexecuted branch), and makes a positive FindAndDelete result invalid. This ensures that the scriptCode serialized in SignatureHash() is always the same as the script passing to the EvalScript.
Github-Pull: #11423
Rebased-From: 9dabfe49c066301ef75bcfcb089fd308366127c4
7 years ago
Akira Takizawa
595a7bab23
Increment MIT Licence copyright header year on files modified in 2017
7 years ago
Wladimir J. van der Laan
138016bf92
test: refactor: Use absolute include paths for test data files
7 years ago
MeshCollider
1a445343f6
scripted-diff: Replace #include "" with #include <> (ryanofsky)
...
-BEGIN VERIFY SCRIPT-
for f in \
src/*.cpp \
src/*.h \
src/bench/*.cpp \
src/bench/*.h \
src/compat/*.cpp \
src/compat/*.h \
src/consensus/*.cpp \
src/consensus/*.h \
src/crypto/*.cpp \
src/crypto/*.h \
src/crypto/ctaes/*.h \
src/policy/*.cpp \
src/policy/*.h \
src/primitives/*.cpp \
src/primitives/*.h \
src/qt/*.cpp \
src/qt/*.h \
src/qt/test/*.cpp \
src/qt/test/*.h \
src/rpc/*.cpp \
src/rpc/*.h \
src/script/*.cpp \
src/script/*.h \
src/support/*.cpp \
src/support/*.h \
src/support/allocators/*.h \
src/test/*.cpp \
src/test/*.h \
src/wallet/*.cpp \
src/wallet/*.h \
src/wallet/test/*.cpp \
src/wallet/test/*.h \
src/zmq/*.cpp \
src/zmq/*.h
do
base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f
done
-END VERIFY SCRIPT-
7 years ago
Anthony Towns
d601f16621
Fix invalid memory access in CScript::operator+=
7 years ago
practicalswift
90d4d89230
scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL
...
-BEGIN VERIFY SCRIPT-
sed -i 's/\<NULL\>/nullptr/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h src/qt/*/*.cpp src/qt/*/*.h src/wallet/*/*.cpp src/wallet/*/*.h src/support/allocators/*.h
sed -i 's/Prefer nullptr, otherwise SAFECOOKIE./Prefer NULL, otherwise SAFECOOKIE./g' src/torcontrol.cpp
sed -i 's/tor: Using nullptr authentication/tor: Using NULL authentication/g' src/torcontrol.cpp
sed -i 's/METHODS=nullptr/METHODS=NULL/g' src/test/torcontrol_tests.cpp src/torcontrol.cpp
sed -i 's/nullptr certificates/NULL certificates/g' src/qt/paymentserver.cpp
sed -i 's/"nullptr"/"NULL"/g' src/torcontrol.cpp src/test/torcontrol_tests.cpp
-END VERIFY SCRIPT-
7 years ago
practicalswift
6e8c48dc59
Add const to methods that do not modify the object for which it is called
7 years ago
Pieter Wuille
2dd6f80680
Add a test that all flags are softforks
8 years ago
Jorge Timón
5995735c5b
scripted-diff: Remove #include <boost/foreach.hpp>
...
-BEGIN VERIFY SCRIPT-
sed -i ':a;N;$!ba;s/#include <boost\/foreach.hpp>\n//' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp
-END VERIFY SCRIPT-
8 years ago
Andrew Chow
5b75c47784
Add a valid opcode sanity check to CScript
...
Added a function in CScript that checks if the script contains valid opcodes.
Add a test for that function
8 years ago
Jorge Timón
7c00c26726
scripted-diff: Fully remove BOOST_FOREACH
...
-BEGIN VERIFY SCRIPT-
sed -i 's/BOOST_FOREACH *(\(.*\),/for (\1 :/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ;
-END VERIFY SCRIPT-
8 years ago
practicalswift
5a9b508279
[trivial] Add end of namespace comments
8 years ago
Pavel Janík
bb2aaeeeea
Prevent -Wshadow warnings with gcc versions 4.8.5, 5.3.1 and 6.2.1.
8 years ago
practicalswift
8dc957ae06
Remove unused code
8 years ago
Lauda
5c66d41b7f
[Trivial] Grammar and typo correction
...
Minor corrections in src\test\* .
8 years ago
Karl-Johan Alm
73f41190b9
Refactoring: Removed using namespace <xxx> from bench/ and test/ source files.
8 years ago
isle2983
27765b6403
Increment MIT Licence copyright header year on files modified in 2016
...
Edited via:
$ contrib/devtools/copyright_header.py update .
8 years ago
Karl-Johan Alm
8c1dbc5e9d
Refactor: Removed begin/end_ptr functions.
8 years ago
Pieter Wuille
f6fb7acda4
Move CTxInWitness inside CTxIn
8 years ago
Pieter Wuille
81e3228fcb
Make CTransaction actually immutable
8 years ago
Wladimir J. van der Laan
5ca8ef299a
libconsensus: Add input validation of flags
...
Makes it an error to use flags that have not been defined
on the libconsensus API.
There has been some confusion as to what pass to libconsensus, and
(combined with mention in the release notes) this should clear it up.
Using undocumented flags is a risk because their meaning,
and what combinations are allowed, changes from release to release.
E.g. it is no longer possible to pass (CLEANSTACK | P2SH) without
running into an assertion after the segwit changes.
8 years ago
Johnson Lau
9260085377
test segwit uncompressed key fixes
8 years ago
Johnson Lau
4c0c25a604
Require compressed keys in segwit as policy and disable signing with uncompressed keys for segwit scripts
8 years ago
Johnson Lau
e41bd449ab
Add policy: null signature for failed CHECK(MULTI)SIG
8 years ago
Pavel Janík
4731cab8fb
Do not shadow variables
8 years ago
Johnson Lau
c72c5b1e3b
Make non-minimal OP_IF/NOTIF argument non-standard for P2WSH
8 years ago
Suhas Daftuar
d846e02372
[qa] script_tests: witness tests can specify tx amount
...
Add tests that witness signatures cover value
9 years ago
Suhas Daftuar
330b0f31ee
[qa] p2p segwit tests
...
mininode now supports witness transactions/blocks, blocktools
has a helper for adding witness commitments to blocks, and script
has a function to calculate hashes for signature under sigversion
1, used by segwit.
Py3 conversion by Marco Falke
Test to make sure upgraded nodes don't ask for non-wit blocks by
Gregory Sanders.
9 years ago
Pieter Wuille
66cca79130
[qa] Autogeneration support for witness in script_tests
9 years ago
Pieter Wuille
06d3805c1a
[qa] Add segwit support to script_tests
...
Contains fix by Johnson Lau.
9 years ago
Pieter Wuille
605e8473a7
BIP143: Signing logic
9 years ago
Thomas Kerin
b7dbeb24eb
[libconsensus] Script verification API with amounts
...
script_tests: always test bitcoinconsensus_verify_script_with_amount if VERIFY_WITNESS isn't set
Rename internal method + make it static
trim bitcoinconsensus_ prefix
Add SERIALIZE_TRANSACTION_WITNESS flag
9 years ago
Pieter Wuille
3dd410294d
BIP143: Verification logic
...
Includes simplifications by Eric Lombrozo.
9 years ago
Pieter Wuille
0ef1dd3e11
Refactor script validation to observe amounts
...
This is a preparation for BIP143 support.
9 years ago
Pieter Wuille
449f9b8deb
BIP141: Witness program
9 years ago
Chris Stewart
b682960a28
Adding P2SH(p2pkh) script test case
...
Fixing formatting
Adding test case into automatically generated test case set
Clean up commits
removing extra whitespace from eol
Removing extra whitespace on macro line
9 years ago
Gavin Andresen
e2a30bc9a9
Unit test for CScript::FindAndDelete
9 years ago
Pieter Wuille
dde46d3ae1
Merge script_valid and script_invalid tests
9 years ago
Pieter Wuille
009b503792
Get rid of expect in script_tests as it's implied by scripterror
9 years ago
Pieter Wuille
76da761351
Make script_error a mandatory 4th field for script_tests
9 years ago
Pieter Wuille
269281b7cc
Fix some misconstructed tests
...
They claimed to be testing P2SH scripts with non-push scriptSigs, but
1) they were not enabling P2SH
2) they have push-only scriptSigs
Fix this, and add a few more related cases.
9 years ago
Pieter Wuille
c7c664191f
Fix JSON pretty printing in script_tests
9 years ago
Wladimir J. van der Laan
0ecb3401fe
test: Script_error checking in script_invalid tests
...
Check the returned script_error. Add expected script_error
for generated as well as custom tests.
The specific error is not part of consensus, however
it could avoid unclear reporting issues such as #6862 in the future.
Fixes #7513 .
9 years ago
Wladimir J. van der Laan
2317ad7c56
test: Re-introduce JSON pretty printing in test builder
9 years ago
Alex Morcos
c6c2f0fd78
Implement SequenceLocks functions
...
SequenceLocks functions are used to evaluate sequence lock times or heights per BIP 68.
The majority of this code is copied from maaku in #6312
Further credit: btcdrak, sipa, NicolasDorier
9 years ago
mb300sd
37d271d7cc
Rename OP_NOP2 to OP_CHECKLOCKTIMEVERIFY.
9 years ago
MarcoFalke
fa24439ff3
Bump copyright headers to 2015
9 years ago
Pieter Wuille
114b5812f6
Prevector type
9 years ago
Jonas Schnelli
9623e93473
[Univalue] add univalue over subtree
...
similar to secp256k1 include and compile univalue over a subtree
9 years ago