Browse Source

[Tests] extend the replace-by-fee test to cover RPC rawtx features

0.15
Jonas Schnelli 9 years ago committed by Luke Dashjr
parent
commit
5d26244148
  1. 23
      test/functional/replace-by-fee.py

23
test/functional/replace-by-fee.py

@ -99,6 +99,9 @@ class ReplaceByFeeTest(BitcoinTestFramework):
self.log.info("Running test opt-in...") self.log.info("Running test opt-in...")
self.test_opt_in() self.test_opt_in()
self.log.info("Running test RPC...")
self.test_rpc()
self.log.info("Running test prioritised transactions...") self.log.info("Running test prioritised transactions...")
self.test_prioritised_transactions() self.test_prioritised_transactions()
@ -516,5 +519,25 @@ class ReplaceByFeeTest(BitcoinTestFramework):
assert(tx2b_txid in self.nodes[0].getrawmempool()) 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__': if __name__ == '__main__':
ReplaceByFeeTest().main() ReplaceByFeeTest().main()

Loading…
Cancel
Save