@@ -79,8 +79,10 @@ def run_test(self):
7979 assert_equal (len (vout ), 3 )
8080 assert_equal (tx ['fee' ]['bitcoin' ], Decimal ('-0.00000326' ))
8181 assert_equal (decoded ['vsize' ], 326 )
82+ assert_equal (decoded ['weight' ], 1302 )
8283 self .generate (node0 , 1 )
8384 tx = node1 .getrawtransaction (txid , True )
85+ assert_equal (tx ['discountweight' ], 1302 )
8486 assert_equal (tx ['discountvsize' ], 326 )
8587
8688 self .log .info ("Send confidential tx to node 0" )
@@ -95,9 +97,11 @@ def run_test(self):
9597 assert_equal (len (vout ), 3 )
9698 assert_equal (tx ['fee' ]['bitcoin' ], Decimal ('-0.00002575' ))
9799 assert_equal (decoded ['vsize' ], 2575 )
100+ assert_equal (decoded ['weight' ], 10300 )
98101 self .generate (node0 , 1 )
99102 tx = node1 .getrawtransaction (txid , True )
100- assert_equal (tx ['discountvsize' ], 410 ) # node1 has discountvsize
103+ assert_equal (tx ['discountweight' ], 1302 )
104+ assert_equal (tx ['discountvsize' ], 326 ) # node1 has discountvsize
101105
102106 self .log .info ("Send explicit tx to node 1" )
103107 addr = node1 .getnewaddress ()
@@ -111,8 +115,10 @@ def run_test(self):
111115 assert_equal (len (vout ), 3 )
112116 assert_equal (tx ['fee' ]['bitcoin' ], Decimal ('-0.00000326' ))
113117 assert_equal (decoded ['vsize' ], 326 )
118+ assert_equal (decoded ['weight' ], 1302 )
114119 self .generate (node0 , 1 )
115120 tx = node1 .getrawtransaction (txid , True )
121+ assert_equal (tx ['discountweight' ], 1302 )
116122 assert_equal (tx ['discountvsize' ], 326 )
117123
118124 self .log .info ("Send confidential (undiscounted) tx to node 1" )
@@ -127,9 +133,11 @@ def run_test(self):
127133 assert_equal (len (vout ), 3 )
128134 assert_equal (tx ['fee' ]['bitcoin' ], Decimal ('-0.00002575' ))
129135 assert_equal (decoded ['vsize' ], 2575 )
136+ assert_equal (decoded ['weight' ], 10300 )
130137 self .generate (node0 , 1 )
131138 tx = node1 .getrawtransaction (txid , True )
132- assert_equal (tx ['discountvsize' ], 410 ) # node1 has discountvsize
139+ assert_equal (tx ['discountweight' ], 1302 )
140+ assert_equal (tx ['discountvsize' ], 326 ) # node1 has discountvsize
133141
134142 self .log .info ("Send confidential (discounted) tx to node 1" )
135143 bitcoin = 'b2e15d0d7a0c94e4e2ce0fe6e8691b9e451377f6e46e8045a86f7c4b5d4f0f23'
@@ -148,11 +156,13 @@ def run_test(self):
148156 assert_equal (len (vin ), 2 )
149157 assert_equal (len (vout ), 3 )
150158 if 'bitcoin' in decoded ['fee' ]:
151- assert_equal (decoded ['fee' ]['bitcoin' ], Decimal ('-0.00000410 ' ))
159+ assert_equal (decoded ['fee' ]['bitcoin' ], Decimal ('-0.00000326 ' ))
152160 else :
153- assert_equal (decoded ['fee' ][bitcoin ], Decimal ('0.00000410 ' ))
161+ assert_equal (decoded ['fee' ][bitcoin ], Decimal ('0.00000326 ' ))
154162 assert_equal (decoded ['vsize' ], 2575 )
155- assert_equal (decoded ['discountvsize' ], 410 )
163+ assert_equal (decoded ['weight' ], 10300 )
164+ assert_equal (decoded ['discountweight' ], 1302 )
165+ assert_equal (decoded ['discountvsize' ], 326 )
156166
157167 # node0 only has vsize
158168 tx = node0 .getrawtransaction (txid , True )
@@ -176,11 +186,13 @@ def run_test(self):
176186 assert_equal (len (vin ), 2 )
177187 assert_equal (len (vout ), 3 )
178188 if 'bitcoin' in decoded ['fee' ]:
179- assert_equal (decoded ['fee' ]['bitcoin' ], Decimal ('-0.00000041 ' ))
189+ assert_equal (decoded ['fee' ]['bitcoin' ], Decimal ('-0.00000033 ' ))
180190 else :
181- assert_equal (decoded ['fee' ][bitcoin ], Decimal ('0.00000041 ' ))
191+ assert_equal (decoded ['fee' ][bitcoin ], Decimal ('0.00000033 ' ))
182192 assert_equal (decoded ['vsize' ], 2575 )
183- assert_equal (decoded ['discountvsize' ], 410 )
193+ assert_equal (decoded ['weight' ], 10300 )
194+ assert_equal (decoded ['discountweight' ], 1302 )
195+ assert_equal (decoded ['discountvsize' ], 326 )
184196 # node0 only has vsize
185197 tx = node0 .getrawtransaction (txid , True )
186198 assert_equal (tx ['vsize' ], 2575 )
@@ -207,7 +219,7 @@ def run_test(self):
207219 assert_equal (test [0 ]["allowed" ], True )
208220 txid = node1 .sendrawtransaction (signed ['hex' ])
209221 tx = node1 .gettransaction (txid , True , True )
210- assert_equal (tx ['decoded' ]['discountvsize' ], 341 )
222+ assert_equal (tx ['decoded' ]['discountvsize' ], 257 )
211223
212224 for i in range (24 ):
213225 self .log .info (f"Add package descendant { i + 1 } " )
@@ -231,7 +243,7 @@ def run_test(self):
231243 assert_equal (test [0 ]["allowed" ], True )
232244 txid = node1 .sendrawtransaction (hex )
233245 tx = node1 .gettransaction (txid , True , True )
234- assert_equal (tx ['decoded' ]['discountvsize' ], 341 )
246+ assert_equal (tx ['decoded' ]['discountvsize' ], 257 )
235247 assert_equal (len (node1 .getrawmempool ()), i + 2 )
236248
237249 assert_equal (len (node1 .getrawmempool ()), 25 )
0 commit comments