-
Notifications
You must be signed in to change notification settings - Fork 123
Remove manual serialization for messages #153
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
Conversation
return instances[wallet.url] ?: CoinbaseWalletSDK( | ||
hostPackageName = wallet.packageName, | ||
scheme = wallet.url, | ||
keyManager = KeyManager(ClientConfiguration.config.context, wallet.packageName) | ||
) | ||
} | ||
|
||
fun handleResponse(uri: Uri): Boolean { | ||
@JvmStatic | ||
fun handleResponseUrl(uri: Uri): Boolean { |
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.
Changed name here to prevent naming clash when marking function with @JvmStatic
|
||
typealias UnencryptedRequestMessage = Message<UnencryptedRequestContent> | ||
|
||
sealed interface RequestContent { |
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.
Keeping this RequestContent
to keep interface CoinbaseWalletSDK.makeRequest
the same
"Must initialize open intent callback before getting CoinbaseWalletSDK instance" | ||
) | ||
if (openIntent == null) { | ||
throw IllegalStateException("Must initialize open intent callback before getting CoinbaseWalletSDK instance") |
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.
Changed this to throw IllegalStateException
because this error is not returned from the wallet
import java.security.interfaces.ECPrivateKey | ||
import java.security.interfaces.ECPublicKey | ||
|
||
object RequestConverter : MessageConverter<UnencryptedRequestMessage, EncryptedRequestMessage> { |
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.
There is some code duplication with RequestConverter and ResponseConverter, but I was not able to get the kotlin serialization library to play nicely with generic types.
@@ -14,13 +14,16 @@ data class Wallet( | |||
} | |||
|
|||
object DefaultWallets { |
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.
Summary
How did you test your changes?
Tested manually with CB Wallet to make sure changes are backwards compatible with older versions