NameScript { public Script getAddress() { return address; } NameScript(Script baseScript); boolean isNameOp(); Script getAddress(); boolean isAnyUpdate(); ScriptChunk getOpName(); ScriptChunk getOpValue(); static final int OP_NAME_NEW; static final int OP_NAME_FIRSTUPDATE; static final int OP_NAME_UPDATE; }
@Test public void nameFirstUpdateGetAddress() throws IOException { final NameScript ns = getNameFirstUpdateNameScript(); assertEquals("NGcTVLgw6cgdavaE7C9QvWaY7gKiWbLrjP", ns.getAddress().getToAddress(params).toString()); }
@Test public void nameUpdateGetAddress() throws IOException { final NameScript ns = getNameUpdateNameScript(); assertEquals("N9dLs1zHRfZr5cJNjSrvhWrrUcmNSthdmz", ns.getAddress().getToAddress(params).toString()); }
@Test public void currencyGetAddress() throws IOException { final NameScript ns = getCurrencyNameScript(); assertEquals("NCMmrGC7uaJ3uv8feLgBTtwGLQSWfmxMCk", ns.getAddress().getToAddress(params).toString()); }
@Test public void returnGetAddress() throws IOException { final NameScript ns = getReturnNameScript(); expectedEx.expect(org.bitcoinj.core.ScriptException.class); expectedEx.expectMessage("Cannot cast this script to a pay-to-address type"); ns.getAddress().getToAddress(params).toString(); }
@Test public void nameNewGetAddress() throws IOException { final NameScript ns = getNameNewNameScript(); assertEquals("MyVbKbD4MYNUMEpdNAm3Jd3nbr5t8djALC", ns.getAddress().getToAddress(params).toString()); }