Add supportsDirectContact to preferences and offerPayload

This commit is contained in:
Manfred Karrer 2017-06-22 19:56:27 +02:00
parent 8647d9f1b4
commit 46cc8f57ac
8 changed files with 27 additions and 12 deletions

View File

@ -502,14 +502,15 @@ message OfferPayload {
int64 seller_security_deposit = 28;
int64 max_trade_limit = 29;
int64 max_trade_period = 30;
bool use_auto_close = 31;
bool use_re_open_after_auto_close = 32;
int64 lower_close_price = 33;
int64 upper_close_price = 34;
bool is_private_offer = 35;
string hash_of_challenge = 36;
map<string, string> extra_data = 37;
int32 protocol_version = 38;
bool supportsDirectContact = 31;
bool use_auto_close = 32;
bool use_re_open_after_auto_close = 33;
int64 lower_close_price = 34;
int64 upper_close_price = 35;
bool is_private_offer = 36;
string hash_of_challenge = 37;
map<string, string> extra_data = 38;
int32 protocol_version = 39;
}
// TODO not fully verified as impl. is not completed
@ -1100,6 +1101,7 @@ message PreferencesPayload {
bool use_animations = 31;
PaymentAccount selectedPayment_account_for_createOffer = 32;
bool pay_fee_in_Btc = 33;
bool supportsDirectContact = 34;
}

View File

@ -170,8 +170,8 @@ public class BsqChainState implements PersistableEnvelope, Serializable {
genesisTxId = LTC_REG_TEST_GENESIS_TX_ID;
genesisBlockHeight = LTC_REG_TEST_GENESIS_BLOCK_HEIGHT;
break;
case LTC_MAINNET:
default:
// LTC_MAINNET:
genesisTxId = LTC_GENESIS_TX_ID;
genesisBlockHeight = LTC_GENESIS_BLOCK_HEIGHT;
break;

View File

@ -116,6 +116,7 @@ public final class OfferPayload implements StoragePayload, RequiresOwnerIsOnline
private final long sellerSecurityDeposit;
private final long maxTradeLimit;
private final long maxTradePeriod;
private final boolean supportsDirectContact;
// reserved for future use cases
// Close offer when certain price is reached
@ -173,6 +174,7 @@ public final class OfferPayload implements StoragePayload, RequiresOwnerIsOnline
long sellerSecurityDeposit,
long maxTradeLimit,
long maxTradePeriod,
boolean supportsDirectContact,
boolean useAutoClose,
boolean useReOpenAfterAutoClose,
long lowerClosePrice,
@ -211,6 +213,7 @@ public final class OfferPayload implements StoragePayload, RequiresOwnerIsOnline
this.sellerSecurityDeposit = sellerSecurityDeposit;
this.maxTradeLimit = maxTradeLimit;
this.maxTradePeriod = maxTradePeriod;
this.supportsDirectContact = supportsDirectContact;
this.useAutoClose = useAutoClose;
this.useReOpenAfterAutoClose = useReOpenAfterAutoClose;
this.lowerClosePrice = lowerClosePrice;
@ -257,6 +260,7 @@ public final class OfferPayload implements StoragePayload, RequiresOwnerIsOnline
.setSellerSecurityDeposit(sellerSecurityDeposit)
.setMaxTradeLimit(maxTradeLimit)
.setMaxTradePeriod(maxTradePeriod)
.setSupportsDirectContact(supportsDirectContact)
.setUseAutoClose(useAutoClose)
.setUseReOpenAfterAutoClose(useReOpenAfterAutoClose)
.setLowerClosePrice(lowerClosePrice)
@ -320,6 +324,7 @@ public final class OfferPayload implements StoragePayload, RequiresOwnerIsOnline
proto.getSellerSecurityDeposit(),
proto.getMaxTradeLimit(),
proto.getMaxTradePeriod(),
proto.getSupportsDirectContact(),
proto.getUseAutoClose(),
proto.getUseReOpenAfterAutoClose(),
proto.getLowerClosePrice(),

View File

@ -163,7 +163,8 @@ public final class PaymentMethod implements PersistablePayload, Comparable {
INTERAC_E_TRANSFER = new PaymentMethod(INTERAC_E_TRANSFER_ID, DAY, maxTradeLimitMidRisk),
// US
// CLEAR_X_CHANGE = new PaymentMethod(CLEAR_X_CHANGE_ID, 4 * DAY, maxTradeLimitMidRisk),
// CXC is to risky regarding chargeback
// CLEAR_X_CHANGE = new PaymentMethod(CLEAR_X_CHANGE_ID, 4 * DAY, maxTradeLimitMidRisk),
CHASE_QUICK_PAY = new PaymentMethod(CHASE_QUICK_PAY_ID, DAY, maxTradeLimitMidRisk),
US_POSTAL_MONEY_ORDER = new PaymentMethod(US_POSTAL_MONEY_ORDER_ID, 8 * DAY, maxTradeLimitMidRisk),

View File

@ -67,6 +67,7 @@ public final class PreferencesPayload implements PersistableEnvelope {
@Nullable
private PaymentAccount selectedPaymentAccountForCreateOffer;
private boolean payFeeInBtc = true;
private boolean supportsDirectContact = true;
///////////////////////////////////////////////////////////////////////////////////////////
@ -113,7 +114,8 @@ public final class PreferencesPayload implements PersistableEnvelope {
.setDirectoryChooserPath(directoryChooserPath)
.setBuyerSecurityDepositAsLong(buyerSecurityDepositAsLong)
.setUseAnimations(useAnimations)
.setPayFeeInBtc(payFeeInBtc);
.setPayFeeInBtc(payFeeInBtc)
.setSupportsDirectContact(supportsDirectContact);
Optional.ofNullable(backupDirectory).ifPresent(builder::setBackupDirectory);
Optional.ofNullable(preferredTradeCurrency).ifPresent(e -> builder.setPreferredTradeCurrency((PB.TradeCurrency) e.toProtoMessage()));
@ -171,6 +173,7 @@ public final class PreferencesPayload implements PersistableEnvelope {
proto.getBuyerSecurityDepositAsLong(),
proto.getUseAnimations(),
paymentAccount,
proto.getPayFeeInBtc());
proto.getPayFeeInBtc(),
proto.getSupportsDirectContact());
}
}

View File

@ -336,6 +336,7 @@ class CreateOfferDataModel extends ActivatableDataModel {
// reserved for future use cases
// Use null values if not set
boolean supportsDirectContact = true;
boolean isPrivateOffer = false;
boolean useAutoClose = false;
boolean useReOpenAfterAutoClose = false;
@ -382,6 +383,7 @@ class CreateOfferDataModel extends ActivatableDataModel {
sellerSecurityDeposit.value,
maxTradeLimit,
maxTradePeriod,
supportsDirectContact,
useAutoClose,
useReOpenAfterAutoClose,
upperClosePrice,

View File

@ -71,6 +71,7 @@ public class TradesChartsViewModelTest {
0,
false,
false,
false,
0,
0,
false,

View File

@ -297,6 +297,7 @@ public class OfferBookViewModelTest {
0,
false,
false,
false,
0,
0,
false,