-
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: android test #84
Conversation
WalkthroughThis pull request involves modifications across multiple files in the KOS mobile and core packages, focusing on simplifying the handling of EVM transaction options and chain configurations. The changes primarily remove the Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🔇 Additional comments (1)
🪧 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
|
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 (1)
packages/kos-mobile/src/lib.rs (1)
454-473
: LGTM: Added test case for EVM transaction signing.The new test case verifies that transactions can be signed with the updated options structure.
However, consider adding assertions to verify the signature and chain ID in the test case.
#[test] fn should_sign_transaction_with_options() { let chain_id = 61; let raw = "b302f101819e84ae7937b285035f6cccc58252089498de4c83810b87f0e2cd92d80c9fac28c4ded4818568c696991f80c0808080"; let account = generate_wallet_from_mnemonic( "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about".to_string(), chain_id, 0, false, ) .unwrap(); let options = new_evm_transaction_options(88888); let transaction = sign_transaction(account, raw.to_string(), Some(options)).unwrap(); assert_eq!(transaction.raw, "02f87101819e84ae7937b285035f6cccc58252089498de4c83810b87f0e2cd92d80c9fac28c4ded4818568c696991f80c001a044c69f41bf47ad50dc98c74af68811384c9172055b01fcaa39e70f53df69b632a05e071cf1f9e12500b525f03a29f567520e1ea49a97e6a29d1fd432dc6303353e", "The raw doesn't match"); + assert_eq!(transaction.chain_id, chain_id, "The chain_id doesn't match"); + assert!(!transaction.signature.is_empty(), "The signature should not be empty"); }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/kos-mobile/android/lib/src/test/kotlin/uniffi/kos_mobile/KOSTest.kt
(3 hunks)packages/kos-mobile/src/lib.rs
(4 hunks)packages/kos/src/chains/mod.rs
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: format
🔇 Additional comments (6)
packages/kos-mobile/android/lib/src/test/kotlin/uniffi/kos_mobile/KOSTest.kt (3)
13-13
: LGTM: Chain ID converted to unsigned integer.The conversion of
klvChainId
from38
to38u
aligns with the updated function signatures.
28-28
: LGTM: Mnemonic size parameters converted to unsigned integers.The conversion of mnemonic size parameters from
12
and24
to12u
and24u
aligns with the updated function signatures.Also applies to: 31-31
52-52
: LGTM: Index parameter converted to unsigned integer.The conversion of the index parameter from
0
to0u
ingenerateWalletFromMnemonic
aligns with the updated function signatures.packages/kos-mobile/src/lib.rs (2)
82-83
: LGTM: Simplified EVM transaction options.The removal of the
network_type
parameter simplifies the API by focusing only on the essentialchain_id
parameter.
179-179
: LGTM: Updated EVM chain options handling.The chain options handling has been simplified to match the updated EVM options structure.
Also applies to: 192-193
packages/kos/src/chains/mod.rs (1)
Line range hint
706-758
: LGTM: Simplified custom EVM chain creation.The removal of the
network_type
parameter from custom EVM chain creation aligns with the changes in the mobile package.
Summary by CodeRabbit
Refactor
Tests
Bug Fixes
Chores