Skip to content

Commit 5d26244

Browse files
jonasschnelliluke-jr
authored andcommitted
[Tests] extend the replace-by-fee test to cover RPC rawtx features
1 parent 36bcab2 commit 5d26244

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/functional/replace-by-fee.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ def run_test(self):
9999
self.log.info("Running test opt-in...")
100100
self.test_opt_in()
101101

102+
self.log.info("Running test RPC...")
103+
self.test_rpc()
104+
102105
self.log.info("Running test prioritised transactions...")
103106
self.test_prioritised_transactions()
104107

@@ -516,5 +519,25 @@ def test_prioritised_transactions(self):
516519

517520
assert(tx2b_txid in self.nodes[0].getrawmempool())
518521

522+
def test_rpc(self):
523+
us0 = self.nodes[0].listunspent()[0]
524+
ins = [us0];
525+
outs = {self.nodes[0].getnewaddress() : Decimal(1.0000000)}
526+
rawtx0 = self.nodes[0].createrawtransaction(ins, outs, 0, True)
527+
rawtx1 = self.nodes[0].createrawtransaction(ins, outs, 0, False)
528+
json0 = self.nodes[0].decoderawtransaction(rawtx0)
529+
json1 = self.nodes[0].decoderawtransaction(rawtx1)
530+
assert_equal(json0["vin"][0]["sequence"], 4294967293)
531+
assert_equal(json1["vin"][0]["sequence"], 4294967295)
532+
533+
rawtx2 = self.nodes[0].createrawtransaction([], outs)
534+
frawtx2a = self.nodes[0].fundrawtransaction(rawtx2, {"optIntoRbf": True})
535+
frawtx2b = self.nodes[0].fundrawtransaction(rawtx2, {"optIntoRbf": False})
536+
537+
json0 = self.nodes[0].decoderawtransaction(frawtx2a['hex'])
538+
json1 = self.nodes[0].decoderawtransaction(frawtx2b['hex'])
539+
assert_equal(json0["vin"][0]["sequence"], 4294967293)
540+
assert_equal(json1["vin"][0]["sequence"], 4294967294)
541+
519542
if __name__ == '__main__':
520543
ReplaceByFeeTest().main()

0 commit comments

Comments
 (0)