Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit 796acc7

Browse files
authored
Merge pull request #440 from atoulme/ssb_kt
move scuttlebutt client lib to kotlin
2 parents 5b29c47 + 7110181 commit 796acc7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1441
-1706
lines changed

scuttlebutt-client-lib/src/integrationTest/java/org/apache/tuweni/scuttlebutt/lib/FeedStreamTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public void onStreamError(Exception ex) {
108108
assertEquals("serialization-test", content.getType());
109109

110110
AsyncResult<RPCResponse> result = scuttlebuttClient
111-
.rawRequestService()
111+
.getRawRequestService()
112112
.makeAsyncRequest(new RPCAsyncRequest(new RPCFunction("whoami"), Collections.emptyList()));
113113
assertNotNull(result.get());
114114
@SuppressWarnings("rawtypes")

scuttlebutt-client-lib/src/integrationTest/java/org/apache/tuweni/scuttlebutt/lib/Utils.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
*/
1313
package org.apache.tuweni.scuttlebutt.lib;
1414

15-
import static org.apache.tuweni.scuttlebutt.lib.ScuttlebuttClientFactory.DEFAULT_NETWORK;
16-
1715
import org.apache.tuweni.concurrent.AsyncResult;
1816
import org.apache.tuweni.crypto.sodium.Signature;
1917
import org.apache.tuweni.scuttlebutt.Invite;
@@ -39,7 +37,13 @@ static ScuttlebuttClient getMasterClient(Vertx vertx) throws Exception {
3937
Signature.KeyPair serverKeypair = getLocalKeys();
4038
// log in as the server to have master rights.
4139
AsyncResult<ScuttlebuttClient> scuttlebuttClientLibAsyncResult = ScuttlebuttClientFactory
42-
.fromNetWithNetworkKey(vertx, host, port, serverKeypair, serverKeypair.publicKey(), DEFAULT_NETWORK);
40+
.fromNetWithNetworkKey(
41+
vertx,
42+
host,
43+
port,
44+
serverKeypair,
45+
serverKeypair.publicKey(),
46+
ScuttlebuttClientFactory.getDEFAULT_NETWORK());
4347

4448
return scuttlebuttClientLibAsyncResult.get();
4549
}
@@ -56,7 +60,7 @@ static ScuttlebuttClient getNewClient(Vertx vertx) throws Exception {
5660
port,
5761
Signature.KeyPair.random(),
5862
serverKeypair.publicKey(),
59-
DEFAULT_NETWORK);
63+
ScuttlebuttClientFactory.getDEFAULT_NETWORK());
6064

6165
return scuttlebuttClientLibAsyncResult.get();
6266
}
@@ -66,8 +70,12 @@ static ScuttlebuttClient connectWithInvite(Vertx vertx, Invite invite) throws Ex
6670
String actualHost = env.getOrDefault("ssb_host", "localhost");
6771
int port = Integer.parseInt(env.getOrDefault("ssb_port", "8008"));
6872
Invite recalibratedInvite = new Invite(actualHost, port, invite.identity(), invite.seedKey());
69-
AsyncResult<ScuttlebuttClient> scuttlebuttClientLibAsyncResult =
70-
ScuttlebuttClientFactory.withInvite(vertx, Signature.KeyPair.random(), recalibratedInvite, DEFAULT_NETWORK);
73+
AsyncResult<ScuttlebuttClient> scuttlebuttClientLibAsyncResult = ScuttlebuttClientFactory
74+
.withInvite(
75+
vertx,
76+
Signature.KeyPair.random(),
77+
recalibratedInvite,
78+
ScuttlebuttClientFactory.getDEFAULT_NETWORK());
7179

7280
return scuttlebuttClientLibAsyncResult.get();
7381
}

scuttlebutt-client-lib/src/main/java/org/apache/tuweni/scuttlebutt/lib/FeedService.java

Lines changed: 0 additions & 125 deletions
This file was deleted.

scuttlebutt-client-lib/src/main/java/org/apache/tuweni/scuttlebutt/lib/KeyFileLoader.java

Lines changed: 0 additions & 101 deletions
This file was deleted.

0 commit comments

Comments
 (0)