mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-21 21:19:36 -04:00
Removing star and unused imports with checkstyle
This commit is contained in:
parent
ce05710537
commit
3b8f19c4ce
1206 changed files with 5197 additions and 6620 deletions
|
@ -28,8 +28,9 @@ import haveno.core.app.ConsoleInput;
|
|||
import haveno.core.app.CoreModule;
|
||||
import haveno.core.app.HavenoHeadlessAppMain;
|
||||
import haveno.daemon.grpc.GrpcServer;
|
||||
import java.io.Console;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.Console;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
@ -38,8 +39,6 @@ import java.util.concurrent.ThreadFactory;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class HavenoDaemonMain extends HavenoHeadlessAppMain {
|
||||
|
||||
|
|
|
@ -16,18 +16,12 @@
|
|||
*/
|
||||
package haveno.daemon.grpc;
|
||||
|
||||
import static haveno.proto.grpc.AccountGrpc.getAccountExistsMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getBackupAccountMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getChangePasswordMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getCloseAccountMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getCreateAccountMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getDeleteAccountMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getIsAccountOpenMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getOpenAccountMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getRestoreAccountMethod;
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.protobuf.ByteString;
|
||||
import haveno.common.crypto.IncorrectPasswordException;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.AccountExistsReply;
|
||||
import haveno.proto.grpc.AccountExistsRequest;
|
||||
import haveno.proto.grpc.AccountGrpc.AccountImplBase;
|
||||
|
@ -49,20 +43,27 @@ import haveno.proto.grpc.OpenAccountReply;
|
|||
import haveno.proto.grpc.OpenAccountRequest;
|
||||
import haveno.proto.grpc.RestoreAccountReply;
|
||||
import haveno.proto.grpc.RestoreAccountRequest;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.protobuf.ByteString;
|
||||
import haveno.common.crypto.IncorrectPasswordException;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
import javax.inject.Inject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static haveno.proto.grpc.AccountGrpc.getAccountExistsMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getBackupAccountMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getChangePasswordMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getCloseAccountMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getCreateAccountMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getDeleteAccountMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getIsAccountOpenMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getOpenAccountMethod;
|
||||
import static haveno.proto.grpc.AccountGrpc.getRestoreAccountMethod;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@VisibleForTesting
|
||||
@Slf4j
|
||||
|
@ -104,7 +105,7 @@ public class GrpcAccountService extends AccountImplBase {
|
|||
exceptionHandler.handleException(log, cause, responseObserver);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void createAccount(CreateAccountRequest req, StreamObserver<CreateAccountReply> responseObserver) {
|
||||
try {
|
||||
|
@ -130,7 +131,7 @@ public class GrpcAccountService extends AccountImplBase {
|
|||
exceptionHandler.handleException(log, cause, responseObserver);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void isAppInitialized(IsAppInitializedRequest req, StreamObserver<IsAppInitializedReply> responseObserver) {
|
||||
try {
|
||||
|
@ -141,7 +142,7 @@ public class GrpcAccountService extends AccountImplBase {
|
|||
exceptionHandler.handleException(log, cause, responseObserver);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void changePassword(ChangePasswordRequest req, StreamObserver<ChangePasswordReply> responseObserver) {
|
||||
try {
|
||||
|
|
|
@ -1,26 +1,24 @@
|
|||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.RegisterDisputeAgentReply;
|
||||
import haveno.proto.grpc.RegisterDisputeAgentRequest;
|
||||
import haveno.proto.grpc.UnregisterDisputeAgentReply;
|
||||
import haveno.proto.grpc.UnregisterDisputeAgentRequest;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static haveno.proto.grpc.DisputeAgentsGrpc.DisputeAgentsImplBase;
|
||||
import static haveno.proto.grpc.DisputeAgentsGrpc.getRegisterDisputeAgentMethod;
|
||||
import static haveno.proto.grpc.DisputeAgentsGrpc.getUnregisterDisputeAgentMethod;
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@Slf4j
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.proto.grpc.DisputesGrpc.DisputesImplBase;
|
||||
import haveno.common.proto.ProtoUtil;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.core.support.dispute.Attachment;
|
||||
import haveno.core.support.dispute.DisputeResult;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.DisputesGrpc.DisputesImplBase;
|
||||
import haveno.proto.grpc.GetDisputeReply;
|
||||
import haveno.proto.grpc.GetDisputeRequest;
|
||||
import haveno.proto.grpc.GetDisputesReply;
|
||||
|
@ -17,25 +17,22 @@ import haveno.proto.grpc.ResolveDisputeReply;
|
|||
import haveno.proto.grpc.ResolveDisputeRequest;
|
||||
import haveno.proto.grpc.SendDisputeChatMessageReply;
|
||||
import haveno.proto.grpc.SendDisputeChatMessageRequest;
|
||||
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static haveno.proto.grpc.DisputesGrpc.getGetDisputeMethod;
|
||||
import static haveno.proto.grpc.DisputesGrpc.getGetDisputesMethod;
|
||||
import static haveno.proto.grpc.DisputesGrpc.getOpenDisputeMethod;
|
||||
import static haveno.proto.grpc.DisputesGrpc.getResolveDisputeMethod;
|
||||
import static haveno.proto.grpc.DisputesGrpc.getSendDisputeChatMessageMethod;
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@Slf4j
|
||||
|
|
|
@ -17,16 +17,13 @@
|
|||
|
||||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.common.handlers.ErrorMessageHandler;
|
||||
import haveno.proto.grpc.AvailabilityResultWithDescription;
|
||||
import haveno.proto.grpc.TakeOfferReply;
|
||||
import haveno.common.handlers.ErrorMessageHandler;
|
||||
import protobuf.AvailabilityResult;
|
||||
|
||||
import io.grpc.stub.StreamObserver;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.slf4j.Logger;
|
||||
import protobuf.AvailabilityResult;
|
||||
|
||||
import static haveno.proto.grpc.TradesGrpc.getTakeOfferMethod;
|
||||
import static java.lang.String.format;
|
||||
|
|
|
@ -20,15 +20,13 @@ package haveno.daemon.grpc;
|
|||
import io.grpc.Status;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import static io.grpc.Status.INVALID_ARGUMENT;
|
||||
import static io.grpc.Status.UNKNOWN;
|
||||
|
||||
|
|
|
@ -1,25 +1,23 @@
|
|||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.proto.grpc.GetTradeStatisticsReply;
|
||||
import haveno.proto.grpc.GetTradeStatisticsRequest;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.core.trade.statistics.TradeStatistics3;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.GetTradeStatisticsReply;
|
||||
import haveno.proto.grpc.GetTradeStatisticsRequest;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static haveno.proto.grpc.GetTradeStatisticsGrpc.GetTradeStatisticsImplBase;
|
||||
import static haveno.proto.grpc.GetTradeStatisticsGrpc.getGetTradeStatisticsMethod;
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@Slf4j
|
||||
|
|
|
@ -17,24 +17,22 @@
|
|||
|
||||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.proto.grpc.GetMethodHelpReply;
|
||||
import haveno.proto.grpc.GetMethodHelpRequest;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.GetMethodHelpReply;
|
||||
import haveno.proto.grpc.GetMethodHelpRequest;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static haveno.proto.grpc.HelpGrpc.HelpImplBase;
|
||||
import static haveno.proto.grpc.HelpGrpc.getGetMethodHelpMethod;
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@Slf4j
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.AddConnectionReply;
|
||||
import haveno.proto.grpc.AddConnectionRequest;
|
||||
import haveno.proto.grpc.CheckConnectionReply;
|
||||
|
@ -40,23 +43,32 @@ import haveno.proto.grpc.StartCheckingConnectionsRequest;
|
|||
import haveno.proto.grpc.StopCheckingConnectionsReply;
|
||||
import haveno.proto.grpc.StopCheckingConnectionsRequest;
|
||||
import haveno.proto.grpc.UrlConnection;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import monero.common.MoneroRpcConnection;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.inject.Inject;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import monero.common.MoneroRpcConnection;
|
||||
|
||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.*;
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.MoneroConnectionsImplBase;
|
||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getAddConnectionMethod;
|
||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getCheckConnectionMethod;
|
||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getCheckConnectionsMethod;
|
||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getGetBestAvailableConnectionMethod;
|
||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getGetConnectionMethod;
|
||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getGetConnectionsMethod;
|
||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getRemoveConnectionMethod;
|
||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getSetAutoSwitchMethod;
|
||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getSetConnectionMethod;
|
||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getStartCheckingConnectionsMethod;
|
||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getStopCheckingConnectionsMethod;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@Slf4j
|
||||
|
|
|
@ -16,39 +16,35 @@
|
|||
*/
|
||||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.core.xmr.MoneroNodeSettings;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.GetMoneroNodeSettingsReply;
|
||||
import haveno.proto.grpc.GetMoneroNodeSettingsRequest;
|
||||
import haveno.proto.grpc.IsMoneroNodeOnlineReply;
|
||||
import haveno.proto.grpc.IsMoneroNodeOnlineRequest;
|
||||
import haveno.proto.grpc.MoneroNodeGrpc.MoneroNodeImplBase;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.core.xmr.MoneroNodeSettings;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.StartMoneroNodeReply;
|
||||
import haveno.proto.grpc.StartMoneroNodeRequest;
|
||||
import haveno.proto.grpc.StopMoneroNodeReply;
|
||||
import haveno.proto.grpc.StopMoneroNodeRequest;
|
||||
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import monero.common.MoneroError;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static haveno.proto.grpc.MoneroNodeGrpc.getGetMoneroNodeSettingsMethod;
|
||||
import static haveno.proto.grpc.MoneroNodeGrpc.getIsMoneroNodeOnlineMethod;
|
||||
import static haveno.proto.grpc.MoneroNodeGrpc.getStartMoneroNodeMethod;
|
||||
import static haveno.proto.grpc.MoneroNodeGrpc.getStopMoneroNodeMethod;
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static haveno.proto.grpc.MoneroNodeGrpc.getIsMoneroNodeOnlineMethod;
|
||||
import static haveno.proto.grpc.MoneroNodeGrpc.getGetMoneroNodeSettingsMethod;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
import monero.common.MoneroError;
|
||||
|
||||
@Slf4j
|
||||
public class GrpcMoneroNodeService extends MoneroNodeImplBase {
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.proto.grpc.NotificationMessage;
|
||||
import haveno.proto.grpc.NotificationsGrpc.NotificationsImplBase;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.core.api.NotificationListener;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.NotificationMessage;
|
||||
import haveno.proto.grpc.NotificationsGrpc.NotificationsImplBase;
|
||||
import haveno.proto.grpc.RegisterNotificationListenerRequest;
|
||||
import haveno.proto.grpc.SendNotificationReply;
|
||||
import haveno.proto.grpc.SendNotificationRequest;
|
||||
|
@ -13,19 +13,17 @@ import io.grpc.Context;
|
|||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.ServerCallStreamObserver;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.NonNull;
|
||||
import lombok.Value;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static haveno.proto.grpc.NotificationsGrpc.getRegisterNotificationListenerMethod;
|
||||
import static haveno.proto.grpc.NotificationsGrpc.getSendNotificationMethod;
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@Slf4j
|
||||
|
|
|
@ -17,16 +17,14 @@
|
|||
|
||||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.proto.grpc.CancelOfferReply;
|
||||
import haveno.proto.grpc.CancelOfferRequest;
|
||||
import haveno.proto.grpc.PostOfferReply;
|
||||
import haveno.proto.grpc.PostOfferRequest;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.core.api.model.OfferInfo;
|
||||
import haveno.core.offer.Offer;
|
||||
import haveno.core.offer.OpenOffer;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.CancelOfferReply;
|
||||
import haveno.proto.grpc.CancelOfferRequest;
|
||||
import haveno.proto.grpc.GetMyOfferReply;
|
||||
import haveno.proto.grpc.GetMyOfferRequest;
|
||||
import haveno.proto.grpc.GetMyOffersReply;
|
||||
|
@ -35,9 +33,11 @@ import haveno.proto.grpc.GetOfferReply;
|
|||
import haveno.proto.grpc.GetOfferRequest;
|
||||
import haveno.proto.grpc.GetOffersReply;
|
||||
import haveno.proto.grpc.GetOffersRequest;
|
||||
|
||||
import haveno.proto.grpc.PostOfferReply;
|
||||
import haveno.proto.grpc.PostOfferRequest;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.ArrayList;
|
||||
|
@ -46,10 +46,14 @@ import java.util.List;
|
|||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.proto.grpc.OffersGrpc.*;
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static haveno.proto.grpc.OffersGrpc.OffersImplBase;
|
||||
import static haveno.proto.grpc.OffersGrpc.getCancelOfferMethod;
|
||||
import static haveno.proto.grpc.OffersGrpc.getGetMyOfferMethod;
|
||||
import static haveno.proto.grpc.OffersGrpc.getGetMyOffersMethod;
|
||||
import static haveno.proto.grpc.OffersGrpc.getGetOfferMethod;
|
||||
import static haveno.proto.grpc.OffersGrpc.getGetOffersMethod;
|
||||
import static haveno.proto.grpc.OffersGrpc.getPostOfferMethod;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@Slf4j
|
||||
|
|
|
@ -17,6 +17,16 @@
|
|||
|
||||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.core.api.model.PaymentAccountForm;
|
||||
import haveno.core.api.model.PaymentAccountFormField;
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
import haveno.core.payment.PaymentAccountFactory;
|
||||
import haveno.core.payment.payload.PaymentAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentMethod;
|
||||
import haveno.core.proto.CoreProtoResolver;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.CreateCryptoCurrencyPaymentAccountReply;
|
||||
import haveno.proto.grpc.CreateCryptoCurrencyPaymentAccountRequest;
|
||||
import haveno.proto.grpc.CreatePaymentAccountReply;
|
||||
|
@ -31,29 +41,22 @@ import haveno.proto.grpc.GetPaymentMethodsReply;
|
|||
import haveno.proto.grpc.GetPaymentMethodsRequest;
|
||||
import haveno.proto.grpc.ValidateFormFieldReply;
|
||||
import haveno.proto.grpc.ValidateFormFieldRequest;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.core.api.model.PaymentAccountForm;
|
||||
import haveno.core.api.model.PaymentAccountFormField;
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
import haveno.core.payment.PaymentAccountFactory;
|
||||
import haveno.core.payment.payload.PaymentAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentMethod;
|
||||
import haveno.core.proto.CoreProtoResolver;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.proto.grpc.PaymentAccountsGrpc.*;
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static haveno.proto.grpc.PaymentAccountsGrpc.PaymentAccountsImplBase;
|
||||
import static haveno.proto.grpc.PaymentAccountsGrpc.getCreateCryptoCurrencyPaymentAccountMethod;
|
||||
import static haveno.proto.grpc.PaymentAccountsGrpc.getCreatePaymentAccountMethod;
|
||||
import static haveno.proto.grpc.PaymentAccountsGrpc.getGetPaymentAccountFormMethod;
|
||||
import static haveno.proto.grpc.PaymentAccountsGrpc.getGetPaymentAccountsMethod;
|
||||
import static haveno.proto.grpc.PaymentAccountsGrpc.getGetPaymentMethodsMethod;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@Slf4j
|
||||
|
@ -172,7 +175,7 @@ class GrpcPaymentAccountsService extends PaymentAccountsImplBase {
|
|||
exceptionHandler.handleException(log, cause, responseObserver);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void validateFormField(ValidateFormFieldRequest req,
|
||||
StreamObserver<ValidateFormFieldReply> responseObserver) {
|
||||
|
|
|
@ -17,31 +17,29 @@
|
|||
|
||||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.core.api.model.MarketDepthInfo;
|
||||
import haveno.core.api.model.MarketPriceInfo;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.MarketDepthReply;
|
||||
import haveno.proto.grpc.MarketDepthRequest;
|
||||
import haveno.proto.grpc.MarketPriceReply;
|
||||
import haveno.proto.grpc.MarketPriceRequest;
|
||||
import haveno.proto.grpc.MarketPricesReply;
|
||||
import haveno.proto.grpc.MarketPricesRequest;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.core.api.model.MarketDepthInfo;
|
||||
import haveno.core.api.model.MarketPriceInfo;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static haveno.proto.grpc.PriceGrpc.PriceImplBase;
|
||||
import static haveno.proto.grpc.PriceGrpc.getGetMarketPriceMethod;
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@Slf4j
|
||||
|
|
|
@ -17,23 +17,19 @@
|
|||
|
||||
package haveno.daemon.grpc;
|
||||
|
||||
import io.grpc.Server;
|
||||
import io.grpc.ServerBuilder;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static io.grpc.ServerInterceptors.interceptForward;
|
||||
|
||||
import haveno.common.UserThread;
|
||||
import haveno.common.config.Config;
|
||||
import haveno.core.api.CoreContext;
|
||||
import haveno.daemon.grpc.interceptor.PasswordAuthInterceptor;
|
||||
import io.grpc.Server;
|
||||
import io.grpc.ServerBuilder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
|
||||
import static io.grpc.ServerInterceptors.interceptForward;
|
||||
|
||||
@Singleton
|
||||
@Slf4j
|
||||
|
|
|
@ -17,17 +17,16 @@
|
|||
|
||||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.common.UserThread;
|
||||
import haveno.core.app.HavenoHeadlessApp;
|
||||
import haveno.proto.grpc.ShutdownServerGrpc;
|
||||
import haveno.proto.grpc.StopReply;
|
||||
import haveno.proto.grpc.StopRequest;
|
||||
import haveno.common.UserThread;
|
||||
import haveno.core.app.HavenoHeadlessApp;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||
|
||||
@Slf4j
|
||||
|
|
|
@ -17,6 +17,13 @@
|
|||
|
||||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.core.api.model.TradeInfo;
|
||||
import haveno.core.trade.Trade;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.CompleteTradeReply;
|
||||
import haveno.proto.grpc.CompleteTradeRequest;
|
||||
import haveno.proto.grpc.ConfirmPaymentReceivedReply;
|
||||
import haveno.proto.grpc.ConfirmPaymentReceivedRequest;
|
||||
import haveno.proto.grpc.ConfirmPaymentSentReply;
|
||||
|
@ -27,31 +34,32 @@ import haveno.proto.grpc.GetTradeReply;
|
|||
import haveno.proto.grpc.GetTradeRequest;
|
||||
import haveno.proto.grpc.GetTradesReply;
|
||||
import haveno.proto.grpc.GetTradesRequest;
|
||||
import haveno.proto.grpc.CompleteTradeReply;
|
||||
import haveno.proto.grpc.CompleteTradeRequest;
|
||||
import haveno.proto.grpc.SendChatMessageReply;
|
||||
import haveno.proto.grpc.SendChatMessageRequest;
|
||||
import haveno.proto.grpc.TakeOfferReply;
|
||||
import haveno.proto.grpc.TakeOfferRequest;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.core.api.model.TradeInfo;
|
||||
import haveno.core.trade.Trade;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.proto.grpc.TradesGrpc.*;
|
||||
import static haveno.core.api.model.TradeInfo.toTradeInfo;
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static haveno.proto.grpc.TradesGrpc.TradesImplBase;
|
||||
import static haveno.proto.grpc.TradesGrpc.getCompleteTradeMethod;
|
||||
import static haveno.proto.grpc.TradesGrpc.getConfirmPaymentReceivedMethod;
|
||||
import static haveno.proto.grpc.TradesGrpc.getConfirmPaymentSentMethod;
|
||||
import static haveno.proto.grpc.TradesGrpc.getGetChatMessagesMethod;
|
||||
import static haveno.proto.grpc.TradesGrpc.getGetTradeMethod;
|
||||
import static haveno.proto.grpc.TradesGrpc.getGetTradesMethod;
|
||||
import static haveno.proto.grpc.TradesGrpc.getSendChatMessageMethod;
|
||||
import static haveno.proto.grpc.TradesGrpc.getTakeOfferMethod;
|
||||
import static haveno.proto.grpc.TradesGrpc.getWithdrawFundsMethod;
|
||||
import static java.util.concurrent.TimeUnit.MINUTES;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
|
|
|
@ -17,26 +17,23 @@
|
|||
|
||||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.proto.grpc.GetVersionReply;
|
||||
import haveno.proto.grpc.GetVersionRequest;
|
||||
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.GetVersionReply;
|
||||
import haveno.proto.grpc.GetVersionRequest;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static haveno.proto.grpc.GetVersionGrpc.GetVersionImplBase;
|
||||
import static haveno.proto.grpc.GetVersionGrpc.getGetVersionMethod;
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@VisibleForTesting
|
||||
|
|
|
@ -17,67 +17,62 @@
|
|||
|
||||
package haveno.daemon.grpc;
|
||||
|
||||
import haveno.common.UserThread;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.core.api.model.AddressBalanceInfo;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.proto.grpc.CreateXmrTxReply;
|
||||
import haveno.proto.grpc.CreateXmrTxRequest;
|
||||
import haveno.proto.grpc.GetAddressBalanceReply;
|
||||
import haveno.proto.grpc.GetAddressBalanceRequest;
|
||||
import haveno.proto.grpc.GetBalancesReply;
|
||||
import haveno.proto.grpc.GetBalancesRequest;
|
||||
import haveno.proto.grpc.GetFundingAddressesReply;
|
||||
import haveno.proto.grpc.GetFundingAddressesRequest;
|
||||
import haveno.proto.grpc.GetXmrNewSubaddressReply;
|
||||
import haveno.proto.grpc.GetXmrNewSubaddressRequest;
|
||||
import haveno.proto.grpc.GetXmrPrimaryAddressReply;
|
||||
import haveno.proto.grpc.GetXmrPrimaryAddressRequest;
|
||||
import haveno.proto.grpc.GetXmrNewSubaddressReply;
|
||||
import haveno.proto.grpc.GetXmrTxsRequest;
|
||||
import haveno.proto.grpc.GetXmrTxsReply;
|
||||
import haveno.proto.grpc.CreateXmrTxRequest;
|
||||
import haveno.proto.grpc.CreateXmrTxReply;
|
||||
import haveno.proto.grpc.RelayXmrTxRequest;
|
||||
import haveno.proto.grpc.RelayXmrTxReply;
|
||||
import haveno.proto.grpc.GetXmrSeedReply;
|
||||
import haveno.proto.grpc.GetXmrSeedRequest;
|
||||
import haveno.proto.grpc.GetXmrTxsReply;
|
||||
import haveno.proto.grpc.GetXmrTxsRequest;
|
||||
import haveno.proto.grpc.LockWalletReply;
|
||||
import haveno.proto.grpc.LockWalletRequest;
|
||||
import haveno.proto.grpc.RelayXmrTxReply;
|
||||
import haveno.proto.grpc.RelayXmrTxRequest;
|
||||
import haveno.proto.grpc.RemoveWalletPasswordReply;
|
||||
import haveno.proto.grpc.RemoveWalletPasswordRequest;
|
||||
import haveno.proto.grpc.SendBtcRequest;
|
||||
import haveno.proto.grpc.SetWalletPasswordReply;
|
||||
import haveno.proto.grpc.SetWalletPasswordRequest;
|
||||
import haveno.proto.grpc.UnlockWalletReply;
|
||||
import haveno.proto.grpc.UnlockWalletRequest;
|
||||
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
|
||||
import org.bitcoinj.core.Transaction;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import monero.wallet.model.MoneroDestination;
|
||||
import monero.wallet.model.MoneroTxWallet;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.google.common.util.concurrent.FutureCallback;
|
||||
import haveno.common.UserThread;
|
||||
import haveno.core.api.CoreApi;
|
||||
import haveno.core.api.model.AddressBalanceInfo;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import java.math.BigInteger;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static haveno.proto.grpc.WalletsGrpc.*;
|
||||
import static haveno.core.api.model.XmrTx.toXmrTx;
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static java.util.concurrent.TimeUnit.MINUTES;
|
||||
import static haveno.proto.grpc.WalletsGrpc.WalletsImplBase;
|
||||
import static haveno.proto.grpc.WalletsGrpc.getGetAddressBalanceMethod;
|
||||
import static haveno.proto.grpc.WalletsGrpc.getGetBalancesMethod;
|
||||
import static haveno.proto.grpc.WalletsGrpc.getGetFundingAddressesMethod;
|
||||
import static haveno.proto.grpc.WalletsGrpc.getLockWalletMethod;
|
||||
import static haveno.proto.grpc.WalletsGrpc.getRemoveWalletPasswordMethod;
|
||||
import static haveno.proto.grpc.WalletsGrpc.getSetWalletPasswordMethod;
|
||||
import static haveno.proto.grpc.WalletsGrpc.getUnlockWalletMethod;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
import monero.wallet.model.MoneroDestination;
|
||||
import monero.wallet.model.MoneroTxWallet;
|
||||
|
||||
@Slf4j
|
||||
class GrpcWalletsService extends WalletsImplBase {
|
||||
|
||||
|
@ -119,7 +114,7 @@ class GrpcWalletsService extends WalletsImplBase {
|
|||
exceptionHandler.handleException(log, cause, responseObserver);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getXmrPrimaryAddress(GetXmrPrimaryAddressRequest req,
|
||||
StreamObserver<GetXmrPrimaryAddressReply> responseObserver) {
|
||||
|
|
|
@ -22,15 +22,13 @@ import io.grpc.ServerCall;
|
|||
import io.grpc.ServerCallHandler;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static io.grpc.Status.PERMISSION_DENIED;
|
||||
import static java.lang.String.format;
|
||||
import static java.util.stream.Collectors.joining;
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
package haveno.daemon.grpc.interceptor;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static java.lang.String.format;
|
||||
import static java.lang.System.currentTimeMillis;
|
||||
|
||||
|
|
|
@ -17,20 +17,17 @@
|
|||
|
||||
package haveno.daemon.grpc.interceptor;
|
||||
|
||||
import io.grpc.ServerInterceptor;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
|
@ -39,8 +36,6 @@ import java.util.Map;
|
|||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static haveno.common.file.FileUtil.deleteFileIfExists;
|
||||
import static haveno.common.file.FileUtil.renameFile;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package haveno.daemon.grpc.interceptor;
|
||||
|
||||
import haveno.common.config.Config;
|
||||
import io.grpc.Metadata;
|
||||
import io.grpc.ServerCall;
|
||||
import io.grpc.ServerCallHandler;
|
||||
|
@ -30,8 +31,6 @@ import static io.grpc.Metadata.Key;
|
|||
import static io.grpc.Status.UNAUTHENTICATED;
|
||||
import static java.lang.String.format;
|
||||
|
||||
import haveno.common.config.Config;
|
||||
|
||||
/**
|
||||
* Authorizes rpc server calls by comparing the value of the caller's
|
||||
* {@value PASSWORD_KEY} header to an expected value set at server startup time.
|
||||
|
|
|
@ -17,22 +17,19 @@
|
|||
|
||||
package haveno.daemon.grpc.interceptor;
|
||||
|
||||
import haveno.daemon.grpc.GrpcVersionService;
|
||||
import io.grpc.ServerInterceptor;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||
import static java.lang.System.getProperty;
|
||||
import static java.util.concurrent.TimeUnit.DAYS;
|
||||
|
@ -44,11 +41,6 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
|
|||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import haveno.daemon.grpc.GrpcVersionService;
|
||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||
import haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig;
|
||||
|
||||
@Slf4j
|
||||
public class GrpcServiceRateMeteringConfigTest {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue