Commit graph

824 commits

Author SHA1 Message Date
Patrick Lodder 1374bb47c2
Merge pull request #2450 from xanimo/1.14.4-txn_doublespend
qa: txn_dblspend - fix arithmetic
2021-08-14 21:19:15 +02:00
Dakoda Greaves 1c32538089 fix arithmetic; adds to standard testing 2021-08-13 19:12:16 -07:00
Patrick Lodder 6aff1141f4
qa: fix p2p-acceptblock
This test failed because the sheer number of blocks required to
trigger the max length of a fork we'd keep, exceed the v4 fork
height on regtest.

- Adapted the blocktools.py miner to mine 0x00620004 blocks as done
  elsewhere too (be it suboptimal, but at least consistent)
- Adapted the test to work with 1440 blocks (Dogecoin limit)
  instead of 288 (Bitcoin limit)
- Made p2p-acceptblock a standard test instead of an extended test
2021-08-13 03:44:02 +02:00
Michi Lumin f8813f8e13 fees: Reduce minimum relay fee to 0.001 DOGE, final change from tx to 0.01 2021-08-11 14:16:01 -06:00
Patrick Lodder 4c46af0483
[fees] introduce configurable hard dust limit
Co-authored-by: Ross Nicoll <rnicoll@rnicoll.name>
2021-08-05 18:24:17 +02:00
Michi Lumin 1d2380df56 p2p: Reduce BIP125 replace by fee increment value 2021-08-04 09:29:35 +01:00
xanimo 290faedcc3
tests: mempool_packages.py (#2433)
* Bump fee to 1.0000 from 0.0001 to fix insufficient priority error
2021-08-01 09:36:55 +01:00
Michi Lumin 575f734eec Initial back end framework to separate wallet and relay fees + dust. 2021-07-30 16:07:22 -06:00
Dakoda Greaves 7e541072ce update qa/README.md to reflect working installation instructions 2021-07-28 16:12:52 -07:00
Ross Nicoll 9362186ba7
tests: Fix replace-by-fee values for Dogecoin 2021-07-25 19:48:53 +01:00
rht 33b9f6cb5e
qa: Fix typos 2021-05-18 05:52:06 -04:00
Ross Nicoll 0fa6b5c912 Revert ltc_scrypt -> litecoin_scrypt 2021-02-08 09:05:07 +00:00
Ross Nicoll f9b9a591b8 Halve timeouts 2021-02-07 22:57:46 +00:00
Ross Nicoll a4638bb50f Adapt block download timeouts to Dogecoin
Block download timeouts are expressed as a fraction of block interval time, so Dogecoin values have been too aggressive.
Matching Bitcoin values as a starting point.
2021-02-05 23:36:38 +00:00
Daniel Edgecumbe 59dcceea58
[backport] [rpc] getblockchaininfo: add size_on_disk, prune_target_size, automatic_pruning
Fix pruneheight help text.
Move fPruneMode block to match output ordering with help text.
Add functional tests for new fields in getblockchaininfo.

Rebase-from: bitcoin#b7dfc6c4
2020-07-24 18:45:39 +02:00
Patrick Lodder 89c01f3866
rpc-tests: don't use binary.hex() or binary.fromhex()
To retain compatibility with multiple python3 versions
2020-07-22 13:51:27 +02:00
Patrick Lodder 31e6a818ec
rpc-tests: fix fundrawtransaction coin amounts to not spend dust 2020-07-22 13:51:16 +02:00
Patrick Lodder 9dced9cb98
rpc-tests: write credentials to dogecoin.conf, not bitcoin.conf 2020-07-22 13:51:08 +02:00
Patrick Lodder e3d075f710
rpc-tests: fix listtransactions to not spend dust 2020-07-22 13:51:00 +02:00
Patrick Lodder 01a71ec71d
rpc-tests: fix mempool_limit test
do more rounds of large tx creation to be sure to evict the
targeted tx
2020-07-22 13:49:54 +02:00
Patrick Lodder 022bcfb064
rpc-tests: fix importprunedfunds for use with dogecoin
- use non-dust outputs
- reverse the order of transactions to lowest-first, to not re-spend
  expected outputs for later tests.
2020-07-22 13:49:36 +02:00
Patrick Lodder d0afe42ed2
rpc-tests: fix auxpow calls to use .target instead of ._target
Tests weren't adapted to reflect RPC output
2020-07-22 13:49:05 +02:00
Patrick Lodder e896e90e6e
rpc-tests: revert from litecoin_scrypt to ltc_scrypt
This reflects the dependency installed in the dep script at
qa/pull-tester/install-deps.sh
2020-07-22 13:47:33 +02:00
Patrick Lodder 294d408d70
pull-tester: don't hard depend on python 3.6
every script depends on "python3" not "python3.6"
2020-07-22 13:46:52 +02:00
Patrick Lodder cb49441a25
Fix ltc_scrypt dependency for RPC tests
- travis: RUN_TESTS requires python3-dev. This enables us to
  compile the ltc_scrypt library under python3
- pull tester deps: use curl instead of wget to reduce dependencies
  as everything else uses curl
2020-07-22 13:46:43 +02:00
langerhans 5d58c691ca Merge branch 'rnicoll-rnicoll/1.14-litecoin-scrypt' into 1.14-maint 2019-07-14 19:21:56 +02:00
Ross Nicoll dbfb33abe0 Revert behaviour change in getauxblock
Change getauxblock to respond with a "target" field instead of "_target".
2019-07-13 19:23:36 +00:00
Ross Nicoll 776c2b3d2c Update to litecoin_scrypt
The old ltc_scrypt module works on systems it is installed on, but does not
install on new systems it appears. Our README says to use litecoin_scrypt,
so updating the code to match.
2019-07-12 01:26:11 +00:00
Ross Nicoll 4dd8838b3a Rename binaries to match Dogecoin 2019-03-25 05:36:11 +00:00
Ross Nicoll e4f734dd40 Update tx output in p2p-fullblocktest.py (#1474)
* Update tx output in `p2p-fullblocktest.py` to match Dogecoin coin reward.
* Disable the re-org test as it disconnects the mini-node before the re-org completes.
2018-09-19 22:11:47 +01:00
Ross Nicoll 9c3a11b248 Clean up RPC tests (#1465)
* Enable full block tests
* Fix invalidblocktest
* Move watch only address funding to immediately before it's used, so node 0 doesn't spend the output before it checks it later.
* Fix `fundrawtransaction` tests and sanitize fee calculation at the same time
* Correct resolution of chain parameters when validating tx inputs, especially from previous coinbase transactions
* Set block versions on full block tests so that the generated blocks are AuxPoW compatible
2018-09-19 22:11:47 +01:00
Ross Nicoll b6b5ee7502 Update RPC tests for Dogecoin (#1431)
* Make most of the RPC tests pass
* Add AUXPoW rpc tests
- Tests the auxpow rpc interface `getauxblock`
- Tests consensus constraints for auxpow:
  - Minimum block height
  - Valid scrypt proof of work
  - Foreign chain ID
2018-09-19 22:11:47 +01:00
Ross Nicoll bc8cca4896 Merge AuxPoW support from Namecore
Changes are as below:

Wrap CBlockHeader::nVersion into a new class (CBlockVersion).  This allows to take care of interpreting the field into a base version, auxpow flag and the chain ID.

Update getauxblock.py for new 'generate' RPC call.

Add 'auxpow' to block JSON.

Accept auxpow as PoW verification.

Add unit tests for auxpow verification.

Add check for memory-layout of CBlockVersion.

Weaken auxpow chain ID checks for the testnet.

Allow Params() to overrule when to check the auxpow chain ID and for legacy blocks.  Use this to disable the checks on testnet.

Introduce CPureBlockHeader.

Split the block header part that is used by auxpow and the "real" block header (that uses auxpow) to resolve the cyclic dependency between the two.

Differentiate between uint256 and arith_uint256.

This change was done upstream, modify the auxpow code.

Add missing lock in auxpow_tests.

Fix REST header check for auxpow headers.

Those can be longer, thus take that into account.  Also perform the check actually on an auxpow header.

Correctly set the coinbase for getauxblock results.

Call IncrementExtraNonce in getauxblock so that the coinbase is actually initialised with the stuff it should be.  (BIP30 block height and COINBASE_FLAGS.)

Implement getauxblock plus regression test.

Turn auxpow test into FIXTURE test.

This allows using of the Params() calls.

Move CMerkleTx code to auxpow.cpp.

Otherwise we get linker errors when building without wallet.

Fix rebase with BIP66.

Update the code to handle BIP66's nVersion=3.

Enforce that auxpow parent blocks have no auxpow block version.

This is for compatibility with namecoind.  See also https://github.com/namecoin/namecoin/pull/199.

Move auxpow-related parameters to Consensus::Params.
2018-09-19 19:22:45 +01:00
Luke Dashjr e05799a381 Merge #10234, #10143 (fixes only), and #9853 via branch 'disconnect_ban_fixes-0.14' into 0.14.2_fixes 2017-06-05 22:57:27 +00:00
John Newbery ee1a60d156 [tests] update disconnect_ban.py test case to work with listbanned
Github-Pull: #10234
Rebased-From: d6732d832a
2017-06-05 22:56:22 +00:00
John Newbery 04226938a3 [tests] disconnect_ban: remove dependency on urllib
Github-Pull: #10143
Rebased-From: 5cc3ee24d2
2017-06-05 22:56:04 +00:00
John Newbery 98bd0c338b [tests] disconnect_ban: use wait_until instead of sleep
Github-Pull: #10143
Rebased-From: 12de2f252c
2017-06-05 22:55:10 +00:00
Luke Dashjr 99e5dbd0aa Merge #9853 via branch 'fixerrorcodes-0.14' into 0.14.2_fixes 2017-06-05 19:33:18 +00:00
Luke Dashjr 74653a41fe Merge #10196 via branch 'prioritisetx_gbtcache-0.14' into 0.14.2_fixes 2017-06-05 19:33:01 +00:00
John Newbery bfd1cf6713 [tests] disconnectban test - only use two nodes
Github-Pull: #10143
Rebased-From: 395561becf
2017-06-05 19:26:13 +00:00
John Newbery 5bc75bb8ee [tests] fix nodehandling.py flake8 warnings
Github-Pull: #10143
Rebased-From: d6564a26f4
2017-06-05 19:26:13 +00:00
John Newbery f5efe82a83 Return correct error codes in fundrawtransaction().
The fundrawtransaction() RPC was returning misleading or incorrect error
codes (for example RPC_INTERNAL_ERROR when funding the transaction
failed). This commit fixes those error codes:

- RPC_INTERNAL_ERROR should not be returned for application-level
errors, only for genuine internal errors such as corrupted data.

That error code has been replaced with RPC_WALLET_ERROR.

This commit also updates the test cases to explicitly test the error code.

Github-Pull: #9853
Rebased-From: dab804c18a
2017-06-05 19:01:16 +00:00
John Newbery 4943d7a9fe Return correct error codes in setban().
The setban() RPC was returning misleading or incorrect error
codes (for example RPC_CLIENT_NODE_ALREADY_ADDED when an invalid IP
address was entered). This commit fixes those error codes:

- RPC_CLIENT_INVALID_IP_OR_SUBNET should be returned if the client
  enters an invalid IP address or subnet.

This commit also updates the test cases to explicitly test the error code.

This commit also adds a testcase for trying to setban on an invalid subnet.

Github-Pull: #9853
Rebased-From: a012087667
2017-06-05 19:01:16 +00:00
John Newbery 18c109ddb1 Return correct error codes in removeprunedfunds().
The removeprunedfunds() RPC was returning misleading or incorrect error
codes (for example RPC_INTERNAL_ERROR when the transaction was
not found in the wallet). This commit fixes those error codes:

- RPC_INTERNAL_ERROR should not be returned for application-level
errors, only for genuine internal errors such as corrupted data.

This error code has been replaced with RPC_WALLET_ERROR.

This commit also updates the test cases to explicitly test the error code.

Github-Pull: #9853
Rebased-From: 960bc7f778
2017-06-05 19:01:16 +00:00
John Newbery fe51c8924e Return correct error codes in blockchain.cpp.
RPCs in blockchain.cpp were returning misleading or incorrect error
codes (for example getblock() returning RPC_INTERNAL_ERROR when the
block had been pruned). This commit fixes those error codes:

- RPC_INTERNAL_ERROR should not be returned for application-level
  errors, only for genuine internal errors such as corrupted data.
- RPC_METHOD_NOT_FOUND should not be returned in response to a
  JSON request for an existing method.

Those error codes have been replaced with RPC_MISC_ERROR or
RPC_INVALID_PARAMETER as appropriate.

Github-Pull: #9853
Rebased-From: c1190963b3
2017-06-05 19:01:16 +00:00
John Newbery 3ad00b4b32 Return correct error codes in bumpfee().
The bumpfee() RPC was returning misleading or incorrect error codes
(for example RPC_INVALID_ADDRESS_OR_KEY when the transaction was not
BIP125 replacable). This commit fixes those error codes:

- RPC_INVALID_ADDRESS_OR_KEY if an invalid address was provided:
    - Invalid change address given
- RPC_INVALID_PARAMETER if a single (non-address/key) parameter is incorrect
    - confTarget and totalFee options should not both be set.
    - Invalid confTarget
    - Insufficient totalFee (cannot be less than required fee)
- RPC_WALLET_ERROR for any other error
    - Transaction has descendants in the wallet
    - Transaction has descendants in the mempool
    - Transaction has been mined, or is conflicted with a mined transaction
    - Transaction is not BIP 125 replaceable
    - Transaction has already been bumped
    - Transaction contains inputs that don't belong to the wallet
    - Transaction has multiple change outputs
    - Transaction does not have a change output
    - Fee is higher than maxTxFee
    - New fee rate is less than the minimum fee rate
    - Change output is too small.

This commit also updates the test cases to explicitly test the error code.

Github-Pull: #9853
Rebased-From: 6d07c62322
2017-06-05 19:01:16 +00:00
Gregory Sanders 18476423fb
[Wallet] unset change position when there is no change on exact match 2017-05-31 10:57:16 +02:00
Suhas Daftuar 71463a7d18 [qa] Test prioritise_transaction / getblocktemplate interaction
Github-Pull: #10196
Rebased-From: 6a61424c9eed072ae8d79d68aac71f525c1608b5
2017-04-21 12:38:23 +00:00
Suhas Daftuar 39febb8c6d [qa] Fix mempool_packages.py for the 0.14 branch
The backport in d947afc0f7 of this
test was incorrect due to an api change in prioritisetransaction.
2017-04-05 08:30:51 -04:00
Suhas Daftuar d947afc0f7
Test prioritisetransaction and ancestor fee state
There is already a similar test for descendant fee state.

Github-Pull: #10144
Rebased-From: ba7dd8bf6f
2017-04-05 08:37:12 +02:00