-
Notifications
You must be signed in to change notification settings - Fork 3
Feature/ton 1790 polish sdk #120
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 |
|---|---|---|
|
|
@@ -116,6 +116,14 @@ class TONMnemonic private constructor( | |
| */ | ||
| fun toPhrase(): String = words.filter { it.isNotEmpty() }.joinToString(" ") | ||
|
|
||
| override fun equals(other: Any?): Boolean { | ||
| if (this === other) return true | ||
| if (other !is TONMnemonic) return false | ||
| return words == other.words | ||
| } | ||
|
|
||
| override fun hashCode(): Int = words.hashCode() | ||
|
Comment on lines
+119
to
+125
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Search for TONMnemonic usage in HashSet, HashMap, or as map keys
# Search for HashSet/HashMap usage with TONMnemonic
rg -n --type=kotlin -C3 'HashSet.*TONMnemonic|HashMap.*TONMnemonic|mutableSetOf.*TONMnemonic|mutableMapOf.*TONMnemonic'
# Search for TONMnemonic.updateWord calls to confirm mutability usage
rg -n --type=kotlin -C2 '\.updateWord\('Repository: ton-org/kit-android Length of output: 1786 🏁 Script executed: cat -n TONWalletKit-Android/api/src/main/java/io/ton/walletkit/model/TONMnemonic.kt | head -140Repository: ton-org/kit-android Length of output: 5675 🏁 Script executed: rg -n "class TONHex" --type=kotlin -A 20Repository: ton-org/kit-android Length of output: 4579 Overriding equals/hashCode on a mutable class is an anti-pattern.
While no current usage in hash-based collections was found, the codebase exposes this as a public API, so external callers could encounter this issue. Consider one of the following approaches:
Note: Other model classes like 🤖 Prompt for AI Agents |
||
|
|
||
| override fun toString(): String = toPhrase() | ||
| } | ||
|
|
||
|
|
||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: ton-org/kit-android
Length of output: 1517
🏁 Script executed:
Repository: ton-org/kit-android
Length of output: 2793
🏁 Script executed:
# Examine the ITONWalletAdapter.kt interface file cat -n TONWalletKit-Android/api/src/main/java/io/ton/walletkit/model/ITONWalletAdapter.ktRepository: ton-org/kit-android
Length of output: 4012
🏁 Script executed:
Repository: ton-org/kit-android
Length of output: 45
Add JVM default-method compatibility configuration for the new interface member.
Line 81 adds a new interface method with a default body, but the API module's build.gradle.kts lacks the
-Xjvm-defaultcompiler flag. Existing precompiled customITONWalletAdapterimplementations will face binary compatibility issues at runtime. Either:-Xjvm-default=alltocompilerOptions.freeCompilerArgsin TONWalletKit-Android/api/build.gradle.kts, orsupportedFeatures()method with@JvmDefault🤖 Prompt for AI Agents