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

Refresh the ledger pool #27

Merged
merged 2 commits into from
Mar 11, 2024
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: 1 addition & 1 deletion ariesframework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ktlint {

dependencies {
implementation("org.hyperledger:anoncreds_uniffi:0.2.0-wrapper.1")
implementation("org.hyperledger:indy_vdr_uniffi:0.2.0-wrapper.1")
implementation("org.hyperledger:indy_vdr_uniffi:0.2.1-wrapper.2")
implementation("org.hyperledger:askar_uniffi:0.2.0-wrapper.1")

implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,4 @@
// alice will be reset on tearDown
faber.reset()
}

}

Check failure on line 202 in ariesframework/src/androidTest/java/org/hyperledger/ariesframework/agent/AgentTest.kt

View workflow job for this annotation

GitHub Actions / ktlint Report

standard:no-blank-line-before-rbrace

Unexpected blank line(s) before "}"
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ class HttpOutboundTransport(val agent: Agent) : OutboundTransport {
val responseText = withContext(Dispatchers.IO) {
val request = okhttp3.Request.Builder()
.url(_package.endpoint)
.post(Json.encodeToString(_package.payload)
.toByteArray() // prevent okHttp from adding charset=utf-8 to the content type
.toRequestBody(DidCommMimeType.V1.value.toMediaType()))
.post(
Json.encodeToString(_package.payload)
.toByteArray() // prevent okHttp from adding charset=utf-8 to the content type
.toRequestBody(DidCommMimeType.V1.value.toMediaType()),
)
.build()
val response = AgentHttpClient.client.newCall(request).execute()
logger.debug("response with status code: {}", response.code)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import indy_vdr_uniffi.Pool
import indy_vdr_uniffi.Request
import indy_vdr_uniffi.openPool
import indy_vdr_uniffi.setProtocolVersion
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonArray
Expand Down Expand Up @@ -59,8 +61,12 @@ class LedgerService(val agent: Agent) {
} catch (e: Exception) {
throw Exception("Pool opening failed: ${e.message}")
}
val status = pool!!.getStatus()
logger.debug("Pool status: $status")

GlobalScope.launch {
pool?.refresh()
val status = pool?.getStatus()
logger.debug("Pool status after refresh: $status")
}
}

suspend fun registerSchema(did: DidInfo, schemaTemplate: SchemaTemplate): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import kotlinx.serialization.json.JsonContentPolymorphicSerializer
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonPrimitive
import org.hyperledger.ariesframework.connection.models.didauth.DidCommService
import org.hyperledger.ariesframework.connection.models.didauth.DidDocService
import org.hyperledger.ariesframework.util.DIDParser

@Serializable(with = OutOfBandDidCommServiceSerializer::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class MediationRecipient(private val agent: Agent, private val dispatcher: Dispa
mediationRecord.assertState(MediationState.Requested)

mediationRecord.endpoint = message.endpoint
mediationRecord.routingKeys = message.routingKeys.map {key ->
mediationRecord.routingKeys = message.routingKeys.map { key ->
if (key.startsWith("did:key:")) {
DIDParser.convertDidKeyToVerkey(key)
} else {
Expand Down
Loading