3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-11 17:55:53 +00:00

Give unit test params a payment protocol ID.

This commit is contained in:
Mike Hearn 2015-01-07 16:44:10 +01:00
parent 0b5b101343
commit e09e383007
2 changed files with 5 additions and 1 deletions

View File

@ -62,6 +62,8 @@ public abstract class NetworkParameters implements Serializable {
public static final String PAYMENT_PROTOCOL_ID_MAINNET = "main";
/** The string used by the payment protocol to represent the test net. */
public static final String PAYMENT_PROTOCOL_ID_TESTNET = "test";
/** The string used by the payment protocol to represent unit testing (note that this is non-standard). */
public static final String PAYMENT_PROTOCOL_ID_UNIT_TESTS = "unittest";
// TODO: Seed nodes should be here as well.
@ -224,6 +226,8 @@ public abstract class NetworkParameters implements Serializable {
return MainNetParams.get();
} else if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_TESTNET)) {
return TestNet3Params.get();
} else if (pmtProtocolId.equals(PAYMENT_PROTOCOL_ID_UNIT_TESTS)) {
return UnitTestParams.get();
} else {
return null;
}

View File

@ -58,6 +58,6 @@ public class UnitTestParams extends NetworkParameters {
@Override
public String getPaymentProtocolId() {
return null;
return "unittest";
}
}