target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 31 126k | src_fm_fc_ms_ff stringlengths 32 126k |
|---|---|---|---|---|---|
@Test public void reset() { sendMoneyToWallet(AbstractBlockChain.NewBlockType.BEST_CHAIN, COIN, myAddress); assertNotEquals(Coin.ZERO, wallet.getBalance(Wallet.BalanceType.ESTIMATED)); assertNotEquals(0, wallet.getTransactions(false).size()); assertNotEquals(0, wallet.getUnspents().size()); wallet.reset(); assertEquals... | public void reset() { lock.lock(); try { clearTransactions(); lastBlockSeenHash = null; lastBlockSeenHeight = -1; lastBlockSeenTimeSecs = 0; saveLater(); maybeQueueOnWalletChanged(); } finally { lock.unlock(); } } | Wallet extends BaseTaggableObject implements NewBestBlockListener, TransactionReceivedInBlockListener, PeerFilterProvider, KeyBag, TransactionBag, ReorganizeListener { public void reset() { lock.lock(); try { clearTransactions(); lastBlockSeenHash = null; lastBlockSeenHeight = -1; lastBlockSeenTimeSecs = 0; saveLater()... | Wallet extends BaseTaggableObject implements NewBestBlockListener, TransactionReceivedInBlockListener, PeerFilterProvider, KeyBag, TransactionBag, ReorganizeListener { public void reset() { lock.lock(); try { clearTransactions(); lastBlockSeenHash = null; lastBlockSeenHeight = -1; lastBlockSeenTimeSecs = 0; saveLater()... | Wallet extends BaseTaggableObject implements NewBestBlockListener, TransactionReceivedInBlockListener, PeerFilterProvider, KeyBag, TransactionBag, ReorganizeListener { public void reset() { lock.lock(); try { clearTransactions(); lastBlockSeenHash = null; lastBlockSeenHeight = -1; lastBlockSeenTimeSecs = 0; saveLater()... | Wallet extends BaseTaggableObject implements NewBestBlockListener, TransactionReceivedInBlockListener, PeerFilterProvider, KeyBag, TransactionBag, ReorganizeListener { public void reset() { lock.lock(); try { clearTransactions(); lastBlockSeenHash = null; lastBlockSeenHeight = -1; lastBlockSeenTimeSecs = 0; saveLater()... |
@Test public void getKeys() throws Exception { chain.getKey(KeyChain.KeyPurpose.RECEIVE_FUNDS); chain.getKey(KeyChain.KeyPurpose.CHANGE); chain.maybeLookAhead(); assertEquals(2, chain.getKeys(false).size()); } | @Override public List<DeterministicKey> getKeys(KeyPurpose purpose, int numberOfKeys) { checkArgument(numberOfKeys > 0); lock.lock(); try { DeterministicKey parentKey; int index; switch (purpose) { case RECEIVE_FUNDS: case REFUND: issuedExternalKeys += numberOfKeys; index = issuedExternalKeys; parentKey = externalParen... | DeterministicKeyChain implements EncryptableKeyChain { @Override public List<DeterministicKey> getKeys(KeyPurpose purpose, int numberOfKeys) { checkArgument(numberOfKeys > 0); lock.lock(); try { DeterministicKey parentKey; int index; switch (purpose) { case RECEIVE_FUNDS: case REFUND: issuedExternalKeys += numberOfKeys... | DeterministicKeyChain implements EncryptableKeyChain { @Override public List<DeterministicKey> getKeys(KeyPurpose purpose, int numberOfKeys) { checkArgument(numberOfKeys > 0); lock.lock(); try { DeterministicKey parentKey; int index; switch (purpose) { case RECEIVE_FUNDS: case REFUND: issuedExternalKeys += numberOfKeys... | DeterministicKeyChain implements EncryptableKeyChain { @Override public List<DeterministicKey> getKeys(KeyPurpose purpose, int numberOfKeys) { checkArgument(numberOfKeys > 0); lock.lock(); try { DeterministicKey parentKey; int index; switch (purpose) { case RECEIVE_FUNDS: case REFUND: issuedExternalKeys += numberOfKeys... | DeterministicKeyChain implements EncryptableKeyChain { @Override public List<DeterministicKey> getKeys(KeyPurpose purpose, int numberOfKeys) { checkArgument(numberOfKeys > 0); lock.lock(); try { DeterministicKey parentKey; int index; switch (purpose) { case RECEIVE_FUNDS: case REFUND: issuedExternalKeys += numberOfKeys... |
@Test public void selfCreatedAreNotRisky() { Transaction tx = new Transaction(PARAMS); tx.addInput(PARAMS.getGenesisBlock().getTransactions().get(0).getOutput(0)).setSequenceNumber(1); tx.addOutput(COIN, key1); tx.setLockTime(TIMESTAMP + 86400); { DefaultRiskAnalysis analysis = DefaultRiskAnalysis.FACTORY.create(wallet... | @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } | DefaultRiskAnalysis implements RiskAnalysis { @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } } | DefaultRiskAnalysis implements RiskAnalysis { @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } private DefaultRiskAnalysis(Wallet wallet, Transaction tx, List<Transaction... | DefaultRiskAnalysis implements RiskAnalysis { @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } private DefaultRiskAnalysis(Wallet wallet, Transaction tx, List<Transaction... | DefaultRiskAnalysis implements RiskAnalysis { @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } private DefaultRiskAnalysis(Wallet wallet, Transaction tx, List<Transaction... |
@Test public void nonStandardDust() { Transaction standardTx = new Transaction(PARAMS); standardTx.addInput(PARAMS.getGenesisBlock().getTransactions().get(0).getOutput(0)); standardTx.addOutput(COIN, key1); assertEquals(RiskAnalysis.Result.OK, DefaultRiskAnalysis.FACTORY.create(wallet, standardTx, NO_DEPS).analyze()); ... | @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } | DefaultRiskAnalysis implements RiskAnalysis { @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } } | DefaultRiskAnalysis implements RiskAnalysis { @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } private DefaultRiskAnalysis(Wallet wallet, Transaction tx, List<Transaction... | DefaultRiskAnalysis implements RiskAnalysis { @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } private DefaultRiskAnalysis(Wallet wallet, Transaction tx, List<Transaction... | DefaultRiskAnalysis implements RiskAnalysis { @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } private DefaultRiskAnalysis(Wallet wallet, Transaction tx, List<Transaction... |
@Test public void nonShortestPossiblePushData() { ScriptChunk nonStandardChunk = new ScriptChunk(OP_PUSHDATA1, new byte[75]); byte[] nonStandardScript = new ScriptBuilder().addChunk(nonStandardChunk).build().getProgram(); Transaction tx = new Transaction(PARAMS); assertEquals(DefaultRiskAnalysis.RuleViolation.NONE, Def... | public static RuleViolation isStandard(Transaction tx) { if (tx.getVersion() > 2 || tx.getVersion() < 1) { log.warn("TX considered non-standard due to unknown version number {}", tx.getVersion()); return RuleViolation.VERSION; } final List<TransactionOutput> outputs = tx.getOutputs(); for (int i = 0; i < outputs.size()... | DefaultRiskAnalysis implements RiskAnalysis { public static RuleViolation isStandard(Transaction tx) { if (tx.getVersion() > 2 || tx.getVersion() < 1) { log.warn("TX considered non-standard due to unknown version number {}", tx.getVersion()); return RuleViolation.VERSION; } final List<TransactionOutput> outputs = tx.ge... | DefaultRiskAnalysis implements RiskAnalysis { public static RuleViolation isStandard(Transaction tx) { if (tx.getVersion() > 2 || tx.getVersion() < 1) { log.warn("TX considered non-standard due to unknown version number {}", tx.getVersion()); return RuleViolation.VERSION; } final List<TransactionOutput> outputs = tx.ge... | DefaultRiskAnalysis implements RiskAnalysis { public static RuleViolation isStandard(Transaction tx) { if (tx.getVersion() > 2 || tx.getVersion() < 1) { log.warn("TX considered non-standard due to unknown version number {}", tx.getVersion()); return RuleViolation.VERSION; } final List<TransactionOutput> outputs = tx.ge... | DefaultRiskAnalysis implements RiskAnalysis { public static RuleViolation isStandard(Transaction tx) { if (tx.getVersion() > 2 || tx.getVersion() < 1) { log.warn("TX considered non-standard due to unknown version number {}", tx.getVersion()); return RuleViolation.VERSION; } final List<TransactionOutput> outputs = tx.ge... |
@Test public void canonicalSignature() { TransactionSignature sig = TransactionSignature.dummy(); Script scriptOk = ScriptBuilder.createInputScript(sig); assertEquals(RuleViolation.NONE, DefaultRiskAnalysis.isInputStandard(new TransactionInput(PARAMS, null, scriptOk.getProgram()))); byte[] sigBytes = sig.encodeToBitcoi... | public static RuleViolation isInputStandard(TransactionInput input) { for (ScriptChunk chunk : input.getScriptSig().getChunks()) { if (chunk.data != null && !chunk.isShortestPossiblePushData()) return RuleViolation.SHORTEST_POSSIBLE_PUSHDATA; if (chunk.isPushData()) { ECDSASignature signature; try { signature = ECKey.E... | DefaultRiskAnalysis implements RiskAnalysis { public static RuleViolation isInputStandard(TransactionInput input) { for (ScriptChunk chunk : input.getScriptSig().getChunks()) { if (chunk.data != null && !chunk.isShortestPossiblePushData()) return RuleViolation.SHORTEST_POSSIBLE_PUSHDATA; if (chunk.isPushData()) { ECDSA... | DefaultRiskAnalysis implements RiskAnalysis { public static RuleViolation isInputStandard(TransactionInput input) { for (ScriptChunk chunk : input.getScriptSig().getChunks()) { if (chunk.data != null && !chunk.isShortestPossiblePushData()) return RuleViolation.SHORTEST_POSSIBLE_PUSHDATA; if (chunk.isPushData()) { ECDSA... | DefaultRiskAnalysis implements RiskAnalysis { public static RuleViolation isInputStandard(TransactionInput input) { for (ScriptChunk chunk : input.getScriptSig().getChunks()) { if (chunk.data != null && !chunk.isShortestPossiblePushData()) return RuleViolation.SHORTEST_POSSIBLE_PUSHDATA; if (chunk.isPushData()) { ECDSA... | DefaultRiskAnalysis implements RiskAnalysis { public static RuleViolation isInputStandard(TransactionInput input) { for (ScriptChunk chunk : input.getScriptSig().getChunks()) { if (chunk.data != null && !chunk.isShortestPossiblePushData()) return RuleViolation.SHORTEST_POSSIBLE_PUSHDATA; if (chunk.isPushData()) { ECDSA... |
@Test public void standardOutputs() throws Exception { Transaction tx = new Transaction(PARAMS); tx.addInput(PARAMS.getGenesisBlock().getTransactions().get(0).getOutput(0)); tx.addOutput(Coin.CENT, ScriptBuilder.createOutputScript(key1.toAddress(PARAMS))); tx.addOutput(Coin.CENT, ScriptBuilder.createOutputScript(key1))... | @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } | DefaultRiskAnalysis implements RiskAnalysis { @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } } | DefaultRiskAnalysis implements RiskAnalysis { @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } private DefaultRiskAnalysis(Wallet wallet, Transaction tx, List<Transaction... | DefaultRiskAnalysis implements RiskAnalysis { @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } private DefaultRiskAnalysis(Wallet wallet, Transaction tx, List<Transaction... | DefaultRiskAnalysis implements RiskAnalysis { @Override public Result analyze() { checkState(!analyzed); analyzed = true; Result result = analyzeIsFinal(); if (result != null && result != Result.OK) return result; return analyzeIsStandard(); } private DefaultRiskAnalysis(Wallet wallet, Transaction tx, List<Transaction... |
@Test public void testP2SHOutputScript() throws Exception { Address p2shAddress = Address.fromBase58(MainNetParams.get(), "35b9vsyH1KoFT5a5KtrKusaCcPLkiSo1tU"); assertTrue(ScriptBuilder.createOutputScript(p2shAddress).isPayToScriptHash()); } | public boolean isPayToScriptHash() { byte[] program = getProgram(); return program.length == 23 && (program[0] & 0xff) == OP_HASH160 && (program[1] & 0xff) == 0x14 && (program[22] & 0xff) == OP_EQUAL; } | Script { public boolean isPayToScriptHash() { byte[] program = getProgram(); return program.length == 23 && (program[0] & 0xff) == OP_HASH160 && (program[1] & 0xff) == 0x14 && (program[22] & 0xff) == OP_EQUAL; } } | Script { public boolean isPayToScriptHash() { byte[] program = getProgram(); return program.length == 23 && (program[0] & 0xff) == OP_HASH160 && (program[1] & 0xff) == 0x14 && (program[22] & 0xff) == OP_EQUAL; } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programB... | Script { public boolean isPayToScriptHash() { byte[] program = getProgram(); return program.length == 23 && (program[0] & 0xff) == OP_HASH160 && (program[1] & 0xff) == 0x14 && (program[22] & 0xff) == OP_EQUAL; } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programB... | Script { public boolean isPayToScriptHash() { byte[] program = getProgram(); return program.length == 23 && (program[0] & 0xff) == OP_HASH160 && (program[1] & 0xff) == 0x14 && (program[22] & 0xff) == OP_EQUAL; } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programB... |
@Test public void testIp() throws Exception { byte[] bytes = HEX.decode("41043e96222332ea7848323c08116dddafbfa917b8e37f0bdf63841628267148588a09a43540942d58d49717ad3fabfe14978cf4f0a8b84d2435dad16e9aa4d7f935ac"); Script s = new Script(bytes); assertTrue(s.isSentToRawPubKey()); } | public boolean isSentToRawPubKey() { return chunks.size() == 2 && chunks.get(1).equalsOpCode(OP_CHECKSIG) && !chunks.get(0).isOpCode() && chunks.get(0).data.length > 1; } | Script { public boolean isSentToRawPubKey() { return chunks.size() == 2 && chunks.get(1).equalsOpCode(OP_CHECKSIG) && !chunks.get(0).isOpCode() && chunks.get(0).data.length > 1; } } | Script { public boolean isSentToRawPubKey() { return chunks.size() == 2 && chunks.get(1).equalsOpCode(OP_CHECKSIG) && !chunks.get(0).isOpCode() && chunks.get(0).data.length > 1; } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programBytes, long creationTimeSeconds);... | Script { public boolean isSentToRawPubKey() { return chunks.size() == 2 && chunks.get(1).equalsOpCode(OP_CHECKSIG) && !chunks.get(0).isOpCode() && chunks.get(0).data.length > 1; } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programBytes, long creationTimeSeconds);... | Script { public boolean isSentToRawPubKey() { return chunks.size() == 2 && chunks.get(1).equalsOpCode(OP_CHECKSIG) && !chunks.get(0).isOpCode() && chunks.get(0).data.length > 1; } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programBytes, long creationTimeSeconds);... |
@Test public void testOp0() { Transaction tx = new Transaction(PARAMS); tx.addInput(new TransactionInput(PARAMS, tx, new byte[] {})); Script script = new ScriptBuilder().smallNum(0).build(); LinkedList<byte[]> stack = new LinkedList<byte[]>(); Script.executeScript(tx, 0, script, stack, Script.ALL_VERIFY_FLAGS); assertE... | @Deprecated public static void executeScript(@Nullable Transaction txContainingThis, long index, Script script, LinkedList<byte[]> stack, boolean enforceNullDummy) throws ScriptException { final EnumSet<VerifyFlag> flags = enforceNullDummy ? EnumSet.of(VerifyFlag.NULLDUMMY) : EnumSet.noneOf(VerifyFlag.class); executeSc... | Script { @Deprecated public static void executeScript(@Nullable Transaction txContainingThis, long index, Script script, LinkedList<byte[]> stack, boolean enforceNullDummy) throws ScriptException { final EnumSet<VerifyFlag> flags = enforceNullDummy ? EnumSet.of(VerifyFlag.NULLDUMMY) : EnumSet.noneOf(VerifyFlag.class); ... | Script { @Deprecated public static void executeScript(@Nullable Transaction txContainingThis, long index, Script script, LinkedList<byte[]> stack, boolean enforceNullDummy) throws ScriptException { final EnumSet<VerifyFlag> flags = enforceNullDummy ? EnumSet.of(VerifyFlag.NULLDUMMY) : EnumSet.noneOf(VerifyFlag.class); ... | Script { @Deprecated public static void executeScript(@Nullable Transaction txContainingThis, long index, Script script, LinkedList<byte[]> stack, boolean enforceNullDummy) throws ScriptException { final EnumSet<VerifyFlag> flags = enforceNullDummy ? EnumSet.of(VerifyFlag.NULLDUMMY) : EnumSet.noneOf(VerifyFlag.class); ... | Script { @Deprecated public static void executeScript(@Nullable Transaction txContainingThis, long index, Script script, LinkedList<byte[]> stack, boolean enforceNullDummy) throws ScriptException { final EnumSet<VerifyFlag> flags = enforceNullDummy ? EnumSet.of(VerifyFlag.NULLDUMMY) : EnumSet.noneOf(VerifyFlag.class); ... |
@Test public void dataDrivenValidScripts() throws Exception { JsonNode json = new ObjectMapper().readTree(new InputStreamReader(getClass().getResourceAsStream( "script_valid.json"), Charsets.UTF_8)); for (JsonNode test : json) { Script scriptSig = parseScriptString(test.get(0).asText()); Script scriptPubKey = parseScri... | @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } } | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programB... | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programB... | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programB... |
@Test public void dataDrivenInvalidScripts() throws Exception { JsonNode json = new ObjectMapper().readTree(new InputStreamReader(getClass().getResourceAsStream( "script_invalid.json"), Charsets.UTF_8)); for (JsonNode test : json) { try { Script scriptSig = parseScriptString(test.get(0).asText()); Script scriptPubKey =... | @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } } | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programB... | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programB... | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programB... |
@Test public void dataDrivenValidTransactions() throws Exception { JsonNode json = new ObjectMapper().readTree(new InputStreamReader(getClass().getResourceAsStream( "tx_valid.json"), Charsets.UTF_8)); for (JsonNode test : json) { if (test.isArray() && test.size() == 1 && test.get(0).isTextual()) continue; Transaction t... | @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } } | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programB... | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programB... | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programB... |
@Test public void dataDrivenInvalidTransactions() throws Exception { JsonNode json = new ObjectMapper().readTree(new InputStreamReader(getClass().getResourceAsStream( "tx_invalid.json"), Charsets.UTF_8)); for (JsonNode test : json) { if (test.isArray() && test.size() == 1 && test.get(0).isTextual()) continue; Map<Trans... | @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } } | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programB... | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programB... | Script { @Deprecated public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey) throws ScriptException { correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, Coin.ZERO, ALL_VERIFY_FLAGS); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programB... |
@Test public void testCLTVPaymentChannelOutput() { Script script = ScriptBuilder.createCLTVPaymentChannelOutput(BigInteger.valueOf(20), new ECKey(), new ECKey()); assertTrue("script is locktime-verify", script.isSentToCLTVPaymentChannel()); } | public boolean isSentToCLTVPaymentChannel() { if (chunks.size() != 10) return false; if (!chunks.get(0).equalsOpCode(OP_IF)) return false; if (!chunks.get(2).equalsOpCode(OP_CHECKSIGVERIFY)) return false; if (!chunks.get(3).equalsOpCode(OP_ELSE)) return false; if (!chunks.get(5).equalsOpCode(OP_CHECKLOCKTIMEVERIFY)) re... | Script { public boolean isSentToCLTVPaymentChannel() { if (chunks.size() != 10) return false; if (!chunks.get(0).equalsOpCode(OP_IF)) return false; if (!chunks.get(2).equalsOpCode(OP_CHECKSIGVERIFY)) return false; if (!chunks.get(3).equalsOpCode(OP_ELSE)) return false; if (!chunks.get(5).equalsOpCode(OP_CHECKLOCKTIMEVE... | Script { public boolean isSentToCLTVPaymentChannel() { if (chunks.size() != 10) return false; if (!chunks.get(0).equalsOpCode(OP_IF)) return false; if (!chunks.get(2).equalsOpCode(OP_CHECKSIGVERIFY)) return false; if (!chunks.get(3).equalsOpCode(OP_ELSE)) return false; if (!chunks.get(5).equalsOpCode(OP_CHECKLOCKTIMEVE... | Script { public boolean isSentToCLTVPaymentChannel() { if (chunks.size() != 10) return false; if (!chunks.get(0).equalsOpCode(OP_IF)) return false; if (!chunks.get(2).equalsOpCode(OP_CHECKSIGVERIFY)) return false; if (!chunks.get(3).equalsOpCode(OP_ELSE)) return false; if (!chunks.get(5).equalsOpCode(OP_CHECKLOCKTIMEVE... | Script { public boolean isSentToCLTVPaymentChannel() { if (chunks.size() != 10) return false; if (!chunks.get(0).equalsOpCode(OP_IF)) return false; if (!chunks.get(2).equalsOpCode(OP_CHECKSIGVERIFY)) return false; if (!chunks.get(3).equalsOpCode(OP_ELSE)) return false; if (!chunks.get(5).equalsOpCode(OP_CHECKLOCKTIMEVE... |
@Test public void getToAddress() throws Exception { ECKey toKey = new ECKey(); Address toAddress = toKey.toAddress(PARAMS); assertEquals(toAddress, ScriptBuilder.createOutputScript(toKey).getToAddress(PARAMS, true)); assertEquals(toAddress, ScriptBuilder.createOutputScript(toAddress).getToAddress(PARAMS, true)); Script... | public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); } | Script { public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); } } | Script { public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programBytes, long creationTimeSeconds); } | Script { public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programBytes, long creationTimeSeconds); long getCreationTimeSeconds(); void setCreationTimeSe... | Script { public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programBytes, long creationTimeSeconds); long getCreationTimeSeconds(); void setCreationTimeSe... |
@Test(expected = ScriptException.class) public void getToAddressNoPubKey() throws Exception { ScriptBuilder.createOutputScript(new ECKey()).getToAddress(PARAMS, false); } | public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); } | Script { public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); } } | Script { public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programBytes, long creationTimeSeconds); } | Script { public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programBytes, long creationTimeSeconds); long getCreationTimeSeconds(); void setCreationTimeSe... | Script { public Address getToAddress(NetworkParameters params) throws ScriptException { return getToAddress(params, false); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programBytes, long creationTimeSeconds); long getCreationTimeSeconds(); void setCreationTimeSe... |
@Test public void numberBuilderZero() { final ScriptBuilder builder = new ScriptBuilder(); builder.number(0); assertArrayEquals(new byte[] { 0x00 }, builder.build().getProgram()); } | public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeException(e); } } | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... |
@Test public void numberBuilderPositiveOpCode() { final ScriptBuilder builder = new ScriptBuilder(); builder.number(5); assertArrayEquals(new byte[] { 0x55 }, builder.build().getProgram()); } | public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeException(e); } } | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... |
@Test public void numberBuilderBigNum() { ScriptBuilder builder = new ScriptBuilder(); builder.number(0x524a); assertArrayEquals(new byte[] { 0x02, 0x4a, 0x52 }, builder.build().getProgram()); builder = new ScriptBuilder(); builder.number(0x110011); assertEquals(4, builder.build().getProgram().length); builder = new Sc... | public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeException(e); } } | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... |
@Test public void numberBuilderNegative() { final ScriptBuilder builder = new ScriptBuilder(); builder.number(-5); assertArrayEquals(new byte[] { 0x01, ((byte) 133) }, builder.build().getProgram()); } | public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeException(e); } } | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... | Script { public byte[] getProgram() { try { if (program != null) return Arrays.copyOf(program, program.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (ScriptChunk chunk : chunks) { chunk.write(bos); } program = bos.toByteArray(); return program; } catch (IOException e) { throw new RuntimeExceptio... |
@Test public void numberBuilder16() { ScriptBuilder builder = new ScriptBuilder(); builder.number(15).number(16).number(17); builder.number(0, 17).number(1, 16).number(2, 15); Script script = builder.build(); assertEquals("PUSHDATA(1)[11] 16 15 15 16 PUSHDATA(1)[11]", script.toString()); } | @Override public String toString() { return Utils.join(chunks); } | Script { @Override public String toString() { return Utils.join(chunks); } } | Script { @Override public String toString() { return Utils.join(chunks); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programBytes, long creationTimeSeconds); } | Script { @Override public String toString() { return Utils.join(chunks); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programBytes, long creationTimeSeconds); long getCreationTimeSeconds(); void setCreationTimeSeconds(long creationTimeSeconds); @Override String t... | Script { @Override public String toString() { return Utils.join(chunks); } private Script(); Script(List<ScriptChunk> chunks); Script(byte[] programBytes); Script(byte[] programBytes, long creationTimeSeconds); long getCreationTimeSeconds(); void setCreationTimeSeconds(long creationTimeSeconds); @Override String t... |
@Test public void shouldSendClientVersionOnChannelOpen() throws Exception { PaymentChannelClient dut = new PaymentChannelClient(wallet, ecKey, maxValue, serverHash, connection, versionSelector); connection.sendToServer(capture(clientVersionCapture)); EasyMock.expect(wallet.getExtensions()).andReturn(new HashMap<String,... | @Override public void connectionOpen() { lock.lock(); try { connectionOpen = true; StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates) wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID); if (channels != null) storedChannel = channels.getUsableChannelForServerID(serverId... | PaymentChannelClient implements IPaymentChannelClient { @Override public void connectionOpen() { lock.lock(); try { connectionOpen = true; StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates) wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID); if (channels != null) store... | PaymentChannelClient implements IPaymentChannelClient { @Override public void connectionOpen() { lock.lock(); try { connectionOpen = true; StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates) wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID); if (channels != null) store... | PaymentChannelClient implements IPaymentChannelClient { @Override public void connectionOpen() { lock.lock(); try { connectionOpen = true; StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates) wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID); if (channels != null) store... | PaymentChannelClient implements IPaymentChannelClient { @Override public void connectionOpen() { lock.lock(); try { connectionOpen = true; StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates) wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID); if (channels != null) store... |
@Test public void shouldSendTimeWindowInClientVersion() throws Exception { long timeWindow = 4000; KeyParameter userKey = null; PaymentChannelClient dut = new PaymentChannelClient(wallet, ecKey, maxValue, serverHash, timeWindow, userKey, connection, versionSelector); connection.sendToServer(capture(clientVersionCapture... | @Override public void connectionOpen() { lock.lock(); try { connectionOpen = true; StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates) wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID); if (channels != null) storedChannel = channels.getUsableChannelForServerID(serverId... | PaymentChannelClient implements IPaymentChannelClient { @Override public void connectionOpen() { lock.lock(); try { connectionOpen = true; StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates) wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID); if (channels != null) store... | PaymentChannelClient implements IPaymentChannelClient { @Override public void connectionOpen() { lock.lock(); try { connectionOpen = true; StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates) wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID); if (channels != null) store... | PaymentChannelClient implements IPaymentChannelClient { @Override public void connectionOpen() { lock.lock(); try { connectionOpen = true; StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates) wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID); if (channels != null) store... | PaymentChannelClient implements IPaymentChannelClient { @Override public void connectionOpen() { lock.lock(); try { connectionOpen = true; StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates) wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID); if (channels != null) store... |
@Test @Ignore public void getPeer_one() throws Exception{ SeedPeers seedPeers = new SeedPeers(MainNetParams.get()); assertThat(seedPeers.getPeer(), notNullValue()); } | @Nullable public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } | SeedPeers implements PeerDiscovery { @Nullable public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } } | SeedPeers implements PeerDiscovery { @Nullable public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } SeedPeers(NetworkParameters params); SeedPeers(int[] seedAddrs, NetworkParameters params); } | SeedPeers implements PeerDiscovery { @Nullable public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } SeedPeers(NetworkParameters params); SeedPeers(int[] seedAddrs, NetworkParameters params); @Nullable Ine... | SeedPeers implements PeerDiscovery { @Nullable public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } SeedPeers(NetworkParameters params); SeedPeers(int[] seedAddrs, NetworkParameters params); @Nullable Ine... |
@Test @Ignore public void getPeer_all() throws Exception{ SeedPeers seedPeers = new SeedPeers(MainNetParams.get()); for (int i = 0; i < MainNetParams.get().getAddrSeeds().length; ++i) { assertThat("Failed on index: "+i, seedPeers.getPeer(), notNullValue()); } assertThat(seedPeers.getPeer(), equalTo(null)); } | @Nullable public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } | SeedPeers implements PeerDiscovery { @Nullable public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } } | SeedPeers implements PeerDiscovery { @Nullable public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } SeedPeers(NetworkParameters params); SeedPeers(int[] seedAddrs, NetworkParameters params); } | SeedPeers implements PeerDiscovery { @Nullable public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } SeedPeers(NetworkParameters params); SeedPeers(int[] seedAddrs, NetworkParameters params); @Nullable Ine... | SeedPeers implements PeerDiscovery { @Nullable public InetSocketAddress getPeer() throws PeerDiscoveryException { try { return nextPeer(); } catch (UnknownHostException e) { throw new PeerDiscoveryException(e); } } SeedPeers(NetworkParameters params); SeedPeers(int[] seedAddrs, NetworkParameters params); @Nullable Ine... |
@Test @Ignore public void getPeers_length() throws Exception{ SeedPeers seedPeers = new SeedPeers(MainNetParams.get()); InetSocketAddress[] addresses = seedPeers.getPeers(0, 0, TimeUnit.SECONDS); assertThat(addresses.length, equalTo(MainNetParams.get().getAddrSeeds().length)); } | @Override public InetSocketAddress[] getPeers(long services, long timeoutValue, TimeUnit timeoutUnit) throws PeerDiscoveryException { if (services != 0) throw new PeerDiscoveryException("Pre-determined peers cannot be filtered by services: " + services); try { return allPeers(); } catch (UnknownHostException e) { throw... | SeedPeers implements PeerDiscovery { @Override public InetSocketAddress[] getPeers(long services, long timeoutValue, TimeUnit timeoutUnit) throws PeerDiscoveryException { if (services != 0) throw new PeerDiscoveryException("Pre-determined peers cannot be filtered by services: " + services); try { return allPeers(); } c... | SeedPeers implements PeerDiscovery { @Override public InetSocketAddress[] getPeers(long services, long timeoutValue, TimeUnit timeoutUnit) throws PeerDiscoveryException { if (services != 0) throw new PeerDiscoveryException("Pre-determined peers cannot be filtered by services: " + services); try { return allPeers(); } c... | SeedPeers implements PeerDiscovery { @Override public InetSocketAddress[] getPeers(long services, long timeoutValue, TimeUnit timeoutUnit) throws PeerDiscoveryException { if (services != 0) throw new PeerDiscoveryException("Pre-determined peers cannot be filtered by services: " + services); try { return allPeers(); } c... | SeedPeers implements PeerDiscovery { @Override public InetSocketAddress[] getPeers(long services, long timeoutValue, TimeUnit timeoutUnit) throws PeerDiscoveryException { if (services != 0) throw new PeerDiscoveryException("Pre-determined peers cannot be filtered by services: " + services); try { return allPeers(); } c... |
@Test public void testInitialize() throws BlockStoreException { final BlockStore blockStore = new MemoryBlockStore(PARAMS); final BlockChain chain = new BlockChain(PARAMS, blockStore); long timeSeconds = 1231006505; StoredBlock chainHead = null; for (int height = 0; height < PARAMS.getMajorityWindow(); height++) { chai... | public void initialize(final BlockStore blockStore, final StoredBlock chainHead) throws BlockStoreException { StoredBlock versionBlock = chainHead; final Stack<Long> versions = new Stack<Long>(); versions.push(versionBlock.getHeader().getVersion()); for (int headOffset = 0; headOffset < versionWindow.length; headOffset... | VersionTally { public void initialize(final BlockStore blockStore, final StoredBlock chainHead) throws BlockStoreException { StoredBlock versionBlock = chainHead; final Stack<Long> versions = new Stack<Long>(); versions.push(versionBlock.getHeader().getVersion()); for (int headOffset = 0; headOffset < versionWindow.len... | VersionTally { public void initialize(final BlockStore blockStore, final StoredBlock chainHead) throws BlockStoreException { StoredBlock versionBlock = chainHead; final Stack<Long> versions = new Stack<Long>(); versions.push(versionBlock.getHeader().getVersion()); for (int headOffset = 0; headOffset < versionWindow.len... | VersionTally { public void initialize(final BlockStore blockStore, final StoredBlock chainHead) throws BlockStoreException { StoredBlock versionBlock = chainHead; final Stack<Long> versions = new Stack<Long>(); versions.push(versionBlock.getHeader().getVersion()); for (int headOffset = 0; headOffset < versionWindow.len... | VersionTally { public void initialize(final BlockStore blockStore, final StoredBlock chainHead) throws BlockStoreException { StoredBlock versionBlock = chainHead; final Stack<Long> versions = new Stack<Long>(); versions.push(versionBlock.getHeader().getVersion()); for (int headOffset = 0; headOffset < versionWindow.len... |
@Test public void testInQueue() { PriorityQueue<ExponentialBackoff> queue = new PriorityQueue<ExponentialBackoff>(); ExponentialBackoff backoff1 = new ExponentialBackoff(params); backoff.trackFailure(); backoff.trackFailure(); backoff1.trackFailure(); backoff1.trackFailure(); backoff1.trackFailure(); queue.offer(backof... | public void trackFailure() { retryTime = Utils.currentTimeMillis() + (long)backoff; backoff = Math.min(backoff * params.multiplier, params.maximum); } | ExponentialBackoff implements Comparable<ExponentialBackoff> { public void trackFailure() { retryTime = Utils.currentTimeMillis() + (long)backoff; backoff = Math.min(backoff * params.multiplier, params.maximum); } } | ExponentialBackoff implements Comparable<ExponentialBackoff> { public void trackFailure() { retryTime = Utils.currentTimeMillis() + (long)backoff; backoff = Math.min(backoff * params.multiplier, params.maximum); } ExponentialBackoff(Params params); } | ExponentialBackoff implements Comparable<ExponentialBackoff> { public void trackFailure() { retryTime = Utils.currentTimeMillis() + (long)backoff; backoff = Math.min(backoff * params.multiplier, params.maximum); } ExponentialBackoff(Params params); final void trackSuccess(); void trackFailure(); long getRetryTime(); @O... | ExponentialBackoff implements Comparable<ExponentialBackoff> { public void trackFailure() { retryTime = Utils.currentTimeMillis() + (long)backoff; backoff = Math.min(backoff * params.multiplier, params.maximum); } ExponentialBackoff(Params params); final void trackSuccess(); void trackFailure(); long getRetryTime(); @O... |
@Test public void repeatOptionalDecimals() { assertEquals("0.00000001", formatRepeat(SATOSHI, 2, 4)); assertEquals("0.00000010", formatRepeat(SATOSHI.multiply(10), 2, 4)); assertEquals("0.01", formatRepeat(CENT, 2, 4)); assertEquals("0.10", formatRepeat(CENT.multiply(10), 2, 4)); assertEquals("0", formatRepeat(SATOSHI,... | public MonetaryFormat repeatOptionalDecimals(int decimals, int repetitions) { checkArgument(repetitions >= 0); List<Integer> decimalGroups = new ArrayList<Integer>(repetitions); for (int i = 0; i < repetitions; i++) decimalGroups.add(decimals); return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMar... | MonetaryFormat { public MonetaryFormat repeatOptionalDecimals(int decimals, int repetitions) { checkArgument(repetitions >= 0); List<Integer> decimalGroups = new ArrayList<Integer>(repetitions); for (int i = 0; i < repetitions; i++) decimalGroups.add(decimals); return new MonetaryFormat(negativeSign, positiveSign, zero... | MonetaryFormat { public MonetaryFormat repeatOptionalDecimals(int decimals, int repetitions) { checkArgument(repetitions >= 0); List<Integer> decimalGroups = new ArrayList<Integer>(repetitions); for (int i = 0; i < repetitions; i++) decimalGroups.add(decimals); return new MonetaryFormat(negativeSign, positiveSign, zero... | MonetaryFormat { public MonetaryFormat repeatOptionalDecimals(int decimals, int repetitions) { checkArgument(repetitions >= 0); List<Integer> decimalGroups = new ArrayList<Integer>(repetitions); for (int i = 0; i < repetitions; i++) decimalGroups.add(decimals); return new MonetaryFormat(negativeSign, positiveSign, zero... | MonetaryFormat { public MonetaryFormat repeatOptionalDecimals(int decimals, int repetitions) { checkArgument(repetitions >= 0); List<Integer> decimalGroups = new ArrayList<Integer>(repetitions); for (int i = 0; i < repetitions; i++) decimalGroups.add(decimals); return new MonetaryFormat(negativeSign, positiveSign, zero... |
@Test public void standardCodes() throws Exception { assertEquals("BCH 0.00", MonetaryFormat.BTC.format(Coin.ZERO).toString()); assertEquals("mBCH 0.00", MonetaryFormat.MBTC.format(Coin.ZERO).toString()); assertEquals("µBCH 0", MonetaryFormat.UBTC.format(Coin.ZERO).toString()); } | public CharSequence format(Monetary monetary) { int maxDecimals = minDecimals; if (decimalGroups != null) for (int group : decimalGroups) maxDecimals += group; int smallestUnitExponent = monetary.smallestUnitExponent(); checkState(maxDecimals <= smallestUnitExponent, "The maximum possible number of decimals (%s) cannot... | MonetaryFormat { public CharSequence format(Monetary monetary) { int maxDecimals = minDecimals; if (decimalGroups != null) for (int group : decimalGroups) maxDecimals += group; int smallestUnitExponent = monetary.smallestUnitExponent(); checkState(maxDecimals <= smallestUnitExponent, "The maximum possible number of dec... | MonetaryFormat { public CharSequence format(Monetary monetary) { int maxDecimals = minDecimals; if (decimalGroups != null) for (int group : decimalGroups) maxDecimals += group; int smallestUnitExponent = monetary.smallestUnitExponent(); checkState(maxDecimals <= smallestUnitExponent, "The maximum possible number of dec... | MonetaryFormat { public CharSequence format(Monetary monetary) { int maxDecimals = minDecimals; if (decimalGroups != null) for (int group : decimalGroups) maxDecimals += group; int smallestUnitExponent = monetary.smallestUnitExponent(); checkState(maxDecimals <= smallestUnitExponent, "The maximum possible number of dec... | MonetaryFormat { public CharSequence format(Monetary monetary) { int maxDecimals = minDecimals; if (decimalGroups != null) for (int group : decimalGroups) maxDecimals += group; int smallestUnitExponent = monetary.smallestUnitExponent(); checkState(maxDecimals <= smallestUnitExponent, "The maximum possible number of dec... |
@Test public void noCode() throws Exception { assertEquals("0", MonetaryFormat.UBTC.noCode().shift(0).format(Coin.ZERO).toString()); assertEquals("dBCH 0", MonetaryFormat.UBTC.noCode().code(1, "dBCH").shift(1).format(Coin.ZERO).toString()); } | public MonetaryFormat noCode() { if (codes == null) return this; else return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups, shift, roundingMode, null, codeSeparator, codePrefixed); } | MonetaryFormat { public MonetaryFormat noCode() { if (codes == null) return this; else return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups, shift, roundingMode, null, codeSeparator, codePrefixed); } } | MonetaryFormat { public MonetaryFormat noCode() { if (codes == null) return this; else return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups, shift, roundingMode, null, codeSeparator, codePrefixed); } MonetaryFormat(); private MonetaryFormat(char negativeSign, char po... | MonetaryFormat { public MonetaryFormat noCode() { if (codes == null) return this; else return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups, shift, roundingMode, null, codeSeparator, codePrefixed); } MonetaryFormat(); private MonetaryFormat(char negativeSign, char po... | MonetaryFormat { public MonetaryFormat noCode() { if (codes == null) return this; else return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups, shift, roundingMode, null, codeSeparator, codePrefixed); } MonetaryFormat(); private MonetaryFormat(char negativeSign, char po... |
@Test public void codeSeparator() throws Exception { assertEquals("BCH@0.00", MonetaryFormat.BTC.codeSeparator('@').format(Coin.ZERO).toString()); } | public MonetaryFormat codeSeparator(char codeSeparator) { checkArgument(!Character.isDigit(codeSeparator)); checkArgument(codeSeparator > 0); if (codeSeparator == this.codeSeparator) return this; else return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups, shift, roundi... | MonetaryFormat { public MonetaryFormat codeSeparator(char codeSeparator) { checkArgument(!Character.isDigit(codeSeparator)); checkArgument(codeSeparator > 0); if (codeSeparator == this.codeSeparator) return this; else return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGrou... | MonetaryFormat { public MonetaryFormat codeSeparator(char codeSeparator) { checkArgument(!Character.isDigit(codeSeparator)); checkArgument(codeSeparator > 0); if (codeSeparator == this.codeSeparator) return this; else return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGrou... | MonetaryFormat { public MonetaryFormat codeSeparator(char codeSeparator) { checkArgument(!Character.isDigit(codeSeparator)); checkArgument(codeSeparator > 0); if (codeSeparator == this.codeSeparator) return this; else return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGrou... | MonetaryFormat { public MonetaryFormat codeSeparator(char codeSeparator) { checkArgument(!Character.isDigit(codeSeparator)); checkArgument(codeSeparator > 0); if (codeSeparator == this.codeSeparator) return this; else return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGrou... |
@Test public void testMultiSigOutputToString() throws Exception { sendMoneyToWallet(AbstractBlockChain.NewBlockType.BEST_CHAIN, Coin.COIN); ECKey myKey = new ECKey(); this.wallet.importKey(myKey); ECKey otherKey = new ECKey(); Transaction multiSigTransaction = new Transaction(PARAMS); ImmutableList<ECKey> keys = Immuta... | @Override public String toString() { try { Script script = getScriptPubKey(); StringBuilder buf = new StringBuilder("TxOut of "); buf.append(Coin.valueOf(value).toFriendlyString()); if (script.isSentToAddress() || script.isPayToScriptHash()) buf.append(" to ").append(script.getToAddress(params)); else if (script.isSent... | TransactionOutput extends ChildMessage { @Override public String toString() { try { Script script = getScriptPubKey(); StringBuilder buf = new StringBuilder("TxOut of "); buf.append(Coin.valueOf(value).toFriendlyString()); if (script.isSentToAddress() || script.isPayToScriptHash()) buf.append(" to ").append(script.getT... | TransactionOutput extends ChildMessage { @Override public String toString() { try { Script script = getScriptPubKey(); StringBuilder buf = new StringBuilder("TxOut of "); buf.append(Coin.valueOf(value).toFriendlyString()); if (script.isSentToAddress() || script.isPayToScriptHash()) buf.append(" to ").append(script.getT... | TransactionOutput extends ChildMessage { @Override public String toString() { try { Script script = getScriptPubKey(); StringBuilder buf = new StringBuilder("TxOut of "); buf.append(Coin.valueOf(value).toFriendlyString()); if (script.isSentToAddress() || script.isPayToScriptHash()) buf.append(" to ").append(script.getT... | TransactionOutput extends ChildMessage { @Override public String toString() { try { Script script = getScriptPubKey(); StringBuilder buf = new StringBuilder("TxOut of "); buf.append(Coin.valueOf(value).toFriendlyString()); if (script.isSentToAddress() || script.isPayToScriptHash()) buf.append(" to ").append(script.getT... |
@Test public void getMinNonDustValue() throws Exception { TransactionOutput payToAddressOutput = new TransactionOutput(PARAMS, null, Coin.COIN, myAddress); assertEquals(Transaction.MIN_NONDUST_OUTPUT, payToAddressOutput.getMinNonDustValue()); } | public Coin getMinNonDustValue(Coin feePerKb) { final long size = this.unsafeBitcoinSerialize().length + 148; return feePerKb.multiply(size).divide(1000); } | TransactionOutput extends ChildMessage { public Coin getMinNonDustValue(Coin feePerKb) { final long size = this.unsafeBitcoinSerialize().length + 148; return feePerKb.multiply(size).divide(1000); } } | TransactionOutput extends ChildMessage { public Coin getMinNonDustValue(Coin feePerKb) { final long size = this.unsafeBitcoinSerialize().length + 148; return feePerKb.multiply(size).divide(1000); } TransactionOutput(NetworkParameters params, @Nullable Transaction parent, byte[] payload,
int... | TransactionOutput extends ChildMessage { public Coin getMinNonDustValue(Coin feePerKb) { final long size = this.unsafeBitcoinSerialize().length + 148; return feePerKb.multiply(size).divide(1000); } TransactionOutput(NetworkParameters params, @Nullable Transaction parent, byte[] payload,
int... | TransactionOutput extends ChildMessage { public Coin getMinNonDustValue(Coin feePerKb) { final long size = this.unsafeBitcoinSerialize().length + 148; return feePerKb.multiply(size).divide(1000); } TransactionOutput(NetworkParameters params, @Nullable Transaction parent, byte[] payload,
int... |
@Test public void stringification() throws Exception { Address a = new Address(testParams, HEX.decode("fda79a24e50ff70ff42f7d89585da5bd19d9e5cc")); assertEquals("n4eA2nbYqErp7H6jebchxAN59DmNpksexv", a.toString()); assertFalse(a.isP2SHAddress()); Address b = new Address(mainParams, HEX.decode("4a22c3c4cbb31e4d03b1555063... | public boolean isP2SHAddress() { final NetworkParameters parameters = getParameters(); return parameters != null && this.version == parameters.p2shHeader; } | Address extends VersionedChecksummedBytes { public boolean isP2SHAddress() { final NetworkParameters parameters = getParameters(); return parameters != null && this.version == parameters.p2shHeader; } } | Address extends VersionedChecksummedBytes { public boolean isP2SHAddress() { final NetworkParameters parameters = getParameters(); return parameters != null && this.version == parameters.p2shHeader; } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @De... | Address extends VersionedChecksummedBytes { public boolean isP2SHAddress() { final NetworkParameters parameters = getParameters(); return parameters != null && this.version == parameters.p2shHeader; } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @De... | Address extends VersionedChecksummedBytes { public boolean isP2SHAddress() { final NetworkParameters parameters = getParameters(); return parameters != null && this.version == parameters.p2shHeader; } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @De... |
@Test public void errorPaths() { try { Address.fromBase58(testParams, "this is not a valid address!"); fail(); } catch (WrongNetworkException e) { fail(); } catch (AddressFormatException e) { } try { Address.fromBase58(testParams, ""); fail(); } catch (WrongNetworkException e) { fail(); } catch (AddressFormatException ... | public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } } | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... |
@Test public void getNetwork() throws Exception { NetworkParameters params = Address.getParametersFromAddress("17kzeh4N8g49GFvdDzSf8PjaPfyoD1MndL"); assertEquals(MainNetParams.get().getId(), params.getId()); params = Address.getParametersFromAddress("n4eA2nbYqErp7H6jebchxAN59DmNpksexv"); assertEquals(TestNet3Params.get... | public static NetworkParameters getParametersFromAddress(String address) throws AddressFormatException { try { return Address.fromBase58(null, address).getParameters(); } catch (WrongNetworkException e) { throw new RuntimeException(e); } } | Address extends VersionedChecksummedBytes { public static NetworkParameters getParametersFromAddress(String address) throws AddressFormatException { try { return Address.fromBase58(null, address).getParameters(); } catch (WrongNetworkException e) { throw new RuntimeException(e); } } } | Address extends VersionedChecksummedBytes { public static NetworkParameters getParametersFromAddress(String address) throws AddressFormatException { try { return Address.fromBase58(null, address).getParameters(); } catch (WrongNetworkException e) { throw new RuntimeException(e); } } Address(NetworkParameters params, in... | Address extends VersionedChecksummedBytes { public static NetworkParameters getParametersFromAddress(String address) throws AddressFormatException { try { return Address.fromBase58(null, address).getParameters(); } catch (WrongNetworkException e) { throw new RuntimeException(e); } } Address(NetworkParameters params, in... | Address extends VersionedChecksummedBytes { public static NetworkParameters getParametersFromAddress(String address) throws AddressFormatException { try { return Address.fromBase58(null, address).getParameters(); } catch (WrongNetworkException e) { throw new RuntimeException(e); } } Address(NetworkParameters params, in... |
@Test public void getAltNetwork() throws Exception { class AltNetwork extends MainNetParams { AltNetwork() { super(); id = "alt.network"; addressHeader = 48; p2shHeader = 5; acceptableAddressCodes = new int[] { addressHeader, p2shHeader }; } } AltNetwork altNetwork = new AltNetwork(); Networks.register(altNetwork); Net... | public static NetworkParameters getParametersFromAddress(String address) throws AddressFormatException { try { return Address.fromBase58(null, address).getParameters(); } catch (WrongNetworkException e) { throw new RuntimeException(e); } } | Address extends VersionedChecksummedBytes { public static NetworkParameters getParametersFromAddress(String address) throws AddressFormatException { try { return Address.fromBase58(null, address).getParameters(); } catch (WrongNetworkException e) { throw new RuntimeException(e); } } } | Address extends VersionedChecksummedBytes { public static NetworkParameters getParametersFromAddress(String address) throws AddressFormatException { try { return Address.fromBase58(null, address).getParameters(); } catch (WrongNetworkException e) { throw new RuntimeException(e); } } Address(NetworkParameters params, in... | Address extends VersionedChecksummedBytes { public static NetworkParameters getParametersFromAddress(String address) throws AddressFormatException { try { return Address.fromBase58(null, address).getParameters(); } catch (WrongNetworkException e) { throw new RuntimeException(e); } } Address(NetworkParameters params, in... | Address extends VersionedChecksummedBytes { public static NetworkParameters getParametersFromAddress(String address) throws AddressFormatException { try { return Address.fromBase58(null, address).getParameters(); } catch (WrongNetworkException e) { throw new RuntimeException(e); } } Address(NetworkParameters params, in... |
@Test public void cloning() throws Exception { Address a = new Address(testParams, HEX.decode("fda79a24e50ff70ff42f7d89585da5bd19d9e5cc")); Address b = a.clone(); assertEquals(a, b); assertNotSame(a, b); } | @Override public Address clone() throws CloneNotSupportedException { return (Address) super.clone(); } | Address extends VersionedChecksummedBytes { @Override public Address clone() throws CloneNotSupportedException { return (Address) super.clone(); } } | Address extends VersionedChecksummedBytes { @Override public Address clone() throws CloneNotSupportedException { return (Address) super.clone(); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Deprecated Address(@Nullable NetworkParameters params, ... | Address extends VersionedChecksummedBytes { @Override public Address clone() throws CloneNotSupportedException { return (Address) super.clone(); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Deprecated Address(@Nullable NetworkParameters params, ... | Address extends VersionedChecksummedBytes { @Override public Address clone() throws CloneNotSupportedException { return (Address) super.clone(); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Deprecated Address(@Nullable NetworkParameters params, ... |
@Test public void roundtripBase58() throws Exception { String base58 = "17kzeh4N8g49GFvdDzSf8PjaPfyoD1MndL"; assertEquals(base58, Address.fromBase58(null, base58).toBase58()); } | public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } } | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... |
@Test public void comparisonLessThan() throws Exception { Address a = Address.fromBase58(mainParams, "1Dorian4RoXcnBv9hnQ4Y2C1an6NJ4UrjX"); Address b = Address.fromBase58(mainParams, "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P"); int result = a.compareTo(b); assertTrue(result < 0); } | public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } } | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... |
@Test public void comparisonGreaterThan() throws Exception { Address a = Address.fromBase58(mainParams, "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P"); Address b = Address.fromBase58(mainParams, "1Dorian4RoXcnBv9hnQ4Y2C1an6NJ4UrjX"); int result = a.compareTo(b); assertTrue(result > 0); } | public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } } | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... |
@Test public void comparisonBytesVsString() throws Exception { Address a = Address.fromBase58(mainParams, "1Dorian4RoXcnBv9hnQ4Y2C1an6NJ4UrjX"); Address b = Address.fromBase58(mainParams, "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P"); int resultBytes = a.compareTo(b); int resultsString = a.toString().compareTo(b.toString()); a... | public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } } | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... | Address extends VersionedChecksummedBytes { public static Address fromBase58(@Nullable NetworkParameters params, String base58) throws AddressFormatException { return new Address(params, base58); } Address(NetworkParameters params, int version, byte[] hash160); Address(NetworkParameters params, byte[] hash160); @Depre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.