diff --git a/test/functional/rpc_estimatefee.py b/test/functional/rpc_estimatefee.py new file mode 100755 index 000000000..c64353d26 --- /dev/null +++ b/test/functional/rpc_estimatefee.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +# Copyright (c) 2019 The Bitcoin developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +from decimal import Decimal + +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_equal + + +class EstimateFeeTest(BitcoinTestFramework): + def set_test_params(self): + self.setup_clean_chain = True + self.num_nodes = 2 + self.extra_args = [[], ["-minrelaytxfee=0.001"]] + + def run_test(self): + for i in range(5): + self.nodes[0].generate(1) + + # estimatefee is 0.00001 by default, regardless of block contents + assert_equal(self.nodes[0].estimatefee(i), Decimal('0.00001')) + # Also test named arguments + assert_equal(self.nodes[0].estimatefee( + nblocks=i), Decimal('0.00001')) + + # estimatefee may be different for nodes that set it in their config + assert_equal(self.nodes[1].estimatefee(i), Decimal('0.001')) + + +if __name__ == '__main__': + EstimateFeeTest().main() diff --git a/test/functional/timing.json b/test/functional/timing.json index d0dda2723..57c58dfb6 100644 --- a/test/functional/timing.json +++ b/test/functional/timing.json @@ -1,394 +1,398 @@ [ { "name": "abc-cmdline.py", "time": 10 }, { "name": "abc-finalize-block.py", "time": 8 }, { "name": "abc-high_priority_transaction.py", "time": 13 }, { "name": "abc-invalid-message.py", "time": 15 }, { "name": "abc-magnetic-anomaly-mining.py", "time": 49 }, { "name": "abc-mempool-accept-txn.py", "time": 15 }, { "name": "abc-mempool-coherence-on-activations.py", "time": 11 }, { "name": "abc-p2p-compactblocks.py", "time": 361 }, { "name": "abc-p2p-fullblocktest.py", "time": 54 }, { "name": "abc-parkedchain.py", "time": 14 }, { "name": "abc-replay-protection.py", "time": 13 }, { "name": "abc-rpc.py", "time": 19 }, { "name": "abc-schnorr-activation.py", "time": 6 }, { "name": "abc-segwit-recovery-activation.py", "time": 5 }, { "name": "abc-sync-chain.py", "time": 4 }, { "name": "abc-transaction-ordering.py", "time": 6 }, { "name": "example_test.py", "time": 18 }, { "name": "feature_assumevalid.py", "time": 14 }, { "name": "feature_bip68_sequence.py", "time": 74 }, { "name": "feature_block.py", "time": 132 }, { "name": "feature_cltv.py", "time": 5 }, { "name": "feature_config_args.py", "time": 21 }, { "name": "feature_csv_activation.py", "time": 16 }, { "name": "feature_dbcrash.py", "time": 1119 }, { "name": "feature_dersig.py", "time": 12 }, { "name": "feature_logging.py", "time": 36 }, { "name": "feature_maxuploadtarget.py", "time": 34 }, { "name": "feature_minchainwork.py", "time": 10 }, { "name": "feature_notifications.py", "time": 6 }, { "name": "feature_nulldummy.py", "time": 4 }, { "name": "feature_proxy.py", "time": 16 }, { "name": "feature_pruning.py", "time": 1256 }, { "name": "feature_reindex.py", "time": 16 }, { "name": "feature_uacomment.py", "time": 6 }, { "name": "interface_bitcoin_cli.py", "time": 5 }, { "name": "interface_http.py", "time": 4 }, { "name": "interface_rest.py", "time": 8 }, { "name": "interface_zmq.py", "time": 6 }, { "name": "mempool_limit.py", "time": 20 }, { "name": "mempool_packages.py", "time": 63 }, { "name": "mempool_persist.py", "time": 20 }, { "name": "mempool_reorg.py", "time": 15 }, { "name": "mempool_resurrect.py", "time": 4 }, { "name": "mempool_spend_coinbase.py", "time": 3 }, { "name": "mining_basic.py", "time": 4 }, { "name": "mining_getblocktemplate_longpoll.py", "time": 70 }, { "name": "mining_prioritisetransaction.py", "time": 22 }, { "name": "p2p_compactblocks.py", "time": 46 }, { "name": "p2p_disconnect_ban.py", "time": 20 }, { "name": "p2p_feefilter.py", "time": 27 }, { "name": "p2p_fingerprint.py", "time": 16 }, { "name": "p2p_invalid_block.py", "time": 6 }, { "name": "p2p_invalid_tx.py", "time": 5 }, { "name": "p2p_leak.py", "time": 16 }, { "name": "p2p_mempool.py", "time": 3 }, { "name": "p2p_node_network_limited.py", "time": 24 }, { "name": "p2p_sendheaders.py", "time": 16 }, { "name": "p2p_timeouts.py", "time": 67 }, { "name": "p2p_unrequested_blocks.py", "time": 6 }, { "name": "rpc_bind.py", "time": 34 }, { "name": "rpc_blockchain.py", "time": 34 }, { "name": "rpc_decodescript.py", "time": 3 }, + { + "name": "rpc_estimatefee.py", + "time": 2 + }, { "name": "rpc_fundrawtransaction.py", "time": 49 }, { "name": "rpc_getchaintips.py", "time": 6 }, { "name": "rpc_invalidateblock.py", "time": 9 }, { "name": "rpc_listtransactions.py", "time": 6 }, { "name": "rpc_named_arguments.py", "time": 3 }, { "name": "rpc_net.py", "time": 14 }, { "name": "rpc_preciousblock.py", "time": 4 }, { "name": "rpc_rawtransaction.py", "time": 25 }, { "name": "rpc_signmessage.py", "time": 4 }, { "name": "rpc_signrawtransaction.py", "time": 2 }, { "name": "rpc_txoutproof.py", "time": 5 }, { "name": "rpc_uptime.py", "time": 17 }, { "name": "rpc_users.py", "time": 20 }, { "name": "wallet_abandonconflict.py", "time": 15 }, { "name": "wallet_accounts.py", "time": 11 }, { "name": "wallet_backup.py", "time": 92 }, { "name": "wallet_basic.py", "time": 46 }, { "name": "wallet_disable.py", "time": 9 }, { "name": "wallet_dump.py", "time": 43 }, { "name": "wallet_encryption.py", "time": 9 }, { "name": "wallet_hd.py", "time": 87 }, { "name": "wallet_import_rescan.py", "time": 30 }, { "name": "wallet_importmulti.py", "time": 26 }, { "name": "wallet_importprunedfunds.py", "time": 5 }, { "name": "wallet_keypool.py", "time": 22 }, { "name": "wallet_keypool_topup.py", "time": 19 }, { "name": "wallet_listreceivedby.py", "time": 12 }, { "name": "wallet_listsinceblock.py", "time": 5 }, { "name": "wallet_multiwallet.py", "time": 39 }, { "name": "wallet_multiwallet.py --usecli", "time": 38 }, { "name": "wallet_resendwallettransactions.py", "time": 5 }, { "name": "wallet_txn_clone.py", "time": 7 }, { "name": "wallet_txn_clone.py --mineblock", "time": 6 }, { "name": "wallet_txn_doublespend.py", "time": 8 }, { "name": "wallet_txn_doublespend.py --mineblock", "time": 19 }, { "name": "wallet_zapwallettxes.py", "time": 35 } -] \ No newline at end of file +]