Skip to content

Commit 4b1206f

Browse files
delta1tomt1664
authored andcommitted
Merge #1542: Change test order in feature_discount_ct.py to fix intermittent failure
6515f58 change test order in feature_discount_ct to fix intermittent failure (Tom Trevethan) Pull request description: Prevents blinded output being selected intermittently and resulting in vszie and fee assertions failing. ACKs for top commit: delta1: ACK 6515f58; fixes discount_ct test flakiness Tree-SHA512: 32d8c64011125e5531dd19ce84dbe39b2d4496a02c5bf5ece0cbc2f0c2bf6660816d6d61593fe32a615dd96a8632d94cba6bc09e792ffa6ea57fbdc4f52424da
1 parent 881ea00 commit 4b1206f

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

test/functional/feature_discount_ct.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -92,26 +92,6 @@ def run_test(self):
9292
assert_approx(tx['discountweight'], 1301.5, 0.5)
9393
assert_equal(tx['discountvsize'], 326)
9494

95-
self.log.info("Send confidential tx to node 0")
96-
addr = node0.getnewaddress()
97-
info = node0.getaddressinfo(addr)
98-
txid = node0.sendtoaddress(info['confidential'], 1.0, "", "", False, None, None, None, None, None, None, feerate)
99-
tx = node0.gettransaction(txid, True, True)
100-
decoded = tx['decoded']
101-
vin = decoded['vin']
102-
vout = decoded['vout']
103-
assert_equal(len(vin), 2)
104-
assert_equal(len(vout), 3)
105-
assert_equal(tx['fee']['bitcoin'], Decimal('-0.00002575'))
106-
assert_equal(decoded['vsize'], 2575)
107-
# tx weight can be 10299 or 10300, accept both
108-
assert_approx(decoded['weight'], 10299.5, 0.5)
109-
self.generate(node0, 1)
110-
tx = node1.getrawtransaction(txid, True)
111-
# tx discountweight can be 1301 or 1302, accept both
112-
assert_approx(tx['discountweight'], 1301.5, 0.5)
113-
assert_equal(tx['discountvsize'], 326) # node1 has discountvsize
114-
11595
self.log.info("Send explicit tx to node 1")
11696
addr = node1.getnewaddress()
11797
info = node1.getaddressinfo(addr)
@@ -138,6 +118,26 @@ def run_test(self):
138118
assert_approx(tx['discountweight'], 1301.5, 0.5)
139119
assert_equal(tx['discountvsize'], 326)
140120

121+
self.log.info("Send confidential tx to node 0")
122+
addr = node0.getnewaddress()
123+
info = node0.getaddressinfo(addr)
124+
txid = node0.sendtoaddress(info['confidential'], 1.0, "", "", False, None, None, None, None, None, None, feerate)
125+
tx = node0.gettransaction(txid, True, True)
126+
decoded = tx['decoded']
127+
vin = decoded['vin']
128+
vout = decoded['vout']
129+
assert_equal(len(vin), 2)
130+
assert_equal(len(vout), 3)
131+
assert_equal(tx['fee']['bitcoin'], Decimal('-0.00002575'))
132+
assert_equal(decoded['vsize'], 2575)
133+
# tx weight can be 10299 or 10300, accept both
134+
assert_approx(decoded['weight'], 10299.5, 0.5)
135+
self.generate(node0, 1)
136+
tx = node1.getrawtransaction(txid, True)
137+
# tx discountweight can be 1301 or 1302, accept both
138+
assert_approx(tx['discountweight'], 1301.5, 0.5)
139+
assert_equal(tx['discountvsize'], 326) # node1 has discountvsize
140+
141141
self.log.info("Send confidential (undiscounted) tx to node 1")
142142
addr = node1.getnewaddress()
143143
info = node1.getaddressinfo(addr)

0 commit comments

Comments
 (0)