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 CheckOfferAvailabilityModel model;
private final ResultHandler resultHandler; private final ResultHandler resultHandler;
private ErrorMessageHandler errorMessageHandler; private final ErrorMessageHandler errorMessageHandler;
private final MessageHandler messageHandler; private final MessageHandler messageHandler;
private boolean isCanceled; private boolean isCanceled;

View file

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

View file

@ -53,7 +53,7 @@ import static io.bitsquare.util.Validator.nonEmptyStringOf;
public class SellerAsTakerProtocol { public class SellerAsTakerProtocol {
private static final Logger log = LoggerFactory.getLogger(SellerAsTakerProtocol.class); 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 SellerAsTakerModel model;
private final MessageHandler messageHandler; private final MessageHandler messageHandler;

View file

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

View file

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

View file

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

View file

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