mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Fix tests
This commit is contained in:
parent
2f291a6acb
commit
9e4e800cb6
@ -28,6 +28,8 @@ import bisq.common.util.Utilities;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
import java.security.PublicKey;
|
||||
|
||||
import java.util.List;
|
||||
@ -176,27 +178,28 @@ public final class Filter implements ProtectedStoragePayload, ExpirablePayload {
|
||||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private Filter(List<String> bannedOfferIds,
|
||||
List<String> bannedNodeAddress,
|
||||
List<PaymentAccountFilter> bannedPaymentAccounts,
|
||||
List<String> bannedCurrencies,
|
||||
List<String> bannedPaymentMethods,
|
||||
List<String> arbitrators,
|
||||
List<String> seedNodes,
|
||||
List<String> priceRelayNodes,
|
||||
boolean preventPublicBtcNetwork,
|
||||
List<String> btcNodes,
|
||||
boolean disableDao,
|
||||
String disableDaoBelowVersion,
|
||||
String disableTradeBelowVersion,
|
||||
List<String> mediators,
|
||||
List<String> refundAgents,
|
||||
List<String> bannedSignerPubKeys,
|
||||
List<String> btcFeeReceiverAddresses,
|
||||
byte[] ownerPubKeyBytes,
|
||||
long creationDate,
|
||||
@Nullable Map<String, String> extraDataMap,
|
||||
@Nullable String signatureAsBase64) {
|
||||
@VisibleForTesting
|
||||
public Filter(List<String> bannedOfferIds,
|
||||
List<String> bannedNodeAddress,
|
||||
List<PaymentAccountFilter> bannedPaymentAccounts,
|
||||
List<String> bannedCurrencies,
|
||||
List<String> bannedPaymentMethods,
|
||||
List<String> arbitrators,
|
||||
List<String> seedNodes,
|
||||
List<String> priceRelayNodes,
|
||||
boolean preventPublicBtcNetwork,
|
||||
List<String> btcNodes,
|
||||
boolean disableDao,
|
||||
String disableDaoBelowVersion,
|
||||
String disableTradeBelowVersion,
|
||||
List<String> mediators,
|
||||
List<String> refundAgents,
|
||||
List<String> bannedSignerPubKeys,
|
||||
List<String> btcFeeReceiverAddresses,
|
||||
byte[] ownerPubKeyBytes,
|
||||
long creationDate,
|
||||
@Nullable Map<String, String> extraDataMap,
|
||||
@Nullable String signatureAsBase64) {
|
||||
this.bannedOfferIds = bannedOfferIds;
|
||||
this.bannedNodeAddress = bannedNodeAddress;
|
||||
this.bannedPaymentAccounts = bannedPaymentAccounts;
|
||||
@ -219,7 +222,12 @@ public final class Filter implements ProtectedStoragePayload, ExpirablePayload {
|
||||
this.extraDataMap = ExtraDataMapValidator.getValidatedExtraDataMap(extraDataMap);
|
||||
this.signatureAsBase64 = signatureAsBase64;
|
||||
|
||||
ownerPubKey = Sig.getPublicKeyFromBytes(ownerPubKeyBytes);
|
||||
// ownerPubKeyBytes can be null when called from tests
|
||||
if (ownerPubKeyBytes != null) {
|
||||
ownerPubKey = Sig.getPublicKeyFromBytes(ownerPubKeyBytes);
|
||||
} else {
|
||||
ownerPubKey = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -53,13 +53,15 @@ public class UserPayloadModelVOTest {
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
"string",
|
||||
new byte[]{10, 0, 0},
|
||||
Lists.newArrayList(),
|
||||
Lists.newArrayList(),
|
||||
Lists.newArrayList(),
|
||||
Lists.newArrayList(),
|
||||
null,
|
||||
Lists.newArrayList(),
|
||||
Lists.newArrayList(),
|
||||
Lists.newArrayList(),
|
||||
Lists.newArrayList()));
|
||||
0,
|
||||
null,
|
||||
null));
|
||||
|
||||
vo.setRegisteredArbitrator(ArbitratorTest.getArbitratorMock());
|
||||
vo.setRegisteredMediator(MediatorTest.getMediatorMock());
|
||||
vo.setAcceptedArbitrators(Lists.newArrayList(ArbitratorTest.getArbitratorMock()));
|
||||
|
@ -22,6 +22,7 @@ import bisq.core.dao.governance.param.Param;
|
||||
import bisq.core.filter.Filter;
|
||||
import bisq.core.filter.FilterManager;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.primitives.Longs;
|
||||
|
||||
import java.util.HashMap;
|
||||
@ -98,10 +99,26 @@ public class FeeReceiverSelectorTest {
|
||||
}
|
||||
|
||||
private static Filter filterWithReceivers(List<String> btcFeeReceiverAddresses) {
|
||||
return new Filter(null, null, null, null,
|
||||
null, null, null, null,
|
||||
false, null, false, null,
|
||||
null, null, null, null,
|
||||
btcFeeReceiverAddresses);
|
||||
return new Filter(Lists.newArrayList(),
|
||||
Lists.newArrayList(),
|
||||
Lists.newArrayList(),
|
||||
Lists.newArrayList(),
|
||||
Lists.newArrayList(),
|
||||
Lists.newArrayList(),
|
||||
Lists.newArrayList(),
|
||||
Lists.newArrayList(),
|
||||
false,
|
||||
Lists.newArrayList(),
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
Lists.newArrayList(),
|
||||
Lists.newArrayList(),
|
||||
Lists.newArrayList(),
|
||||
btcFeeReceiverAddresses,
|
||||
null,
|
||||
0,
|
||||
null,
|
||||
null);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user