-
Notifications
You must be signed in to change notification settings - Fork 169
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
feat(dashpay): use mock state repository #1181
Conversation
implementation 'org.dashj.platform:dashpay:0.24-MOCK-SNAPSHOT' | ||
implementation 'org.dashj.platform:platform-core:0.24-MOCK-SNAPSHOT' |
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.
All data mocking is handled here. Any data created in DashPay won't be saved there. I didn't want to add more code to this PR requiring changes to DB tables, etc.
For now these changes will allow a username to be created or restored.
state: PoolState?, | ||
message: PoolMessage?, | ||
address: MasternodeAddress?, | ||
joined: Boolean | ||
) { | ||
super.onSessionComplete(wallet, sessionId, denomination, message) | ||
super.onSessionComplete(wallet, sessionId, denomination, state, message, address, joined) |
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.
These are new 19.1-CJ-SNAPSHOT changes, but I haven't published it yet.
if (platformRepo.hasIdentity || walletApplication.wallet == null) { | ||
if (!platformRepo.hasIdentity || walletApplication.wallet == null) { |
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.
These are some bugs leftover from merging Core 19 changes, masternode changes, etc -- but we didn't actually test this to see if it was working.
@@ -216,6 +217,8 @@ class PlatformRepo private constructor(val walletApplication: WalletApplication) | |||
dashPayProfileDao.loadAll().forEach { | |||
platform.stateRepository.addValidIdentity(it.userIdentifier) | |||
} | |||
|
|||
platform.stateRepository.storeIdentity(blockchainIdentity.identity!!) |
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.
This is where we could add other documents that we created, but at this point it doesn't seem necessary to modify DB tables to save those documents.
} else { | ||
null | ||
} | ||
platform.stateRepository.fetchIdentityFromPubKeyHash(firstIdentityKey.pubKeyHash) |
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.
as in Android DashPay Library, platform.stateRepository.
is the better way to make platform calls, so the "intercepter" will catch the calls.
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.
Looks good
@@ -656,6 +656,7 @@ class CreateIdentityService : LifecycleService() { | |||
blockchainIdentityData = BlockchainIdentityData(CreationState.NONE, null, null, null, true) | |||
|
|||
val authExtension = walletApplication.wallet!!.getKeyChainExtension(AuthenticationGroupExtension.EXTENSION_ID) as AuthenticationGroupExtension | |||
//authExtension.setWallet(walletApplication.wallet!!) // why is the wallet not set? we didn't deserialize it probably! |
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.
This line is in danger of being abandoned here forever. Maybe TODO
should be added?
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.
Thanks. This line will be removed as the bug was fixed elsewhere.
Issue being fixed or feature implemented
This will open up DashPay functions by "faking it until we make it". Mocking is done in the
dashpay
librariesRelated PR's and Dependencies
dashpay/android-dpp#40
dashpay/android-dashpay#73
Screenshots / Videos
How Has This Been Tested?
Checklist: