From a4aa37266dd6485983ccaf91d131f1d90784a075 Mon Sep 17 00:00:00 2001
From: Koen <koen@pop-os.localdomain>
Date: Wed, 16 Aug 2023 12:02:38 +0200
Subject: [PATCH] Changed claimType field to long.

---
 .../java/com/futo/polycentric/core/ProcessHandleTests.kt    | 6 +++---
 app/src/main/java/com/futo/polycentric/core/ApiMethods.kt   | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/app/src/androidTest/java/com/futo/polycentric/core/ProcessHandleTests.kt b/app/src/androidTest/java/com/futo/polycentric/core/ProcessHandleTests.kt
index 35c7895..b01000f 100644
--- a/app/src/androidTest/java/com/futo/polycentric/core/ProcessHandleTests.kt
+++ b/app/src/androidTest/java/com/futo/polycentric/core/ProcessHandleTests.kt
@@ -177,7 +177,7 @@ class ProcessHandleTests {
 
         assertEquals("hello", s1State.description)
 
-        val resolved = ApiMethods.getResolveClaim(TestConstants.SERVER, s1p1.system.toProto(), ClaimType.HACKER_NEWS, "pg")
+        val resolved = ApiMethods.getResolveClaim(TestConstants.SERVER, s1p1.system.toProto(), ClaimType.HACKER_NEWS.value, "pg")
         val events = resolved.matchesList.flatMap { arrayListOf(it.claim).apply { addAll(it.proofChainList) } }
         assertEquals(1, resolved.matchesList.size)
         assertEquals(2, events.size)
@@ -197,7 +197,7 @@ class ProcessHandleTests {
 
         Synchronization.fullyBackFillServers(s1p1, s1p1.system)
 
-        val resolved = ApiMethods.getResolveClaim(TestConstants.SERVER, s1p1.system.toProto(), ClaimType.HACKER_NEWS, "pg")
+        val resolved = ApiMethods.getResolveClaim(TestConstants.SERVER, s1p1.system.toProto(), ClaimType.HACKER_NEWS.value, "pg")
         val events = resolved.matchesList.flatMap { arrayListOf(it.claim).apply { addAll(it.proofChainList) } }
         assertEquals(1, resolved.matchesList.size)
         assertEquals(2, events.size)
@@ -425,7 +425,7 @@ class ProcessHandleTests {
         val resolved = ApiMethods.getResolveClaim(
             TestConstants.SERVER,
             s1p1.system.toProto(),
-            ClaimType.HACKER_NEWS,
+            ClaimType.HACKER_NEWS.value,
             "fake_user"
         )
 
diff --git a/app/src/main/java/com/futo/polycentric/core/ApiMethods.kt b/app/src/main/java/com/futo/polycentric/core/ApiMethods.kt
index babddd0..e7373ba 100644
--- a/app/src/main/java/com/futo/polycentric/core/ApiMethods.kt
+++ b/app/src/main/java/com/futo/polycentric/core/ApiMethods.kt
@@ -59,9 +59,9 @@ class ApiMethods {
             return Protocol.Events.parseFrom(result.get())
         }
 
-        fun getResolveClaim(server: String, trustRoot: Protocol.PublicKey, claimType: ClaimType, matchAnyField: String): Protocol.QueryClaimToSystemResponse {
+        fun getResolveClaim(server: String, trustRoot: Protocol.PublicKey, claimType: Long, matchAnyField: String): Protocol.QueryClaimToSystemResponse {
             val query = Protocol.QueryClaimToSystemRequest.newBuilder()
-                .setClaimType(claimType.value)
+                .setClaimType(claimType)
                 .setTrustRoot(trustRoot)
                 .setMatchAnyField(matchAnyField)
                 .build().toByteArray().toBase64Url()
-- 
GitLab