-
Notifications
You must be signed in to change notification settings - Fork 0
Merge bitcoin/bitcoin#26349: rpc: make address field optional list{transactions, sinceblock} response
#119
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -97,5 +97,17 @@ def run_test(self): | |||||||||||||||||||||||||||||||||||||||||
| {"category": "receive", "amount": Decimal("0.1")}, | ||||||||||||||||||||||||||||||||||||||||||
| {"txid": txid, "label": "watchonly"}) | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| self.test_op_return() | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| def test_op_return(self): | ||||||||||||||||||||||||||||||||||||||||||
| """Test if OP_RETURN outputs will be displayed correctly.""" | ||||||||||||||||||||||||||||||||||||||||||
| raw_tx = self.nodes[0].createrawtransaction([], [{'data': 'aa'}]) | ||||||||||||||||||||||||||||||||||||||||||
| signed_raw_tx = self.nodes[0].signrawtransactionwithwallet(raw_tx) | ||||||||||||||||||||||||||||||||||||||||||
| tx_id = self.nodes[0].sendrawtransaction(signed_raw_tx['hex']) | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| op_ret_tx = [tx for tx in self.nodes[0].listtransactions() if tx['txid'] == tx_id][0] | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| assert 'address' not in op_ret_tx | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+100
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) LGTM! Focused test for OP_RETURN address field behavior. The test correctly verifies that transactions with OP_RETURN outputs do not include an "address" field in Consider addressing the static analysis hints: - def test_op_return(self):
+ def test_op_return(self) -> None:
"""Test if OP_RETURN outputs will be displayed correctly."""
raw_tx = self.nodes[0].createrawtransaction([], [{'data': 'aa'}])
signed_raw_tx = self.nodes[0].signrawtransactionwithwallet(raw_tx)
tx_id = self.nodes[0].sendrawtransaction(signed_raw_tx['hex'])
- op_ret_tx = [tx for tx in self.nodes[0].listtransactions() if tx['txid'] == tx_id][0]
+ op_ret_tx = next(tx for tx in self.nodes[0].listtransactions() if tx['txid'] == tx_id)
assert 'address' not in op_ret_tx📝 Committable suggestion
Suggested change
🧰 Tools🪛 Ruff (0.12.2)102-102: Missing return type annotation for public function Add return type annotation: (ANN201) 108-108: Prefer Replace with (RUF015) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| if __name__ == '__main__': | ||||||||||||||||||||||||||||||||||||||||||
| ListTransactionsTest().main() | ||||||||||||||||||||||||||||||||||||||||||
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.
🧹 Nitpick (assertive)
LGTM! Comprehensive test for OP_RETURN in listsinceblock.
The test correctly verifies that OP_RETURN transactions don't include an "address" field in
listsinceblockresults, complementing thelisttransactionstest. The approach of capturing the block hash before the transaction is sent is appropriate for testinglistsinceblockfunctionality.Consider addressing the static analysis hints:
Also applies to: 392-401
🤖 Prompt for AI Agents