Repository navigation
feat: new leader receipt compatibility - #23
Conversation
|
Warning Rate limit exceeded@danielrc888 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 46 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe changes update a function in Changes
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
d2636a4 to
22ed312
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
gltest/assertions.py (1)
4-12: Consider adding unit tests for the new data structure.Since this is a breaking change in data structure access, it would be valuable to add tests that verify the function works correctly with both the new list structure and handles edge cases like empty lists.
Would you like me to help generate unit tests for this function to ensure it handles the new data structure correctly?
🧰 Tools
🪛 Pylint (3.3.7)
[convention] 4-4: Missing function or method docstring
(C0116)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
gltest/assertions.py(1 hunks)pyproject.toml(2 hunks)
🔇 Additional comments (3)
pyproject.toml (2)
7-7: Version bump aligns with feature addition.The project version increment from 0.1.1 to 0.1.2 appropriately reflects the addition of new leader receipt compatibility as a feature.
17-17:Details
❓ Verification inconclusive
Verify the dependency version exists and contains expected changes.
The major version jump from 0.1.0 to 0.3.0 for genlayer-py suggests breaking changes, which aligns with the data structure modifications in assertions.py. Please ensure this version exists and contains the new leader receipt structure.
🏁 Script executed:
#!/bin/bash # Description: Verify that genlayer-py version 0.3.0 exists on PyPI # Expected: Should return version 0.3.0 if it exists curl -s https://pypi.org/pypi/genlayer-py/json | jq -r '.releases | keys[]' | grep "0.3.0"Length of output: 90
Confirm genlayer-py@0.3.0 is published and includes the new leader receipt structure
It looks like version 0.3.0 of genlayer-py isn’t appearing on PyPI. Please verify that:
- The correct package name and version (0.3.0) are published on PyPI.
- The release includes the new leader receipt data structure required by
assertions.py.Location:
pyproject.toml, line 17You can list all published versions with:
curl -s https://pypi.org/pypi/genlayer-py/json | jq -r '.releases | keys[]'gltest/assertions.py (1)
11-11: Data structure access correctly updated.The change properly accesses the first element of the
leader_receiptlist to retrieve theexecution_result, which aligns with the new data structure introduced in genlayer-py 0.3.0.
There was a problem hiding this comment.
Actionable comments posted: 4
🔭 Outside diff range comments (1)
tests/assertions/test_assertions.py (1)
36-42: 🛠️ Refactor suggestionConsolidate duplicate test cases for tx_execution_failed.
Similar to the previous comment, these test cases are duplicates and should be consolidated with more comprehensive coverage.
-def test_tx_execution_failed_with_invalid_transaction(): - assert tx_execution_failed({}) is True - - -def test_tx_execution_failed_with_empty_transaction(): - assert tx_execution_failed({}) is True +def test_tx_execution_failed_with_empty_transaction(): + assert tx_execution_failed({}) is True + + +def test_tx_execution_failed_with_missing_consensus_data(): + assert tx_execution_failed({"other_data": "value"}) is True + + +def test_tx_execution_failed_with_missing_leader_receipt(): + assert tx_execution_failed({"consensus_data": {}}) is True + + +def test_tx_execution_failed_with_empty_leader_receipt(): + assert tx_execution_failed({"consensus_data": {"leader_receipt": []}}) is True🧰 Tools
🪛 Pylint (3.3.7)
[convention] 36-36: Missing function or method docstring
(C0116)
[convention] 40-40: Missing function or method docstring
(C0116)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/assertions/test_assertions.py(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
tests/assertions/test_assertions.py (1)
gltest/assertions.py (2)
tx_execution_succeeded(4-12)tx_execution_failed(15-16)
🪛 Pylint (3.3.7)
tests/assertions/test_assertions.py
[convention] 1-1: Missing module docstring
(C0114)
[error] 1-1: Unable to import 'gltest.assertions'
(E0401)
[convention] 12-12: Missing function or method docstring
(C0116)
[convention] 16-16: Missing function or method docstring
(C0116)
[convention] 20-20: Missing function or method docstring
(C0116)
[convention] 24-24: Missing function or method docstring
(C0116)
[convention] 28-28: Missing function or method docstring
(C0116)
[convention] 32-32: Missing function or method docstring
(C0116)
[convention] 36-36: Missing function or method docstring
(C0116)
[convention] 40-40: Missing function or method docstring
(C0116)
🔇 Additional comments (1)
tests/assertions/test_assertions.py (1)
3-9: LGTM! Test data structure aligns with new leader receipt format.The mock transaction data correctly reflects the new leader receipt structure where
execution_resultis accessed vialeader_receipt[0], which aligns with the updated assertion logic and the PR objectives for leader receipt compatibility.
Fixes DXP-363
What
Notes
Summary by CodeRabbit
Bug Fixes
Tests
Chores