diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2015-12-03 10:45:41 +0100 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2017-06-05 23:13:24 +0000 |
commit | 5d26244148b636c1b81b9eb5ab6a45f33766bd08 (patch) | |
tree | b2b19cdc8c318f1c7bbbf593c918c90c0fa51432 /test | |
parent | 36bcab2356c4ccbefd463035b3ed1576ddb493e5 (diff) |
[Tests] extend the replace-by-fee test to cover RPC rawtx features
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/replace-by-fee.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/replace-by-fee.py b/test/functional/replace-by-fee.py index e940ce535c..da19648d85 100755 --- a/test/functional/replace-by-fee.py +++ b/test/functional/replace-by-fee.py @@ -99,6 +99,9 @@ class ReplaceByFeeTest(BitcoinTestFramework): self.log.info("Running test opt-in...") self.test_opt_in() + self.log.info("Running test RPC...") + self.test_rpc() + self.log.info("Running test prioritised transactions...") self.test_prioritised_transactions() @@ -516,5 +519,25 @@ class ReplaceByFeeTest(BitcoinTestFramework): assert(tx2b_txid in self.nodes[0].getrawmempool()) + def test_rpc(self): + us0 = self.nodes[0].listunspent()[0] + ins = [us0]; + outs = {self.nodes[0].getnewaddress() : Decimal(1.0000000)} + rawtx0 = self.nodes[0].createrawtransaction(ins, outs, 0, True) + rawtx1 = self.nodes[0].createrawtransaction(ins, outs, 0, False) + json0 = self.nodes[0].decoderawtransaction(rawtx0) + json1 = self.nodes[0].decoderawtransaction(rawtx1) + assert_equal(json0["vin"][0]["sequence"], 4294967293) + assert_equal(json1["vin"][0]["sequence"], 4294967295) + + rawtx2 = self.nodes[0].createrawtransaction([], outs) + frawtx2a = self.nodes[0].fundrawtransaction(rawtx2, {"optIntoRbf": True}) + frawtx2b = self.nodes[0].fundrawtransaction(rawtx2, {"optIntoRbf": False}) + + json0 = self.nodes[0].decoderawtransaction(frawtx2a['hex']) + json1 = self.nodes[0].decoderawtransaction(frawtx2b['hex']) + assert_equal(json0["vin"][0]["sequence"], 4294967293) + assert_equal(json1["vin"][0]["sequence"], 4294967294) + if __name__ == '__main__': ReplaceByFeeTest().main() |