From 29727113a5e4fb55a63676d982e1c3630b7a05d6 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Sat, 9 Feb 2013 14:18:00 +0100 Subject: [PATCH] Support ID based construction of unit test network params. Fixes an issue in the serializer tests. --- .../com/google/bitcoin/core/NetworkParameters.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/google/bitcoin/core/NetworkParameters.java b/core/src/main/java/com/google/bitcoin/core/NetworkParameters.java index b11caf875..e1d9c7ca5 100644 --- a/core/src/main/java/com/google/bitcoin/core/NetworkParameters.java +++ b/core/src/main/java/com/google/bitcoin/core/NetworkParameters.java @@ -48,14 +48,12 @@ public class NetworkParameters implements Serializable { */ public static final byte[] SATOSHI_KEY = Hex.decode("04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284"); - /** - * The string returned by getId() for the main, production network where people trade things. - */ + /** The string returned by getId() for the main, production network where people trade things. */ public static final String ID_PRODNET = "org.bitcoin.production"; - /** - * The string returned by getId() for the testnet. - */ + /** The string returned by getId() for the testnet. */ public static final String ID_TESTNET = "org.bitcoin.test"; + /** Unit test network. */ + static final String ID_UNITTESTNET = "com.google.bitcoin.unittest"; // TODO: Seed nodes should be here as well. @@ -320,6 +318,8 @@ public class NetworkParameters implements Serializable { return prodNet(); } else if (id.equals(ID_TESTNET)) { return testNet(); + } else if (id.equals(ID_UNITTESTNET)) { + return unitTests(); } else { return null; }