-
Notifications
You must be signed in to change notification settings - Fork 28
fix: dont allow sim_config param in eth_sendRawTransaction endpoint #1320
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
base: main
Are you sure you want to change the base?
fix: dont allow sim_config param in eth_sendRawTransaction endpoint #1320
Conversation
WalkthroughAdds a centralized hosted-environment guard function and applies it in the decorator and in send_raw_transaction to block non-empty sim_config when running in hosted mode. Introduces unit tests covering hosted vs non-hosted flows and guard behavior across environment values. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant Endpoint as send_raw_transaction
participant Guard as raise_non_allowed_in_hosted_studio
participant Parser as transactions_parser.decode_signed_transaction
participant Processor as transactions_processor.process_transaction
Client->>Endpoint: send_raw_transaction(raw_tx, sim_config, ...)
Endpoint->>Guard: validate hosted restriction (checks VITE_IS_HOSTED and sim_config)
alt Hosted AND sim_config non-empty
Guard-->>Endpoint: throw JSONRPCError(-32000, "Non-allowed operation")
Endpoint-->>Client: error
else Allowed path (not-hosted OR sim_config empty/None)
Guard-->>Endpoint: OK
Endpoint->>Parser: decode_signed_transaction(raw_tx)
Parser-->>Endpoint: decoded_tx
Endpoint->>Processor: process_transaction(decoded_tx, ...)
Processor-->>Endpoint: tx_hash / result
Endpoint-->>Client: result
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a229f67 to
972de2b
Compare
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.
Actionable comments posted: 0
🧹 Nitpick comments (6)
backend/protocol_rpc/endpoints.py (3)
59-70: Add return type and keep env check focused.Please add a return type to comply with our typing guideline.
-def raise_non_allowed_in_hosted_studio(): +def raise_non_allowed_in_hosted_studio() -> None:
8-8: Remove duplicate import of JSONRPCError.
flask_jsonrpc.exceptions.JSONRPCErroris imported twice.-from flask_jsonrpc.exceptions import JSONRPCError ... -from flask_jsonrpc.exceptions import JSONRPCError +from flask_jsonrpc.exceptions import JSONRPCErrorAlso applies to: 50-50
820-823: Guard placement is correct; simplify condition and confirm empty dict policy.
- Minor:
if sim_config:is sufficient sinceNoneand{}are falsy.- Confirm that allowing
{}in hosted is intentional; it will still be written to DB assim_config={}at insert.- if sim_config is not None and sim_config: + if sim_config: raise_non_allowed_in_hosted_studio()tests/unit/test_send_raw_transaction.py (3)
49-75: Stabilize mocks, use insert_transaction, and assert the result (fixes Ruff F841).The function calls
insert_transaction, notprocess_transaction. Also, without stubbingget_genlayer_transaction, MagicMock truthiness can make the flow brittle. Force the SEND path and assert the returned hash.@@ -from unittest.mock import MagicMock, patch +from unittest.mock import MagicMock, patch +from types import SimpleNamespace +from backend.domain.types import TransactionType @@ - mock_decoded_transaction = MagicMock() - mock_decoded_transaction.from_address = "0x123" - mock_decoded_transaction.value = 100 - mock_decoded_transaction.data = "test_data" - mock_dependencies['transactions_parser'].decode_signed_transaction.return_value = mock_decoded_transaction - mock_dependencies['accounts_manager'].is_valid_address.return_value = True - mock_dependencies['transactions_parser'].transaction_has_valid_signature.return_value = True - mock_dependencies['transactions_processor'].process_transaction.return_value = "tx_hash" + mock_decoded_transaction = MagicMock() + mock_decoded_transaction.from_address = "0x123" + mock_decoded_transaction.to_address = None + mock_decoded_transaction.nonce = 0 + mock_decoded_transaction.value = 100 + mock_decoded_transaction.data = "test_data" + mock_dependencies['transactions_parser'].decode_signed_transaction.return_value = mock_decoded_transaction + mock_dependencies['accounts_manager'].is_valid_address.return_value = True + mock_dependencies['transactions_parser'].transaction_has_valid_signature.return_value = True + mock_dependencies['transactions_parser'].get_genlayer_transaction.return_value = SimpleNamespace( + type=TransactionType.SEND, + from_address=mock_decoded_transaction.from_address, + max_rotations=0, + num_of_initial_validators=0, + ) + mock_dependencies['transactions_processor'].insert_transaction.return_value = "tx_hash" @@ - result = send_raw_transaction( + result = send_raw_transaction( @@ - # Verify the function continues execution - mock_dependencies['transactions_parser'].decode_signed_transaction.assert_called_once() + assert result == "tx_hash" + mock_dependencies['transactions_parser'].decode_signed_transaction.assert_called_once()
76-102: Same stabilization for hosted + sim_config=None; assert the result.Mirror the fixes above to avoid brittle behavior and fix F841.
@@ - mock_decoded_transaction = MagicMock() - mock_decoded_transaction.from_address = "0x123" - mock_decoded_transaction.value = 100 - mock_decoded_transaction.data = "test_data" - mock_dependencies['transactions_parser'].decode_signed_transaction.return_value = mock_decoded_transaction - mock_dependencies['accounts_manager'].is_valid_address.return_value = True - mock_dependencies['transactions_parser'].transaction_has_valid_signature.return_value = True - mock_dependencies['transactions_processor'].process_transaction.return_value = "tx_hash" + mock_decoded_transaction = MagicMock() + mock_decoded_transaction.from_address = "0x123" + mock_decoded_transaction.to_address = None + mock_decoded_transaction.nonce = 0 + mock_decoded_transaction.value = 100 + mock_decoded_transaction.data = "test_data" + mock_dependencies['transactions_parser'].decode_signed_transaction.return_value = mock_decoded_transaction + mock_dependencies['accounts_manager'].is_valid_address.return_value = True + mock_dependencies['transactions_parser'].transaction_has_valid_signature.return_value = True + mock_dependencies['transactions_parser'].get_genlayer_transaction.return_value = SimpleNamespace( + type=TransactionType.SEND, + from_address=mock_decoded_transaction.from_address, + max_rotations=0, + num_of_initial_validators=0, + ) + mock_dependencies['transactions_processor'].insert_transaction.return_value = "tx_hash" @@ - result = send_raw_transaction( + result = send_raw_transaction( @@ - # Verify the function continues execution - mock_dependencies['transactions_parser'].decode_signed_transaction.assert_called_once() + assert result == "tx_hash" + mock_dependencies['transactions_parser'].decode_signed_transaction.assert_called_once()
103-129: Same stabilization for hosted + empty sim_config; assert the result.Apply the same adjustments to keep the test deterministic and fix F841.
@@ - mock_decoded_transaction = MagicMock() - mock_decoded_transaction.from_address = "0x123" - mock_decoded_transaction.value = 100 - mock_decoded_transaction.data = "test_data" - mock_dependencies['transactions_parser'].decode_signed_transaction.return_value = mock_decoded_transaction - mock_dependencies['accounts_manager'].is_valid_address.return_value = True - mock_dependencies['transactions_parser'].transaction_has_valid_signature.return_value = True - mock_dependencies['transactions_processor'].process_transaction.return_value = "tx_hash" + mock_decoded_transaction = MagicMock() + mock_decoded_transaction.from_address = "0x123" + mock_decoded_transaction.to_address = None + mock_decoded_transaction.nonce = 0 + mock_decoded_transaction.value = 100 + mock_decoded_transaction.data = "test_data" + mock_dependencies['transactions_parser'].decode_signed_transaction.return_value = mock_decoded_transaction + mock_dependencies['accounts_manager'].is_valid_address.return_value = True + mock_dependencies['transactions_parser'].transaction_has_valid_signature.return_value = True + mock_dependencies['transactions_parser'].get_genlayer_transaction.return_value = SimpleNamespace( + type=TransactionType.SEND, + from_address=mock_decoded_transaction.from_address, + max_rotations=0, + num_of_initial_validators=0, + ) + mock_dependencies['transactions_processor'].insert_transaction.return_value = "tx_hash" @@ - result = send_raw_transaction( + result = send_raw_transaction( @@ - # Verify the function continues execution - mock_dependencies['transactions_parser'].decode_signed_transaction.assert_called_once() + assert result == "tx_hash" + mock_dependencies['transactions_parser'].decode_signed_transaction.assert_called_once()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
backend/protocol_rpc/endpoints.py(2 hunks)tests/unit/test_send_raw_transaction.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
{backend,examples,tests}/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Python code must be formatted with Black and include type hints
Files:
tests/unit/test_send_raw_transaction.pybackend/protocol_rpc/endpoints.py
tests/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Backend tests should be written and run with pytest (unit, integration, e2e)
Files:
tests/unit/test_send_raw_transaction.py
backend/protocol_rpc/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Implement JSON-RPC endpoint handlers under backend/protocol_rpc/
Files:
backend/protocol_rpc/endpoints.py
🧬 Code graph analysis (2)
tests/unit/test_send_raw_transaction.py (3)
backend/protocol_rpc/endpoints.py (2)
send_raw_transaction(811-948)raise_non_allowed_in_hosted_studio(60-69)backend/protocol_rpc/transactions_parser.py (2)
decode_signed_transaction(67-165)transaction_has_valid_signature(235-239)backend/database_handler/accounts_manager.py (1)
is_valid_address(50-51)
backend/protocol_rpc/endpoints.py (1)
backend/protocol_rpc/message_handler/base.py (1)
wrapper(160-211)
🪛 Ruff (0.12.2)
tests/unit/test_send_raw_transaction.py
63-63: Local variable result is assigned to but never used
Remove assignment to unused variable result
(F841)
90-90: Local variable result is assigned to but never used
Remove assignment to unused variable result
(F841)
117-117: Local variable result is assigned to but never used
Remove assignment to unused variable result
(F841)
🪛 GitHub Actions: pre-commit
tests/unit/test_send_raw_transaction.py
[error] 1-1: Command 'pre-commit run --show-diff-on-failure --color=always --all-files' failed: trailing-whitespace hook modified the file.
[error] 1-1: Black formatting changed tests/unit/test_send_raw_transaction.py. Re-run pre-commit to re-apply formatting.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Load Tests / load-test
- GitHub Check: test
- GitHub Check: load-test
- GitHub Check: backend-unit-tests
🔇 Additional comments (5)
backend/protocol_rpc/endpoints.py (1)
73-79: Decorator centralization LGTM.Calling the shared guard keeps policy in one place.
tests/unit/test_send_raw_transaction.py (4)
31-47: Hosted + non-empty sim_config test looks good.Asserts error code/message/data match the guard.
148-160: Helper tests LGTM.Covers hosted=true path thoroughly.
161-180: Non-hosted variants LGTM.Good coverage of false/not-set/other values.
1-4: Run pre-commit locally and fix trailing whitespace / Black formattingVerification here failed with "/bin/bash: line 3: pre-commit: command not found". Run pre-commit locally, fix trailing whitespace and Black formatting in tests/unit/test_send_raw_transaction.py, then push.
Local commands:
pip install --user pre-commit black
pre-commit run --all-files
pytest -q tests/unit/test_send_raw_transaction.py
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.
Actionable comments posted: 2
🧹 Nitpick comments (4)
tests/unit/test_send_raw_transaction.py (4)
76-76: Remove unusedresultassignments (Ruff F841).They’re not asserted and trigger linter errors.
- result = send_raw_transaction( + send_raw_transaction( @@ - result = send_raw_transaction( + send_raw_transaction( @@ - result = send_raw_transaction( + send_raw_transaction(Also applies to: 113-113, 150-150
58-66: Stabilize mocks to avoid hidden MagicMock truthiness.Explicitly set
consensus_service.web3.is_connected.return_value = Falsein “non-hosted/hosted no-sim/empty-sim” tests so the consensus branch can’t raise inadvertently ifadd_transactionreturnsNone.mock_dependencies["accounts_manager"].is_valid_address.return_value = True mock_dependencies[ "transactions_parser" ].transaction_has_valid_signature.return_value = True - mock_dependencies["transactions_processor"].insert_transaction.return_value = "tx_hash" + mock_dependencies["transactions_processor"].insert_transaction.return_value = "tx_hash" + mock_dependencies["consensus_service"].web3.is_connected.return_value = FalseApply the same addition to the other two tests that continue execution (hosted with
sim_config=Noneand hosted withsim_config={}).Also applies to: 103-107, 140-146
165-183: LGTM: duplicate coverage for hosted + non‑empty sim_config.Redundant with the first test but okay. Consider parametrization to reduce duplication.
210-217: Optional: parametrize the “other values” cases.Cleaner with
@pytest.mark.parametrize("value", [...]).- def test_does_not_raise_when_hosted_is_other_value(self): - """Test that the function does not raise error when VITE_IS_HOSTED has other values""" - test_values = ["TRUE", "True", "1", "yes", "on", ""] - - for value in test_values: - with patch.dict(os.environ, {"VITE_IS_HOSTED": value}): - # Should not raise an exception for any value other than exactly "true" - raise_non_allowed_in_hosted_studio() + @pytest.mark.parametrize("value", ["TRUE", "True", "1", "yes", "on", ""]) + def test_does_not_raise_when_hosted_is_other_value(self, value: str) -> None: + """Does not raise for any value other than exactly 'true'.""" + with patch.dict(os.environ, {"VITE_IS_HOSTED": value}): + raise_non_allowed_in_hosted_studio()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
backend/protocol_rpc/endpoints.py(2 hunks)tests/unit/test_send_raw_transaction.py(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- backend/protocol_rpc/endpoints.py
🧰 Additional context used
📓 Path-based instructions (2)
{backend,examples,tests}/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Python code must be formatted with Black and include type hints
Files:
tests/unit/test_send_raw_transaction.py
tests/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Backend tests should be written and run with pytest (unit, integration, e2e)
Files:
tests/unit/test_send_raw_transaction.py
🧬 Code graph analysis (1)
tests/unit/test_send_raw_transaction.py (3)
backend/protocol_rpc/endpoints.py (2)
send_raw_transaction(811-948)raise_non_allowed_in_hosted_studio(60-69)backend/protocol_rpc/transactions_parser.py (2)
decode_signed_transaction(67-165)transaction_has_valid_signature(235-239)backend/database_handler/accounts_manager.py (1)
is_valid_address(50-51)
🪛 Ruff (0.12.2)
tests/unit/test_send_raw_transaction.py
76-76: Local variable result is assigned to but never used
Remove assignment to unused variable result
(F841)
113-113: Local variable result is assigned to but never used
Remove assignment to unused variable result
(F841)
150-150: Local variable result is assigned to but never used
Remove assignment to unused variable result
(F841)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Load Tests / load-test
- GitHub Check: test
- GitHub Check: load-test
🔇 Additional comments (2)
tests/unit/test_send_raw_transaction.py (2)
34-53: LGTM: hosted + non‑empty sim_config is correctly blocked.This asserts the JSON-RPC error shape and code as intended.
188-197: LGTM: guard helper behavior when hosted=true is validated.Asserts code, message, and data.
972de2b to
0846ad0
Compare
|
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.
Actionable comments posted: 0
♻️ Duplicate comments (2)
tests/unit/test_send_raw_transaction.py (2)
18-27: Add missing type hints per repo policy (tests must include type hints).Annotate fixtures and tests. This mirrors earlier feedback and aligns with Coding Guidelines.
@@ - @pytest.fixture - def mock_dependencies(self): + @pytest.fixture + def mock_dependencies(self) -> dict[str, MagicMock]: @@ - @pytest.fixture - def valid_signed_transaction(self): + @pytest.fixture + def valid_signed_transaction(self) -> str: @@ - def test_send_raw_transaction_with_sim_config_in_hosted_environment( - self, mock_dependencies, valid_signed_transaction - ): + def test_send_raw_transaction_with_sim_config_in_hosted_environment( + self, + mock_dependencies: dict[str, MagicMock], + valid_signed_transaction: str, + ) -> None: @@ - def test_send_raw_transaction_with_sim_config_in_non_hosted_environment( - self, mock_dependencies, valid_signed_transaction - ): + def test_send_raw_transaction_with_sim_config_in_non_hosted_environment( + self, + mock_dependencies: dict[str, MagicMock], + valid_signed_transaction: str, + ) -> None: @@ - def test_send_raw_transaction_without_sim_config_in_hosted_environment( - self, mock_dependencies, valid_signed_transaction - ): + def test_send_raw_transaction_without_sim_config_in_hosted_environment( + self, + mock_dependencies: dict[str, MagicMock], + valid_signed_transaction: str, + ) -> None: @@ - def test_send_raw_transaction_with_empty_sim_config_in_hosted_environment( - self, mock_dependencies, valid_signed_transaction - ): + def test_send_raw_transaction_with_empty_sim_config_in_hosted_environment( + self, + mock_dependencies: dict[str, MagicMock], + valid_signed_transaction: str, + ) -> None: @@ - def test_send_raw_transaction_with_non_empty_sim_config_in_hosted_environment( - self, mock_dependencies, valid_signed_transaction - ): + def test_send_raw_transaction_with_non_empty_sim_config_in_hosted_environment( + self, + mock_dependencies: dict[str, MagicMock], + valid_signed_transaction: str, + ) -> None: @@ - def test_raises_error_when_hosted_is_true(self): + def test_raises_error_when_hosted_is_true(self) -> None: @@ - def test_does_not_raise_when_hosted_is_false(self): + def test_does_not_raise_when_hosted_is_false(self) -> None: @@ - def test_does_not_raise_when_hosted_not_set(self): + def test_does_not_raise_when_hosted_not_set(self) -> None:Also applies to: 29-33, 34-36, 54-56, 91-93, 128-130, 165-167, 188-188, 198-198, 204-204
70-72: Resolved: using insert_transaction in mocks.Previous review flagged mocking the wrong method; this now targets insert_transaction correctly.
Also applies to: 107-109, 144-146
🧹 Nitpick comments (4)
tests/unit/test_send_raw_transaction.py (4)
76-84: Resolve Ruff F841: use or drop the unusedresultvariables.Assert the function’s return value to both satisfy Ruff and strengthen checks.
@@ - result = send_raw_transaction( + result = send_raw_transaction( transactions_processor=mock_dependencies["transactions_processor"], msg_handler=mock_dependencies["msg_handler"], accounts_manager=mock_dependencies["accounts_manager"], transactions_parser=mock_dependencies["transactions_parser"], consensus_service=mock_dependencies["consensus_service"], signed_rollup_transaction=valid_signed_transaction, sim_config={"some": "config"}, ) + assert result == "tx_hash" @@ - result = send_raw_transaction( + result = send_raw_transaction( transactions_processor=mock_dependencies["transactions_processor"], msg_handler=mock_dependencies["msg_handler"], accounts_manager=mock_dependencies["accounts_manager"], transactions_parser=mock_dependencies["transactions_parser"], consensus_service=mock_dependencies["consensus_service"], signed_rollup_transaction=valid_signed_transaction, sim_config=None, ) + assert result == "tx_hash" @@ - result = send_raw_transaction( + result = send_raw_transaction( transactions_processor=mock_dependencies["transactions_processor"], msg_handler=mock_dependencies["msg_handler"], accounts_manager=mock_dependencies["accounts_manager"], transactions_parser=mock_dependencies["transactions_parser"], consensus_service=mock_dependencies["consensus_service"], signed_rollup_transaction=valid_signed_transaction, sim_config={}, ) + assert result == "tx_hash"Also applies to: 113-121, 150-158
86-90: Strengthen verification: assert DB write path invoked.Assert
insert_transactionwas called to ensure the non-hosted/allowed flows reach persistence.@@ ].decode_signed_transaction.assert_called_once() + mock_dependencies["transactions_processor"].insert_transaction.assert_called_once() @@ ].decode_signed_transaction.assert_called_once() + mock_dependencies["transactions_processor"].insert_transaction.assert_called_once() @@ ].decode_signed_transaction.assert_called_once() + mock_dependencies["transactions_processor"].insert_transaction.assert_called_once()Also applies to: 123-127, 160-164
59-66: Stabilize mocks: setto_addressandnonceon decoded tx.Prevents brittle reliance on MagicMock defaults as endpoint code reads these attributes.
@@ mock_decoded_transaction.from_address = "0x123" mock_decoded_transaction.value = 100 mock_decoded_transaction.data = "test_data" + mock_decoded_transaction.to_address = "0x456" + mock_decoded_transaction.nonce = 1 @@ mock_decoded_transaction.from_address = "0x123" mock_decoded_transaction.value = 100 mock_decoded_transaction.data = "test_data" + mock_decoded_transaction.to_address = "0x456" + mock_decoded_transaction.nonce = 1 @@ mock_decoded_transaction.from_address = "0x123" mock_decoded_transaction.value = 100 mock_decoded_transaction.data = "test_data" + mock_decoded_transaction.to_address = "0x456" + mock_decoded_transaction.nonce = 1Also applies to: 96-103, 133-140
210-217: Parametrize “other env values” test instead of manual loop.Clearer failure reporting and aligns with pytest style.
- def test_does_not_raise_when_hosted_is_other_value(self): - """Test that the function does not raise error when VITE_IS_HOSTED has other values""" - test_values = ["TRUE", "True", "1", "yes", "on", ""] - - for value in test_values: - with patch.dict(os.environ, {"VITE_IS_HOSTED": value}): - # Should not raise an exception for any value other than exactly "true" - raise_non_allowed_in_hosted_studio() + @pytest.mark.parametrize("value", ["TRUE", "True", "1", "yes", "on", ""]) + def test_does_not_raise_when_hosted_is_other_value(self, value: str) -> None: + """Test that the function does not raise error when VITE_IS_HOSTED has other values""" + with patch.dict(os.environ, {"VITE_IS_HOSTED": value}): + # Should not raise an exception for any value other than exactly "true" + raise_non_allowed_in_hosted_studio()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
backend/protocol_rpc/endpoints.py(2 hunks)tests/unit/test_send_raw_transaction.py(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- backend/protocol_rpc/endpoints.py
🧰 Additional context used
📓 Path-based instructions (2)
{backend,examples,tests}/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Python code must be formatted with Black and include type hints
Files:
tests/unit/test_send_raw_transaction.py
tests/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Backend tests should be written and run with pytest (unit, integration, e2e)
Files:
tests/unit/test_send_raw_transaction.py
🧬 Code graph analysis (1)
tests/unit/test_send_raw_transaction.py (4)
backend/protocol_rpc/endpoints.py (2)
send_raw_transaction(811-948)raise_non_allowed_in_hosted_studio(60-69)backend/protocol_rpc/transactions_parser.py (2)
decode_signed_transaction(67-165)transaction_has_valid_signature(235-239)backend/database_handler/accounts_manager.py (1)
is_valid_address(50-51)backend/database_handler/transactions_processor.py (1)
insert_transaction(216-290)
🪛 Ruff (0.12.2)
tests/unit/test_send_raw_transaction.py
76-76: Local variable result is assigned to but never used
Remove assignment to unused variable result
(F841)
113-113: Local variable result is assigned to but never used
Remove assignment to unused variable result
(F841)
150-150: Local variable result is assigned to but never used
Remove assignment to unused variable result
(F841)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Load Tests / load-test
- GitHub Check: test
- GitHub Check: backend-unit-tests
- GitHub Check: load-test
🔇 Additional comments (1)
tests/unit/test_send_raw_transaction.py (1)
34-53: LGTM: Hosted guard error-path assertions are correct.Accurately checks JSON-RPC error code/message and blocks non-empty sim_config in hosted mode.
Also applies to: 165-183, 188-197



Fixes DXP-666
What
Why
Testing done
Decisions made
Checks
Reviewing tips
User facing release notes
Summary by CodeRabbit
Bug Fixes
Tests