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.
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.
These are new 19.1-CJ-SNAPSHOT changes, but I haven't published it yet.
|
|
||
| // if there is no wallet or identity, then skip the remaining steps of the update | ||
| if (platformRepo.hasIdentity || walletApplication.wallet == null) { | ||
| if (!platformRepo.hasIdentity || walletApplication.wallet == null) { |
There was a problem hiding this comment.
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.
| platform.stateRepository.addValidIdentity(it.userIdentifier) | ||
| } | ||
|
|
||
| platform.stateRepository.storeIdentity(blockchainIdentity.identity!!) |
There was a problem hiding this comment.
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.
as in Android DashPay Library, platform.stateRepository. is the better way to make platform calls, so the "intercepter" will catch the calls.
| 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.
This line is in danger of being abandoned here forever. Maybe TODO should be added?
There was a problem hiding this comment.
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
dashpaylibrariesRelated PR's and Dependencies
dashpay/android-dpp#40
dashpay/android-dashpay#73
Screenshots / Videos
How Has This Been Tested?
Checklist: