PaymentProtocolTest: use TestNet3Params, rather than UnitTestParams
@@ -29,7 +29,6 @@ import org.bitcoinj.core.Transaction;
import org.bitcoinj.core.Utils;
import org.bitcoinj.crypto.X509Utils;
import org.bitcoinj.params.TestNet3Params;
-import org.bitcoinj.params.UnitTestParams;
import org.bitcoinj.protocols.payments.PaymentProtocol.Output;
import org.bitcoinj.protocols.payments.PaymentProtocol.PkiVerificationData;
import org.bitcoinj.protocols.payments.PaymentProtocolException.PkiVerificationException;
@@ -49,12 +48,11 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class PaymentProtocolTest {
- private static final NetworkParameters UNITTEST = UnitTestParams.get();
private static final NetworkParameters TESTNET = TestNet3Params.get();
// static test data
private static final Coin AMOUNT = Coin.SATOSHI;
- private static final Address TO_ADDRESS = LegacyAddress.fromKey(UNITTEST, new ECKey());
+ private static final Address TO_ADDRESS = LegacyAddress.fromKey(TESTNET, new ECKey());
private static final String MEMO = "memo";
private static final String PAYMENT_URL = "https://example.com";
private static final byte[] MERCHANT_DATA = { 0, 1, 2 };
@@ -131,16 +129,16 @@ public class PaymentProtocolTest {
public void testPaymentMessage() throws Exception {
// Create
List<Transaction> transactions = new LinkedList<>();
- transactions.add(FakeTxBuilder.createFakeTx(UNITTEST, AMOUNT, TO_ADDRESS));
+ transactions.add(FakeTxBuilder.createFakeTx(TESTNET, AMOUNT, TO_ADDRESS));
Coin refundAmount = Coin.SATOSHI;
- Address refundAddress = LegacyAddress.fromKey(UNITTEST, new ECKey());
+ Address refundAddress = LegacyAddress.fromKey(TESTNET, new ECKey());
Payment payment = PaymentProtocol.createPaymentMessage(transactions, refundAmount, refundAddress, MEMO,
MERCHANT_DATA);
byte[] paymentBytes = payment.toByteArray();
// Parse
Payment parsedPayment = Payment.parseFrom(paymentBytes);
- List<Transaction> parsedTransactions = PaymentProtocol.parseTransactionsFromPaymentMessage(UNITTEST,
+ List<Transaction> parsedTransactions = PaymentProtocol.parseTransactionsFromPaymentMessage(TESTNET,
parsedPayment);
assertEquals(transactions, parsedTransactions);
assertEquals(1, parsedPayment.getRefundToCount());
