Skip to content
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: document get separator #40

Merged
merged 2 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/kotlin/org/dashj/platform/dpp/StateRepository.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ interface StateRepository {
*/
fun fetchIdentity(id: Identifier): Identity?

fun fetchIdentityFromPubKeyHash(pubKeyHash: ByteArray): Identity?

fun storeIdentity(identity: Identity)

fun storeIdentityPublicKeyHashes(identity: Identifier, publicKeyHashes: List<ByteArray>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Document(rawDocument: Map<String, Any?>, dataContract: DataContract) : Bas
}

fun get(path: String): Any? {
val keys = path.split("/")
val keys = path.split('.')
var value: Any? = data
for (key in keys) {
if ((value as Map<String, Any?>).containsKey(key)) {
Expand Down
4 changes: 4 additions & 0 deletions src/test/kotlin/org/dashj/platform/dpp/StateRepositoryMock.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ open class StateRepositoryMock : StateRepository {
return null
}

override fun fetchIdentityFromPubKeyHash(pubKeyHash: ByteArray): Identity? {
TODO("Not yet implemented")
}

override fun storeIdentity(identity: Identity) {
TODO("Not yet implemented")
}
Expand Down
Loading