Commit graph

63 commits

Author SHA1 Message Date
Patrick Lodder d2b1a61753
Give QApplication dummy arguments
Discards any Qt built-in command line arguments and replaces them
with dummy argv that only contains the binary name. Solves CVE-2021-3401.

Manually ported from bitcoin/bitcoin@a2714a5c
2021-11-03 12:05:46 -04:00
Patrick Lodder 4b7e35c0ba
Fix the hash of the best block to reflect the Dogecoin block
This was prev tested to be a Bitcoin block in qt rpc tests
2020-07-22 13:45:28 +02:00
Patrick Lodder 7f5d1446d5
qt-tests: Disable payment server test that moves 21M+1 coins.
This is not a testcase for Dogecoin. Like the other payment
server tests, this could be amended, or it can be depreciated,
depending on where we take payment protocol.
2020-07-22 13:45:05 +02:00
Ross Nicoll 3a62bcc51f Update URI tests for Dogecoin (#1457)
Note that the test address was invalid in Bitcoin Core, and as such rather than
re-encoding as a Dogecoin address, I've simply swapped the first byte. Still
invalid, but looks correct at least.
2019-03-25 05:36:12 +00:00
Ross Nicoll 5618d8497a Update payment protocol to match Dogecoin (#1433)
* Revised payment request handling to use genesis block hash instead of network name, enabling
support for more networks that just Bitcoin main and test net.
* Disable payment protocol certificate unit tests; we don't modify this code, and regenerating the test data is likely to be significantly time consuming. Will re-enable once discussion on spec is concluded.
2018-09-19 22:11:47 +01:00
Wladimir J. van der Laan b8d1b81077
trivial: squash missing field 'argNames' initializer warning in qt tests
The additional initializer is for the named arguments, which are unused
in the test (and unfilled global fields will be initialized to 0
anyhow), so this is a no-op apart from the warning.
2017-01-20 14:39:50 +01:00
Wladimir J. van der Laan c0ddd32bf6
Merge #9450: Increment MIT licence copyright header year on files modified in 2016
27765b6 Increment MIT Licence copyright header year on files modified in 2016 (isle2983)
2017-01-04 12:09:05 +01:00
isle2983 27765b6403 Increment MIT Licence copyright header year on files modified in 2016
Edited via:

$ contrib/devtools/copyright_header.py update .
2016-12-31 11:01:21 -07:00
Luke Dashjr a79598ddf4 Qt/Test: Make sure filtering sensitive data works correctly in nested commands 2016-12-29 11:46:26 +00:00
Matt Corallo c2f61bebb1 Add a ForceSetArg method for testing 2016-12-27 13:52:07 +01:00
Matt Corallo 4cd373aea8 Un-expose mapArgs from utils.h 2016-12-24 11:29:33 -05:00
Wladimir J. van der Laan db45ad8516
Merge #9329: [Qt] Console: allow empty arguments
390bd14 [Qt] Console: don't allow empty arguments when using the comma-syntax (Jonas Schnelli)
6a32c0f Qt/Test: Check handling of empty arguments in RPC debug console (Luke Dashjr)
89c8d2c [Qt] Console: allow empty arguments (Jonas Schnelli)
2016-12-19 09:08:20 +01:00
Karl-Johan Alm 815f4148b2 Uses built-in byte swap if available (Apple) and if bswap_XX is undefined.
Defers to pre-defined version if found (e.g. protobuf). For protobuf case, the definitions are identical and thus include order should not affect results.
2016-12-17 12:27:00 +09:00
Jonas Schnelli 390bd14684
[Qt] Console: don't allow empty arguments when using the comma-syntax 2016-12-14 09:00:09 +01:00
Luke Dashjr 6a32c0f69d
Qt/Test: Check handling of empty arguments in RPC debug console 2016-12-13 09:18:13 +01:00
Matt Corallo 76faa3cdfe Rename the remaining main.{h,cpp} to validation.{h,cpp} 2016-12-02 09:42:51 -08:00
Jonas Schnelli 15860448d3
[Qt] RPC-Console: support nested commands and simple value queries
Commands can be executed with bracket syntax, example: `getwalletinfo()`.
Commands can be nested, example: `sendtoaddress(getnewaddress(), 10)`.
Simple queries are possible: `listunspent()[0][txid]`
Object values are accessed with a non-quoted string, example: [txid].

Fully backward compatible.
`generate 101` is identical to `generate(101)`
Result value queries indicated with `[]` require the new brackets syntax.
Comma as argument separator is now also possible: `sendtoaddress,<address>,<amount>`
Space as argument separator works also with the bracket syntax, example: `sendtoaddress(getnewaddress() 10)

No dept limitation, complex commands are possible:
`decoderawtransaction(getrawtransaction(getblock(getbestblockhash())[tx][0]))[vout][0][value]`
2016-08-23 15:32:39 +02:00
MarcoFalke fa24439ff3 Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
Jeff Garzik 6f55cddf6b
Merge pull request #5665 2015-09-15 12:30:32 -04:00
Cory Fields 6e996d39da tests: fix qt payment test
Now that boost no longer automatically initializes openssl, we have to
do it ourselves.
2015-09-02 18:38:41 +02:00
Philip Kaufmann be942def4b [Qt] add verifySize() function to PaymentServer
- add static verifySize() function to PaymentServer and move the logging
  on error into the function
- also use the new function in the unit test
- the function checks if the size is allowed as per BIP70
2015-08-10 14:12:15 +02:00
Wladimir J. van der Laan d29ec6c230 qt: define QT_NO_KEYWORDS
QT_NO_KEYWORDS prevents Qt from defining the `foreach`, `signals`,
`slots` and `emit` macros.

Avoid overlap between Qt macros and boost - for example #undef hackiness
in #6421.
2015-07-15 07:30:23 +02:00
dexX7 3a3ecc02e5
Initialization: setup environment before starting QT tests
The environment is prepared by the main thread to guard against invalid locale settings.
2015-03-29 10:35:35 +02:00
Philip Kaufmann a6516686dc [Qt] prevent amount overflow problem with payment requests
Bitcoin amounts are stored as uint64 in the protobuf messages (see
paymentrequest.proto), but CAmount is defined as int64_t. Because
of that we need to verify that single and accumulated amounts are
in a valid range and no variable overflow has happened.

- fixes #5624 (#5622)

Thanks @SergioDemianLerner for reporting that issue and also supplying us
with a possible solution.

- add static verifyAmount() function to PaymentServer and move the logging
  on error into the function
- also add a unit test to paymentservertests.cpp
2015-02-04 13:47:32 +01:00
Philip Kaufmann 6715efb9ca [Qt] Payment request expiration bug fix (re-done)
- this is based on #4122 (which can be closed)

Currently a payment request is only checked for expiration upon receipt.
It should be checked again immediately before sending coins to prevent
the user from paying to an expired invoice which would then require a
customer service interaction.

- add static verifyExpired() function to PaymentServer to be able to use
  the same validation code in GUI and unit-testing code
- extend unit tests to use that function and also add an unit test which
  overflows, because payment requests allow expires as uint64, whereas we
  use int64_t for verification of expired payment requests
2015-01-15 09:08:22 +01:00
Philip Kaufmann 17005bc0fc [Qt] add payment request unit test for non matching networks
- verify that payment request network matches client network
- add static verifyNetwork() function to PaymentServer to be able to use
  the same validation code in GUI and unit-testing code
2015-01-14 13:15:26 +01:00
Philip Kaufmann 080da96c7c [Qt] prepare paymentservertests for new unit tests
- add a second PaymentRequest Test CA certificate to paymentrequestdata.h
  (serial number f0:da:97:e4:38:d7:64:16) as caCert2_BASE64
- rename existing Test CA certificate to caCert1_BASE64
- rename existing payment request data to know they belong to
  caCert1_BASE64
- update comments to reflect the changes and add a missing comment to one
  of the payment requests
2015-01-13 15:46:27 +01:00
sandakersmann f914f1a746
Added "Core" to copyright headers
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Philip Kaufmann 4333e26c8e [Qt] add BIP70 DoS protection test
- this test required to make readPaymentRequestFromFile() public in order
  to be able to is it in paymentservertests.cpp
2014-12-08 16:09:01 +01:00
Pavel Janík 84738627ce Fix all header defines 2014-11-03 16:16:40 +01:00
Cory Fields 85c579e3a6 script: add a slew of includes all around and drop includes from script.h
Lots of files ended up with indirect includes from script.h.
2014-10-17 13:44:57 -04:00
Philip Kaufmann 1ffb99b07f [Qt] copyright, style and indentation cleanup of Qt tests 2014-09-05 13:23:21 +02:00
Wladimir J. van der Laan 84ce18ca93 Remove unnecessary dependencies for bitcoin-cli
This commit removes all the unnecessary dependencies (key, core,
netbase, sync, ...) from bitcoin-cli.

To do this it shards the chain parameters into BaseParams, which
contains just the RPC port and data directory (as used by utils and
bitcoin-cli) and Params, with the rest.
2014-06-25 10:31:35 +02:00
Cory Fields f3967bcc50 build: fix build weirdness after 54372482.
bitcoin-config.h moved, but the old file is likely to still exist when
reconfiguring or switching branches. This would've caused files to not rebuild
correctly, and other strange problems.

Make the path explicit so that the old one cannot be found.

Core libs use config/bitcoin-config.h.

Libs (like crypto) which don't want access to bitcoin's headers continue
to use -Iconfig and #include bitcoin-config.h.
2014-06-23 14:04:38 -04:00
Cory Fields 8b09ef7b63 build: add stub makefiles for easier subdir builds 2014-06-05 16:05:43 -04:00
Cory Fields be4e9aeb14 build: delete old Makefile.am's 2014-06-05 16:05:42 -04:00
LongShao007 d90491a766 Update test_main.cpp
i think should delete (#include "bitcoin-config.h")。
2014-05-22 21:41:59 +08:00
Cory Fields 6986861fda build: use -mwindows for gui targets when linking with mingw 2014-01-27 15:30:51 -05:00
Philip Kaufmann d464edfb8c [Qt] fix alphabetical ordering in Makefile.am
- also change to 1 file per line for more stuff in Makefile.am
2014-01-12 03:00:53 +01:00
Wladimir J. van der Laan 5a407bd095
makefile.am: split long lines into one file per line
This makes it easier to read diffs.
Cosmetic change to build system only.
2014-01-11 15:23:15 +01:00
Wladimir J. van der Laan b7f4b6d35d GUI for --disable-wallet compiles and -disablewallet mode
There is not much in the GUI to be done without wallet,
though it's possible to change options, watch the sync process,
and use the debug console.

So embed the debug console in the main window.
2014-01-11 12:36:20 +01:00
Cory Fields 8b0f608815 qt5: tests: Make sure static plugin symbols are pulled in
Since we're now properly linking against static plugins for qt binaries,
we need to ensure that they're Imported properly.

Without these Imports, the linker drops some of the unused linked libs, causing
undefined symbols in QtCore.
2014-01-10 16:30:33 -05:00
Cory Fields 328bdb1cd6 qt5: Ensure correct link order
If optional libs don't appear in QT_LIBS, they need to be listed first for
proper static linking.
2014-01-10 16:30:33 -05:00
Wladimir J. van der Laan 05e27c6641
Merge pull request #3332
5094f8d Split off rpc_wallet_tests (Wladimir J. van der Laan)
829c920 Move CCryptoKeyStore to crypter.cpp (Wladimir J. van der Laan)
ae6ea5a Update build-unix.md to mention --disable-wallet (Wladimir J. van der Laan)
4f9e993 Add --disable-wallet option to build system (Wladimir J. van der Laan)
d004d72 Move CAddrDB frrom db to net (Wladimir J. van der Laan)
48ba56c Delimit code with #ifdef ENABLE_WALLET (Wladimir J. van der Laan)
991685d Move getinfo to rpcnet.cpp (Wladimir J. van der Laan)
bbb0936 Move HelpExample* from rpcwallet to rpcserver (Wladimir J. van der Laan)
2013-12-08 13:52:48 +01:00
Philip Kaufmann 4cf3411056 [Qt] misc PaymentServer changes (e.g. changes to eventFilter())
- make eventFilter() private and pass events on to QObject::eventFilter()
  instead of just returning false
- re-work paymentservertest.cpp to correctly handle the event test
  after the above change (rewrite test_main to allow usage of
  QCoreApplication:: in the tests)
- delete socket when we were unable to connect in ipcSendCommandLine()
- show a message to the user if we fail to start-up (instead of just a
  debug.log entry)
- misc small comment changes
2013-12-06 11:06:57 +01:00
Wladimir J. van der Laan 4f9e993bc9 Add --disable-wallet option to build system
Make it possible to build Bitcoin without wallet
(and thus without BDB) so that it only functions as node.
2013-12-04 12:46:13 +01:00
Wladimir J. van der Laan 0b47fe6bdc bitcoin-cli: remove unneeded dependencies (only code movement)
Remove unnecessary dependencies for bitcoin-cli
(leveldb, berkelydb, wallet, RPC server)

Build system changes:
- split libbitcoin.a into libbitcoin_common.a, libbitcoin_server.a and
  libbitcoin_cli.a

Code changes (movement only):
- split up HelpMessage into HelpMessage in init.cpp and HelpMessageCli
  in rpcclient.cpp
- move uiInterface from init.cpp to util.cpp
2013-12-03 09:07:13 +01:00
Wladimir J. van der Laan a6aa179699 Merge pull request #3187 from Diapolo/netManager
[Qt] paymentserver: start netManager in uiReady()
2013-11-11 07:00:34 -08:00
Philip Kaufmann 7634e0d8de [Qt] paymentserver: start netManager in uiReady()
- remove explicit init of netManager as this is done in the constructor
  anyway
- move initNetManager() call to uiReady(), which removes an assert() and
  allows us to use message() in initNetManager() (currently unused but
  could be necessary because of proxy related messages)
- make initNetManager() private
- update paymentservertests.cpp
2013-11-11 14:20:00 +01:00
Luke Dashjr eb12a14da7 configure: Simplify common AM_CPPFLAGS and AM_LDFLAGS to a Makefile.common 2013-11-11 09:57:28 +01:00