NameTransactionUtils { public static String getNameValueAsString(Transaction tx, String name) throws UnsupportedEncodingException { NameScript ns = getNameAnyUpdateScript(tx, name); if (ns == null) { return null; } return new String(ns.getOpValue().data, "ISO-8859-1"); }  static TransactionOutput getNameAnyUpdateOutput(Transaction tx, String name); static NameScript getNameAnyUpdateScript(Transaction tx, String name); static String getNameValueAsString(Transaction tx, String name);  }
@Test public void nameNewGetValueAsString() throws IOException { final Transaction tx = getNameNewTransaction(); assertNull(NameTransactionUtils.getNameValueAsString(tx, "d/bitcoin")); assertNull(NameTransactionUtils.getNameValueAsString(tx, "wrongname")); }
@Test public void nameFirstUpdateGetValueAsString() throws IOException { final Transaction tx = getNameFirstUpdateTransaction(); assertEquals("webpagedeveloper.me/namecoin", NameTransactionUtils.getNameValueAsString(tx, "d/bitcoin")); assertNull(NameTransactionUtils.getNameValueAsString(tx, "wrongname")); }
@Test public void nameUpdateGetValueAsString() throws IOException { final Transaction tx = getNameUpdateTransaction(); assertEquals("{\"info\":{\"registrar\":\"http: assertNull(NameTransactionUtils.getNameValueAsString(tx, "wrongname")); }
@Test public void currencyGetValueAsString() throws IOException { final Transaction tx = getCurrencyTransaction(); assertNull(NameTransactionUtils.getNameValueAsString(tx, "d/bitcoin")); assertNull(NameTransactionUtils.getNameValueAsString(tx, "wrongname")); }