New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand on contracting carve-out rule test #18723
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK c5db55a modulo comments (feel free to ignore the nits)
for _ in range(4): | ||
# First tx has 3 outputs | ||
(txid, sent_value) = self.chain_transaction(self.nodes[0], [txid], [vout], value, fee, 3) | ||
vout = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
afaict vout
is always zero anyway? same for line 63 below...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed for line 63, otherwise I think this is more clear personally
# First tx has 3 outputs | ||
(txid, sent_value) = self.chain_transaction(self.nodes[0], [txid], [vout], value, fee, 3) | ||
vout = 0 | ||
value = sent_value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant assignment in this loop (and the next one), can remove?
if not, may make sense to extract the loop body to a function
@@ -79,6 +86,10 @@ def run_test(self): | |||
# and the second chain should work just fine | |||
self.chain_transaction(self.nodes[0], [second_chain], [0], second_chain_value, fee, 1) | |||
|
|||
# But now that we're at the additional carve-out limit, the third base output being spent will be rejected | |||
# For both ancestor's descendant limits | |||
assert_raises_rpc_error(-26, "too-long-mempool-chain, too many descendants", self.chain_transaction, self.nodes[0], [chain[0][0]], [2], chain[0][1], fee, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"too-long-mempool-chain, too many descendants" used 5x, could hoist to a TOO_MANY_DESCENDANTS
constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
c5db55a
to
9e653de
Compare
9e653de
to
08dce51
Compare
Testing the "one more" on top of "one more", making sure this is rejected.