Skip to content

Commit

Permalink
Remove unrelated files
Browse files Browse the repository at this point in the history
  • Loading branch information
vikinatora committed Apr 6, 2023
1 parent f0eca7a commit 3423360
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 21,613 deletions.
10,770 changes: 0 additions & 10,770 deletions com/limechain/network/substream/lightclient/pb/LightClientMessage.java

This file was deleted.

10,779 changes: 0 additions & 10,779 deletions com/limechain/network/substream/pb/LightClientMessage.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import io.netty.handler.codec.protobuf.ProtobufEncoder;
import io.netty.handler.codec.protobuf.ProtobufVarint32FrameDecoder;
import io.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.concurrent.CompletableFuture;

Expand All @@ -26,7 +24,7 @@ public LightMessagesProtocol(LightMessagesEngine engine) {
}

@Override
protected CompletableFuture<LightMessagesController> onStartInitiator( Stream stream) {
protected CompletableFuture<LightMessagesController> onStartInitiator(Stream stream) {
stream.pushHandler(new ProtobufVarint32FrameDecoder());
stream.pushHandler(new ProtobufDecoder(LightClientMessage.Response.getDefaultInstance()));

Expand All @@ -37,40 +35,7 @@ protected CompletableFuture<LightMessagesController> onStartInitiator( Stream st
stream.pushHandler(handler);
return CompletableFuture.completedFuture(handler);
}

@Override
protected CompletableFuture<LightMessagesController> onStartResponder(Stream stream) {
stream.pushHandler(new ProtobufVarint32FrameDecoder());
stream.pushHandler(new ProtobufDecoder(LightClientMessage.Request.getDefaultInstance()));

stream.pushHandler((new ProtobufVarint32LengthFieldPrepender()));
stream.pushHandler((new ProtobufEncoder()));

Receiver handler = new Receiver(engine);
stream.pushHandler(handler);
return CompletableFuture.completedFuture(handler);
}

// Class for handling incoming requests
static class Receiver implements ProtocolMessageHandler<LightClientMessage.Request>, LightMessagesController {
private final LightMessagesEngine engine;

public Receiver(LightMessagesEngine engine) {
this.engine = engine;
}

@Override
public void onMessage(Stream stream, LightClientMessage.Request msg) {
engine.receiveRequest(msg, stream);
}

@Override
public CompletableFuture<LightClientMessage.Response> send(LightClientMessage.Request msg) {
throw new IllegalStateException("Host can't process inbound requests yet!");
}

}


// Class for handling outgoing requests
static class Sender
implements ProtocolMessageHandler<LightClientMessage.Response>,
Expand Down

0 comments on commit 3423360

Please sign in to comment.