-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: trx from raw transaction type #72
Conversation
WalkthroughThe pull request introduces enhancements to the Changes
Possibly related PRs
Poem
Recent review detailsConfiguration used: .coderabbit.yaml Files selected for processing (1)
Additional comments not posted (5)
TipsChatThere are 3 ways to chat with CodeRabbit:
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
Documentation and Community
|
@coderabbitai resume |
Actions performedReviews resumed. |
@coderabbitai full review |
Actions performedFull review triggered. |
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
Outside diff range and nitpick comments (1)
packages/kos-sdk/src/chains/tron/mod.rs (1)
419-453
: Excellent work on enhancing the contract type handling and improving error handling!The changes made to the
tx_from_raw
function significantly improve its flexibility and robustness by supporting multiple contract types and handling missing contracts gracefully.Extracting the sender address based on the contract type is a clean and effective approach.
Consider adding more test cases to cover the newly supported contract types, such as
TransferAssetContract
andTriggerSmartContract
, to ensure their proper functionality.
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- packages/kos-sdk/src/chains/tron/mod.rs (4 hunks)
Additional comments not posted (2)
packages/kos-sdk/src/chains/tron/mod.rs (2)
463-463
: Simplified signature extraction logic.Directly accessing the
signature
field from thetx
object and mapping it tohex::encode
is a concise and readable way to extract the signature.
711-721
: Great job adding a test case for theTriggerSmartContract
transaction type!The new test case
test_tx_from_raw
thoroughly verifies that thetx_from_raw
function can accurately parse aTriggerSmartContract
transaction and return aTransaction
struct with the expected values forchain
,sender
, andhash
.This test case enhances the test coverage and ensures the proper functionality of the newly supported contract type.
Summary by CodeRabbit
TriggerSmartContract
transactions, ensuring accurate parsing and expected value returns.