rename all packages and other names from bisq to haveno

This commit is contained in:
woodser 2023-03-06 19:14:00 -05:00
parent ab0b9e3b77
commit 1a1fb130c0
1775 changed files with 14575 additions and 16767 deletions

View file

@ -15,9 +15,9 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.app;
package haveno.daemon.app;
import bisq.core.app.HavenoHeadlessApp;
import haveno.core.app.HavenoHeadlessApp;
public class HavenoDaemon extends HavenoHeadlessApp {
}

View file

@ -15,21 +15,19 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.app;
import bisq.core.api.AccountServiceListener;
import bisq.core.app.ConsoleInput;
import bisq.core.app.CoreModule;
import bisq.core.app.HavenoHeadlessAppMain;
import bisq.common.UserThread;
import bisq.common.app.AppModule;
import bisq.common.crypto.IncorrectPasswordException;
import bisq.common.handlers.ResultHandler;
import bisq.common.persistence.PersistenceManager;
package haveno.daemon.app;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import haveno.common.UserThread;
import haveno.common.app.AppModule;
import haveno.common.crypto.IncorrectPasswordException;
import haveno.common.handlers.ResultHandler;
import haveno.common.persistence.PersistenceManager;
import haveno.core.api.AccountServiceListener;
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 java.util.concurrent.CancellationException;
@ -42,8 +40,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
import lombok.extern.slf4j.Slf4j;
import bisq.daemon.grpc.GrpcServer;
@Slf4j
public class HavenoDaemonMain extends HavenoHeadlessAppMain {

View file

@ -14,47 +14,47 @@
* You should have received a copy of the GNU Affero General Public License
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc;
package haveno.daemon.grpc;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static bisq.proto.grpc.AccountGrpc.getAccountExistsMethod;
import static bisq.proto.grpc.AccountGrpc.getBackupAccountMethod;
import static bisq.proto.grpc.AccountGrpc.getChangePasswordMethod;
import static bisq.proto.grpc.AccountGrpc.getCloseAccountMethod;
import static bisq.proto.grpc.AccountGrpc.getCreateAccountMethod;
import static bisq.proto.grpc.AccountGrpc.getDeleteAccountMethod;
import static bisq.proto.grpc.AccountGrpc.getIsAccountOpenMethod;
import static bisq.proto.grpc.AccountGrpc.getOpenAccountMethod;
import static bisq.proto.grpc.AccountGrpc.getRestoreAccountMethod;
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 bisq.common.crypto.IncorrectPasswordException;
import bisq.core.api.CoreApi;
import bisq.daemon.grpc.interceptor.CallRateMeteringInterceptor;
import bisq.daemon.grpc.interceptor.GrpcCallRateMeter;
import bisq.proto.grpc.AccountExistsReply;
import bisq.proto.grpc.AccountExistsRequest;
import bisq.proto.grpc.AccountGrpc.AccountImplBase;
import bisq.proto.grpc.BackupAccountReply;
import bisq.proto.grpc.BackupAccountRequest;
import bisq.proto.grpc.ChangePasswordReply;
import bisq.proto.grpc.ChangePasswordRequest;
import bisq.proto.grpc.CloseAccountReply;
import bisq.proto.grpc.CloseAccountRequest;
import bisq.proto.grpc.CreateAccountReply;
import bisq.proto.grpc.CreateAccountRequest;
import bisq.proto.grpc.DeleteAccountReply;
import bisq.proto.grpc.DeleteAccountRequest;
import bisq.proto.grpc.IsAccountOpenReply;
import bisq.proto.grpc.IsAccountOpenRequest;
import bisq.proto.grpc.IsAppInitializedReply;
import bisq.proto.grpc.IsAppInitializedRequest;
import bisq.proto.grpc.OpenAccountReply;
import bisq.proto.grpc.OpenAccountRequest;
import bisq.proto.grpc.RestoreAccountReply;
import bisq.proto.grpc.RestoreAccountRequest;
import haveno.proto.grpc.AccountExistsReply;
import haveno.proto.grpc.AccountExistsRequest;
import haveno.proto.grpc.AccountGrpc.AccountImplBase;
import haveno.proto.grpc.BackupAccountReply;
import haveno.proto.grpc.BackupAccountRequest;
import haveno.proto.grpc.ChangePasswordReply;
import haveno.proto.grpc.ChangePasswordRequest;
import haveno.proto.grpc.CloseAccountReply;
import haveno.proto.grpc.CloseAccountRequest;
import haveno.proto.grpc.CreateAccountReply;
import haveno.proto.grpc.CreateAccountRequest;
import haveno.proto.grpc.DeleteAccountReply;
import haveno.proto.grpc.DeleteAccountRequest;
import haveno.proto.grpc.IsAccountOpenReply;
import haveno.proto.grpc.IsAccountOpenRequest;
import haveno.proto.grpc.IsAppInitializedReply;
import haveno.proto.grpc.IsAppInitializedRequest;
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 java.io.ByteArrayInputStream;

View file

@ -1,11 +1,12 @@
package bisq.daemon.grpc;
import bisq.core.api.CoreApi;
import bisq.proto.grpc.RegisterDisputeAgentReply;
import bisq.proto.grpc.RegisterDisputeAgentRequest;
import bisq.proto.grpc.UnregisterDisputeAgentReply;
import bisq.proto.grpc.UnregisterDisputeAgentRequest;
package haveno.daemon.grpc;
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;
@ -16,17 +17,12 @@ import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static bisq.proto.grpc.DisputeAgentsGrpc.DisputeAgentsImplBase;
import static bisq.proto.grpc.DisputeAgentsGrpc.getRegisterDisputeAgentMethod;
import static bisq.proto.grpc.DisputeAgentsGrpc.getUnregisterDisputeAgentMethod;
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;
import bisq.daemon.grpc.interceptor.CallRateMeteringInterceptor;
import bisq.daemon.grpc.interceptor.GrpcCallRateMeter;
@Slf4j
class GrpcDisputeAgentsService extends DisputeAgentsImplBase {

View file

@ -1,22 +1,22 @@
package bisq.daemon.grpc;
package haveno.daemon.grpc;
import bisq.core.api.CoreApi;
import bisq.core.support.dispute.Attachment;
import bisq.core.support.dispute.DisputeResult;
import bisq.common.proto.ProtoUtil;
import bisq.proto.grpc.DisputesGrpc.DisputesImplBase;
import bisq.proto.grpc.GetDisputeReply;
import bisq.proto.grpc.GetDisputeRequest;
import bisq.proto.grpc.GetDisputesReply;
import bisq.proto.grpc.GetDisputesRequest;
import bisq.proto.grpc.OpenDisputeReply;
import bisq.proto.grpc.OpenDisputeRequest;
import bisq.proto.grpc.ResolveDisputeReply;
import bisq.proto.grpc.ResolveDisputeRequest;
import bisq.proto.grpc.SendDisputeChatMessageReply;
import bisq.proto.grpc.SendDisputeChatMessageRequest;
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.GetDisputeReply;
import haveno.proto.grpc.GetDisputeRequest;
import haveno.proto.grpc.GetDisputesReply;
import haveno.proto.grpc.GetDisputesRequest;
import haveno.proto.grpc.OpenDisputeReply;
import haveno.proto.grpc.OpenDisputeRequest;
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;
@ -30,17 +30,14 @@ import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static bisq.proto.grpc.DisputesGrpc.getGetDisputeMethod;
import static bisq.proto.grpc.DisputesGrpc.getGetDisputesMethod;
import static bisq.proto.grpc.DisputesGrpc.getOpenDisputeMethod;
import static bisq.proto.grpc.DisputesGrpc.getResolveDisputeMethod;
import static bisq.proto.grpc.DisputesGrpc.getSendDisputeChatMessageMethod;
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;
import bisq.daemon.grpc.interceptor.CallRateMeteringInterceptor;
import bisq.daemon.grpc.interceptor.GrpcCallRateMeter;
@Slf4j
public class GrpcDisputesService extends DisputesImplBase {

View file

@ -15,13 +15,11 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc;
import bisq.common.handlers.ErrorMessageHandler;
import bisq.proto.grpc.AvailabilityResultWithDescription;
import bisq.proto.grpc.TakeOfferReply;
package haveno.daemon.grpc;
import haveno.proto.grpc.AvailabilityResultWithDescription;
import haveno.proto.grpc.TakeOfferReply;
import haveno.common.handlers.ErrorMessageHandler;
import protobuf.AvailabilityResult;
import io.grpc.stub.StreamObserver;
@ -30,13 +28,13 @@ import org.slf4j.Logger;
import lombok.Getter;
import static bisq.proto.grpc.TradesGrpc.getTakeOfferMethod;
import static haveno.proto.grpc.TradesGrpc.getTakeOfferMethod;
import static java.lang.String.format;
import static java.util.Arrays.stream;
/**
* An implementation of bisq.common.handlers.ErrorMessageHandler that avoids
* an exception loop with the UI's bisq.common.taskrunner framework.
* An implementation of haveno.common.handlers.ErrorMessageHandler that avoids
* an exception loop with the UI's haveno.common.taskrunner framework.
*
* The legacy ErrorMessageHandler is for reporting error messages only to the UI, but
* some core api tasks (takeoffer) require one. This implementation works around
@ -133,7 +131,7 @@ public class GrpcErrorMessageHandler implements ErrorMessageHandler {
}
private String getAvailabilityResultDescription(AvailabilityResult proto) {
return bisq.core.offer.AvailabilityResult.fromProto(proto).description();
return haveno.core.offer.AvailabilityResult.fromProto(proto).description();
}
private boolean takeOfferWasCalled() {

View file

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc;
package haveno.daemon.grpc;
import io.grpc.Status;
import io.grpc.StatusRuntimeException;

View file

@ -1,11 +1,11 @@
package bisq.daemon.grpc;
import bisq.core.api.CoreApi;
import bisq.core.trade.statistics.TradeStatistics3;
import bisq.proto.grpc.GetTradeStatisticsReply;
import bisq.proto.grpc.GetTradeStatisticsRequest;
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 io.grpc.ServerInterceptor;
import io.grpc.stub.StreamObserver;
@ -17,16 +17,11 @@ import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static bisq.proto.grpc.GetTradeStatisticsGrpc.GetTradeStatisticsImplBase;
import static bisq.proto.grpc.GetTradeStatisticsGrpc.getGetTradeStatisticsMethod;
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;
import bisq.daemon.grpc.interceptor.CallRateMeteringInterceptor;
import bisq.daemon.grpc.interceptor.GrpcCallRateMeter;
@Slf4j
class GrpcGetTradeStatisticsService extends GetTradeStatisticsImplBase {

View file

@ -15,13 +15,13 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc;
import bisq.core.api.CoreApi;
import bisq.proto.grpc.GetMethodHelpReply;
import bisq.proto.grpc.GetMethodHelpRequest;
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 io.grpc.ServerInterceptor;
import io.grpc.stub.StreamObserver;
@ -32,16 +32,11 @@ import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static bisq.proto.grpc.HelpGrpc.HelpImplBase;
import static bisq.proto.grpc.HelpGrpc.getGetMethodHelpMethod;
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;
import bisq.daemon.grpc.interceptor.CallRateMeteringInterceptor;
import bisq.daemon.grpc.interceptor.GrpcCallRateMeter;
@Slf4j
class GrpcHelpService extends HelpImplBase {

View file

@ -15,34 +15,34 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc;
package haveno.daemon.grpc;
import bisq.core.api.CoreApi;
import bisq.daemon.grpc.interceptor.CallRateMeteringInterceptor;
import bisq.daemon.grpc.interceptor.GrpcCallRateMeter;
import bisq.proto.grpc.AddConnectionReply;
import bisq.proto.grpc.AddConnectionRequest;
import bisq.proto.grpc.CheckConnectionReply;
import bisq.proto.grpc.CheckConnectionRequest;
import bisq.proto.grpc.CheckConnectionsReply;
import bisq.proto.grpc.CheckConnectionsRequest;
import bisq.proto.grpc.GetBestAvailableConnectionReply;
import bisq.proto.grpc.GetBestAvailableConnectionRequest;
import bisq.proto.grpc.GetConnectionReply;
import bisq.proto.grpc.GetConnectionRequest;
import bisq.proto.grpc.GetConnectionsReply;
import bisq.proto.grpc.GetConnectionsRequest;
import bisq.proto.grpc.RemoveConnectionReply;
import bisq.proto.grpc.RemoveConnectionRequest;
import bisq.proto.grpc.SetAutoSwitchReply;
import bisq.proto.grpc.SetAutoSwitchRequest;
import bisq.proto.grpc.SetConnectionReply;
import bisq.proto.grpc.SetConnectionRequest;
import bisq.proto.grpc.StartCheckingConnectionsReply;
import bisq.proto.grpc.StartCheckingConnectionsRequest;
import bisq.proto.grpc.StopCheckingConnectionsReply;
import bisq.proto.grpc.StopCheckingConnectionsRequest;
import bisq.proto.grpc.UrlConnection;
import haveno.proto.grpc.AddConnectionReply;
import haveno.proto.grpc.AddConnectionRequest;
import haveno.proto.grpc.CheckConnectionReply;
import haveno.proto.grpc.CheckConnectionRequest;
import haveno.proto.grpc.CheckConnectionsReply;
import haveno.proto.grpc.CheckConnectionsRequest;
import haveno.proto.grpc.GetBestAvailableConnectionReply;
import haveno.proto.grpc.GetBestAvailableConnectionRequest;
import haveno.proto.grpc.GetConnectionReply;
import haveno.proto.grpc.GetConnectionRequest;
import haveno.proto.grpc.GetConnectionsReply;
import haveno.proto.grpc.GetConnectionsRequest;
import haveno.proto.grpc.RemoveConnectionReply;
import haveno.proto.grpc.RemoveConnectionRequest;
import haveno.proto.grpc.SetAutoSwitchReply;
import haveno.proto.grpc.SetAutoSwitchRequest;
import haveno.proto.grpc.SetConnectionReply;
import haveno.proto.grpc.SetConnectionRequest;
import haveno.proto.grpc.StartCheckingConnectionsReply;
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 java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
@ -55,8 +55,8 @@ import io.grpc.stub.StreamObserver;
import lombok.extern.slf4j.Slf4j;
import monero.common.MoneroRpcConnection;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static bisq.proto.grpc.MoneroConnectionsGrpc.*;
import static haveno.proto.grpc.MoneroConnectionsGrpc.*;
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static java.util.concurrent.TimeUnit.SECONDS;
@Slf4j

View file

@ -14,20 +14,21 @@
* You should have received a copy of the GNU Affero General Public License
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc;
package haveno.daemon.grpc;
import bisq.core.api.CoreApi;
import bisq.core.xmr.MoneroNodeSettings;
import bisq.proto.grpc.GetMoneroNodeSettingsReply;
import bisq.proto.grpc.GetMoneroNodeSettingsRequest;
import bisq.proto.grpc.IsMoneroNodeOnlineReply;
import bisq.proto.grpc.IsMoneroNodeOnlineRequest;
import bisq.proto.grpc.MoneroNodeGrpc.MoneroNodeImplBase;
import bisq.proto.grpc.StartMoneroNodeReply;
import bisq.proto.grpc.StartMoneroNodeRequest;
import bisq.proto.grpc.StopMoneroNodeReply;
import bisq.proto.grpc.StopMoneroNodeRequest;
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;
@ -39,15 +40,13 @@ import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static bisq.proto.grpc.MoneroNodeGrpc.getStartMoneroNodeMethod;
import static bisq.proto.grpc.MoneroNodeGrpc.getStopMoneroNodeMethod;
import static bisq.proto.grpc.MoneroNodeGrpc.getIsMoneroNodeOnlineMethod;
import static bisq.proto.grpc.MoneroNodeGrpc.getGetMoneroNodeSettingsMethod;
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 bisq.daemon.grpc.interceptor.CallRateMeteringInterceptor;
import bisq.daemon.grpc.interceptor.GrpcCallRateMeter;
import monero.common.MoneroError;
@Slf4j

View file

@ -1,12 +1,14 @@
package bisq.daemon.grpc;
package haveno.daemon.grpc;
import bisq.core.api.CoreApi;
import bisq.core.api.NotificationListener;
import bisq.proto.grpc.NotificationMessage;
import bisq.proto.grpc.NotificationsGrpc.NotificationsImplBase;
import bisq.proto.grpc.RegisterNotificationListenerRequest;
import bisq.proto.grpc.SendNotificationReply;
import bisq.proto.grpc.SendNotificationRequest;
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.RegisterNotificationListenerRequest;
import haveno.proto.grpc.SendNotificationReply;
import haveno.proto.grpc.SendNotificationRequest;
import io.grpc.Context;
import io.grpc.ServerInterceptor;
import io.grpc.stub.ServerCallStreamObserver;
@ -21,16 +23,11 @@ import lombok.NonNull;
import lombok.Value;
import lombok.extern.slf4j.Slf4j;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static bisq.proto.grpc.NotificationsGrpc.getRegisterNotificationListenerMethod;
import static bisq.proto.grpc.NotificationsGrpc.getSendNotificationMethod;
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;
import bisq.daemon.grpc.interceptor.CallRateMeteringInterceptor;
import bisq.daemon.grpc.interceptor.GrpcCallRateMeter;
@Slf4j
class GrpcNotificationsService extends NotificationsImplBase {

View file

@ -15,24 +15,26 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc;
package haveno.daemon.grpc;
import bisq.core.api.CoreApi;
import bisq.core.api.model.OfferInfo;
import bisq.core.offer.Offer;
import bisq.core.offer.OpenOffer;
import bisq.proto.grpc.CancelOfferReply;
import bisq.proto.grpc.CancelOfferRequest;
import bisq.proto.grpc.PostOfferReply;
import bisq.proto.grpc.PostOfferRequest;
import bisq.proto.grpc.GetMyOfferReply;
import bisq.proto.grpc.GetMyOfferRequest;
import bisq.proto.grpc.GetMyOffersReply;
import bisq.proto.grpc.GetMyOffersRequest;
import bisq.proto.grpc.GetOfferReply;
import bisq.proto.grpc.GetOfferRequest;
import bisq.proto.grpc.GetOffersReply;
import bisq.proto.grpc.GetOffersRequest;
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.GetMyOfferReply;
import haveno.proto.grpc.GetMyOfferRequest;
import haveno.proto.grpc.GetMyOffersReply;
import haveno.proto.grpc.GetMyOffersRequest;
import haveno.proto.grpc.GetOfferReply;
import haveno.proto.grpc.GetOfferRequest;
import haveno.proto.grpc.GetOffersReply;
import haveno.proto.grpc.GetOffersRequest;
import io.grpc.ServerInterceptor;
import io.grpc.stub.StreamObserver;
@ -46,15 +48,10 @@ import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static bisq.proto.grpc.OffersGrpc.*;
import static haveno.proto.grpc.OffersGrpc.*;
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static java.util.concurrent.TimeUnit.SECONDS;
import bisq.daemon.grpc.interceptor.CallRateMeteringInterceptor;
import bisq.daemon.grpc.interceptor.GrpcCallRateMeter;
@Slf4j
class GrpcOffersService extends OffersImplBase {

View file

@ -15,30 +15,32 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc;
package haveno.daemon.grpc;
import bisq.core.api.CoreApi;
import bisq.core.api.model.PaymentAccountForm;
import bisq.core.api.model.PaymentAccountFormField;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.PaymentAccountFactory;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.PaymentMethod;
import bisq.core.proto.CoreProtoResolver;
import bisq.proto.grpc.CreateCryptoCurrencyPaymentAccountReply;
import bisq.proto.grpc.CreateCryptoCurrencyPaymentAccountRequest;
import bisq.proto.grpc.CreatePaymentAccountReply;
import bisq.proto.grpc.CreatePaymentAccountRequest;
import bisq.proto.grpc.GetCryptoCurrencyPaymentMethodsReply;
import bisq.proto.grpc.GetCryptoCurrencyPaymentMethodsRequest;
import bisq.proto.grpc.GetPaymentAccountFormReply;
import bisq.proto.grpc.GetPaymentAccountFormRequest;
import bisq.proto.grpc.GetPaymentAccountsReply;
import bisq.proto.grpc.GetPaymentAccountsRequest;
import bisq.proto.grpc.GetPaymentMethodsReply;
import bisq.proto.grpc.GetPaymentMethodsRequest;
import bisq.proto.grpc.ValidateFormFieldReply;
import bisq.proto.grpc.ValidateFormFieldRequest;
import haveno.proto.grpc.CreateCryptoCurrencyPaymentAccountReply;
import haveno.proto.grpc.CreateCryptoCurrencyPaymentAccountRequest;
import haveno.proto.grpc.CreatePaymentAccountReply;
import haveno.proto.grpc.CreatePaymentAccountRequest;
import haveno.proto.grpc.GetCryptoCurrencyPaymentMethodsReply;
import haveno.proto.grpc.GetCryptoCurrencyPaymentMethodsRequest;
import haveno.proto.grpc.GetPaymentAccountFormReply;
import haveno.proto.grpc.GetPaymentAccountFormRequest;
import haveno.proto.grpc.GetPaymentAccountsReply;
import haveno.proto.grpc.GetPaymentAccountsRequest;
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;
@ -50,15 +52,10 @@ import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static bisq.proto.grpc.PaymentAccountsGrpc.*;
import static haveno.proto.grpc.PaymentAccountsGrpc.*;
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static java.util.concurrent.TimeUnit.SECONDS;
import bisq.daemon.grpc.interceptor.CallRateMeteringInterceptor;
import bisq.daemon.grpc.interceptor.GrpcCallRateMeter;
@Slf4j
class GrpcPaymentAccountsService extends PaymentAccountsImplBase {

View file

@ -15,18 +15,19 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc;
import bisq.core.api.CoreApi;
import bisq.core.api.model.MarketDepthInfo;
import bisq.core.api.model.MarketPriceInfo;
import bisq.proto.grpc.MarketDepthReply;
import bisq.proto.grpc.MarketDepthRequest;
import bisq.proto.grpc.MarketPriceReply;
import bisq.proto.grpc.MarketPriceRequest;
import bisq.proto.grpc.MarketPricesReply;
import bisq.proto.grpc.MarketPricesRequest;
package haveno.daemon.grpc;
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;
@ -38,16 +39,11 @@ import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static bisq.proto.grpc.PriceGrpc.PriceImplBase;
import static bisq.proto.grpc.PriceGrpc.getGetMarketPriceMethod;
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;
import bisq.daemon.grpc.interceptor.CallRateMeteringInterceptor;
import bisq.daemon.grpc.interceptor.GrpcCallRateMeter;
@Slf4j
class GrpcPriceService extends PriceImplBase {

View file

@ -15,12 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc;
import bisq.core.api.CoreContext;
import bisq.common.UserThread;
import bisq.common.config.Config;
package haveno.daemon.grpc;
import io.grpc.Server;
import io.grpc.ServerBuilder;
@ -35,9 +30,10 @@ import lombok.extern.slf4j.Slf4j;
import static io.grpc.ServerInterceptors.interceptForward;
import bisq.daemon.grpc.interceptor.PasswordAuthInterceptor;
import haveno.common.UserThread;
import haveno.common.config.Config;
import haveno.core.api.CoreContext;
import haveno.daemon.grpc.interceptor.PasswordAuthInterceptor;
@Singleton
@Slf4j

View file

@ -15,16 +15,13 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc;
import bisq.core.app.HavenoHeadlessApp;
import bisq.common.UserThread;
import bisq.proto.grpc.ShutdownServerGrpc;
import bisq.proto.grpc.StopReply;
import bisq.proto.grpc.StopRequest;
package haveno.daemon.grpc;
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 javax.inject.Inject;

View file

@ -15,28 +15,29 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc;
package haveno.daemon.grpc;
import bisq.core.api.CoreApi;
import bisq.core.api.model.TradeInfo;
import bisq.core.trade.Trade;
import bisq.proto.grpc.ConfirmPaymentReceivedReply;
import bisq.proto.grpc.ConfirmPaymentReceivedRequest;
import bisq.proto.grpc.ConfirmPaymentSentReply;
import bisq.proto.grpc.ConfirmPaymentSentRequest;
import bisq.proto.grpc.GetChatMessagesReply;
import bisq.proto.grpc.GetChatMessagesRequest;
import bisq.proto.grpc.GetTradeReply;
import bisq.proto.grpc.GetTradeRequest;
import bisq.proto.grpc.GetTradesReply;
import bisq.proto.grpc.GetTradesRequest;
import bisq.proto.grpc.CompleteTradeReply;
import bisq.proto.grpc.CompleteTradeRequest;
import bisq.proto.grpc.SendChatMessageReply;
import bisq.proto.grpc.SendChatMessageRequest;
import bisq.proto.grpc.TakeOfferReply;
import bisq.proto.grpc.TakeOfferRequest;
import haveno.proto.grpc.ConfirmPaymentReceivedReply;
import haveno.proto.grpc.ConfirmPaymentReceivedRequest;
import haveno.proto.grpc.ConfirmPaymentSentReply;
import haveno.proto.grpc.ConfirmPaymentSentRequest;
import haveno.proto.grpc.GetChatMessagesReply;
import haveno.proto.grpc.GetChatMessagesRequest;
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;
@ -48,17 +49,12 @@ import java.util.Optional;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import static bisq.core.api.model.TradeInfo.toTradeInfo;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static bisq.proto.grpc.TradesGrpc.*;
import static haveno.proto.grpc.TradesGrpc.*;
import static haveno.core.api.model.TradeInfo.toTradeInfo;
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static java.util.concurrent.TimeUnit.MINUTES;
import static java.util.concurrent.TimeUnit.SECONDS;
import bisq.daemon.grpc.interceptor.CallRateMeteringInterceptor;
import bisq.daemon.grpc.interceptor.GrpcCallRateMeter;
@Slf4j
class GrpcTradesService extends TradesImplBase {

View file

@ -15,12 +15,10 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc;
package haveno.daemon.grpc;
import bisq.core.api.CoreApi;
import bisq.proto.grpc.GetVersionReply;
import bisq.proto.grpc.GetVersionRequest;
import haveno.proto.grpc.GetVersionReply;
import haveno.proto.grpc.GetVersionRequest;
import io.grpc.ServerInterceptor;
import io.grpc.stub.StreamObserver;
@ -28,22 +26,19 @@ 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 java.util.HashMap;
import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static bisq.proto.grpc.GetVersionGrpc.GetVersionImplBase;
import static bisq.proto.grpc.GetVersionGrpc.getGetVersionMethod;
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;
import bisq.daemon.grpc.interceptor.CallRateMeteringInterceptor;
import bisq.daemon.grpc.interceptor.GrpcCallRateMeter;
@VisibleForTesting
@Slf4j
public class GrpcVersionService extends GetVersionImplBase {

View file

@ -15,39 +15,35 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc;
package haveno.daemon.grpc;
import bisq.common.UserThread;
import bisq.core.api.CoreApi;
import bisq.core.api.model.AddressBalanceInfo;
import bisq.proto.grpc.GetAddressBalanceReply;
import bisq.proto.grpc.GetAddressBalanceRequest;
import bisq.proto.grpc.GetBalancesReply;
import bisq.proto.grpc.GetBalancesRequest;
import bisq.proto.grpc.GetFundingAddressesReply;
import bisq.proto.grpc.GetFundingAddressesRequest;
import bisq.proto.grpc.GetXmrNewSubaddressRequest;
import bisq.proto.grpc.GetXmrPrimaryAddressReply;
import bisq.proto.grpc.GetXmrPrimaryAddressRequest;
import bisq.proto.grpc.GetXmrNewSubaddressReply;
import bisq.proto.grpc.GetXmrTxsRequest;
import bisq.proto.grpc.GetXmrTxsReply;
import bisq.proto.grpc.CreateXmrTxRequest;
import bisq.proto.grpc.CreateXmrTxReply;
import bisq.proto.grpc.RelayXmrTxRequest;
import bisq.proto.grpc.RelayXmrTxReply;
import bisq.proto.grpc.GetXmrSeedReply;
import bisq.proto.grpc.GetXmrSeedRequest;
import bisq.proto.grpc.LockWalletReply;
import bisq.proto.grpc.LockWalletRequest;
import bisq.proto.grpc.RemoveWalletPasswordReply;
import bisq.proto.grpc.RemoveWalletPasswordRequest;
import bisq.proto.grpc.SendBtcRequest;
import bisq.proto.grpc.SetWalletPasswordReply;
import bisq.proto.grpc.SetWalletPasswordRequest;
import bisq.proto.grpc.UnlockWalletReply;
import bisq.proto.grpc.UnlockWalletRequest;
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.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.LockWalletReply;
import haveno.proto.grpc.LockWalletRequest;
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;
@ -57,7 +53,11 @@ import org.bitcoinj.core.Transaction;
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;
@ -69,16 +69,12 @@ import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import static bisq.core.api.model.XmrTx.toXmrTx;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static bisq.proto.grpc.WalletsGrpc.*;
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 java.util.concurrent.TimeUnit.SECONDS;
import bisq.daemon.grpc.interceptor.CallRateMeteringInterceptor;
import bisq.daemon.grpc.interceptor.GrpcCallRateMeter;
import monero.wallet.model.MoneroDestination;
import monero.wallet.model.MoneroTxWallet;

View file

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc.interceptor;
package haveno.daemon.grpc.interceptor;
import io.grpc.Metadata;
import io.grpc.ServerCall;
@ -93,7 +93,7 @@ public final class CallRateMeteringInterceptor implements ServerInterceptor {
// The derived method name may not be an exact match to CLI's method name.
String timeUnitName = StringUtils.chop(rateMeter.getTimeUnit().name().toLowerCase());
// Just print 'getversion', not the grpc method descriptor's
// full-method-name: 'io.bisq.protobuffer.getversion/getversion'.
// full-method-name: 'io.haveno.protobuffer.getversion/getversion'.
String loggedMethodName = methodName.split("/")[1];
return format("The maximum allowed number of %s calls (%d/%s) has been exceeded",
loggedMethodName,
@ -109,7 +109,7 @@ public final class CallRateMeteringInterceptor implements ServerInterceptor {
private String getRateMeterKey(ServerCall<?, ?> serverCall) {
// Get the rate meter map key from the server call method descriptor. The
// returned String (e.g., 'io.bisq.protobuffer.Offers/CreateOffer') will match
// returned String (e.g., 'io.haveno.protobuffer.Offers/CreateOffer') will match
// a map entry key in the 'serviceCallRateMeters' constructor argument, if it
// was defined in the Grpc*Service class' rateMeteringInterceptor method.
return serverCall.getMethodDescriptor().getFullMethodName();

View file

@ -1,4 +1,4 @@
package bisq.daemon.grpc.interceptor;
package haveno.daemon.grpc.interceptor;
import org.apache.commons.lang3.StringUtils;
@ -61,7 +61,7 @@ public class GrpcCallRateMeter {
synchronized (callTimestamps) {
String shortTimeUnitName = StringUtils.chop(timeUnit.name().toLowerCase());
// Just print 'GetVersion has been called N times...',
// not 'io.bisq.protobuffer.GetVersion/GetVersion has been called N times...'
// not 'io.haveno.protobuffer.GetVersion/GetVersion has been called N times...'
String loggedMethodName = calledMethodName.split("/")[1];
return format("%s has been called %d time%s in the last %s, rate limit is %d/%s",
loggedMethodName,

View file

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc.interceptor;
package haveno.daemon.grpc.interceptor;
import io.grpc.ServerInterceptor;
@ -41,9 +41,9 @@ import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j;
import static bisq.common.file.FileUtil.deleteFileIfExists;
import static bisq.common.file.FileUtil.renameFile;
import static com.google.common.base.Preconditions.checkNotNull;
import static haveno.common.file.FileUtil.deleteFileIfExists;
import static haveno.common.file.FileUtil.renameFile;
import static java.lang.String.format;
import static java.lang.System.getProperty;
import static java.nio.charset.StandardCharsets.UTF_8;

View file

@ -15,9 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc.interceptor;
import bisq.common.config.Config;
package haveno.daemon.grpc.interceptor;
import io.grpc.Metadata;
import io.grpc.ServerCall;
@ -32,11 +30,13 @@ 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.
*
* @see bisq.common.config.Config#apiPassword
* @see haveno.common.config.Config#apiPassword
*/
public class PasswordAuthInterceptor implements ServerInterceptor {

View file

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.daemon.grpc.interceptor;
package haveno.daemon.grpc.interceptor;
import io.grpc.ServerInterceptor;
@ -33,7 +33,7 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
import static java.lang.System.getProperty;
import static java.util.concurrent.TimeUnit.DAYS;
import static java.util.concurrent.TimeUnit.HOURS;
@ -44,9 +44,10 @@ 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 bisq.daemon.grpc.GrpcVersionService;
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 {