Refactor models for taker

This commit is contained in:
Manfred Karrer 2015-03-17 22:58:23 +01:00
parent 74c085cb03
commit 276bbb2219
7 changed files with 6 additions and 10 deletions

View File

@ -36,7 +36,7 @@ public class CheckOfferAvailabilityProtocol {
private final CheckOfferAvailabilityModel model;
private final ResultHandler resultHandler;
private ErrorMessageHandler errorMessageHandler;
private final ErrorMessageHandler errorMessageHandler;
private final MessageHandler messageHandler;
private boolean isCanceled;

View File

@ -45,7 +45,7 @@ public class OfferSharedModel extends SharedModel {
private final WalletService walletService;
private final BlockChainService blockChainService;
private final SignatureService signatureService;
private Persistence persistence;
private final Persistence persistence;
// derived

View File

@ -53,7 +53,7 @@ import static io.bitsquare.util.Validator.nonEmptyStringOf;
public class SellerAsTakerProtocol {
private static final Logger log = LoggerFactory.getLogger(SellerAsTakerProtocol.class);
public static final int TIMEOUT_DELAY = 10000;
private static final int TIMEOUT_DELAY = 10000;
private final SellerAsTakerModel model;
private final MessageHandler messageHandler;

View File

@ -30,7 +30,7 @@ public class OffererModel {
this.peer = peer;
}
public Peer peer;
public final Peer peer;
public byte[] pubKey;
public Coin payoutAmount;
public String payoutAddress;

View File

@ -89,10 +89,6 @@ public class SellerAsTakerModel extends OfferSharedModel {
this.takeOfferFeeTx = takeOfferFeeTx;
}
public void setDepositTx(Transaction transaction) {
}
public Transaction getPayoutTx() {
return payoutTx;
}

View File

@ -25,7 +25,7 @@ import org.bitcoinj.core.TransactionOutput;
import java.util.List;
public class TakerModel {
class TakerModel {
public List<TransactionOutput> connectedOutputsForAllInputs;
public List<TransactionOutput> outputs;

View File

@ -43,7 +43,7 @@ public class ProcessBankTransferStartedMessage extends Task<SellerAsTakerModel>
checkTradeId(model.getId(), model.getTradeMessage());
BankTransferStartedMessage message = (BankTransferStartedMessage) model.getTradeMessage();
model.setDepositTx(checkNotNull(message.getDepositTx()));
model.setPublishedDepositTx(checkNotNull(message.getDepositTx()));
model.offerer.signature = checkNotNull(ECKey.ECDSASignature.decodeFromDER(message.getOffererSignature()));
model.offerer.payoutAmount = positiveCoinOf(nonZeroCoinOf(message.getOffererPayoutAmount()));
model.taker.payoutAmount = positiveCoinOf(nonZeroCoinOf(message.getTakerPayoutAmount()));