@Test public void testOp0() { Transaction tx = new Transaction(TESTNET); tx.addInput(new TransactionInput(TESTNET, tx, new byte[] {})); Script script = new ScriptBuilder().smallNum(0).build(); LinkedList<byte[]> stack = new LinkedList<>(); Script.executeScript(tx, 0, script, stack, Script.ALL_VERIFY_FLAGS); assertEquals("OP_0 push length", 0, stack.get(0).length); }
@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); executeScript(txContainingThis, index, script, stack, flags); }
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); executeScript(txContainingThis, index, script, stack, flags); } }
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); executeScript(txContainingThis, index, script, stack, flags); } private  Script();   Script(List<ScriptChunk> chunks);  Script(byte[] programBytes);  Script(byte[] programBytes, long creationTimeSeconds); }
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); executeScript(txContainingThis, index, script, stack, flags); } private  Script();   Script(List<ScriptChunk> chunks);  Script(byte[] programBytes);  Script(byte[] programBytes, long creationTimeSeconds); long getCreationTimeSeconds(); void setCreationTimeSeconds(long creationTimeSeconds); @Override String toString(); byte[] getProgram(); List<ScriptChunk> getChunks(); @Deprecated boolean isSentToRawPubKey(); @Deprecated boolean isSentToAddress(); byte[] getPubKeyHash(); Address getToAddress(NetworkParameters params); Address getToAddress(NetworkParameters params, boolean forcePayToPubKey); static void writeBytes(OutputStream os, byte[] buf); static byte[] createMultiSigOutputScript(int threshold, List<ECKey> pubkeys); static byte[] createInputScript(byte[] signature, byte[] pubkey); static byte[] createInputScript(byte[] signature); Script createEmptyInputScript(@Nullable ECKey key, @Nullable Script redeemScript); TransactionWitness createEmptyWitness(ECKey key); Script getScriptSigWithSignature(Script scriptSig, byte[] sigBytes, int index); int getSigInsertionIndex(Sha256Hash hash, ECKey signingKey); List<ECKey> getPubKeys(); static int decodeFromOpN(int opcode); static int encodeToOpN(int value); static int getSigOpCount(byte[] program); static long getP2SHSigOpCount(byte[] scriptSig); int getNumberOfSignaturesRequiredToSpend(); int getNumberOfBytesRequiredToSpend(@Nullable ECKey pubKey, @Nullable Script redeemScript); @Deprecated boolean isPayToScriptHash(); @Deprecated boolean isSentToMultiSig(); static byte[] removeAllInstancesOf(byte[] inputScript, byte[] chunkToRemove); static byte[] removeAllInstancesOfOp(byte[] inputScript, int opCode); @Deprecated boolean isOpReturn(); @Deprecated static void executeScript(@Nullable Transaction txContainingThis, long index,
                                     Script script, LinkedList<byte[]> stack, boolean enforceNullDummy); static void executeScript(@Nullable Transaction txContainingThis, long index,
                                     Script script, LinkedList<byte[]> stack, Set<VerifyFlag> verifyFlags); @Deprecated void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey); void correctlySpends(Transaction txContainingThis, int scriptSigIndex, @Nullable TransactionWitness witness, @Nullable Coin value,
            Script scriptPubKey, Set<VerifyFlag> verifyFlags); void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey,
                                Set<VerifyFlag> verifyFlags); @Nullable ScriptType getScriptType(); @Override boolean equals(Object o); @Override int hashCode(); }
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); executeScript(txContainingThis, index, script, stack, flags); } private  Script();   Script(List<ScriptChunk> chunks);  Script(byte[] programBytes);  Script(byte[] programBytes, long creationTimeSeconds); long getCreationTimeSeconds(); void setCreationTimeSeconds(long creationTimeSeconds); @Override String toString(); byte[] getProgram(); List<ScriptChunk> getChunks(); @Deprecated boolean isSentToRawPubKey(); @Deprecated boolean isSentToAddress(); byte[] getPubKeyHash(); Address getToAddress(NetworkParameters params); Address getToAddress(NetworkParameters params, boolean forcePayToPubKey); static void writeBytes(OutputStream os, byte[] buf); static byte[] createMultiSigOutputScript(int threshold, List<ECKey> pubkeys); static byte[] createInputScript(byte[] signature, byte[] pubkey); static byte[] createInputScript(byte[] signature); Script createEmptyInputScript(@Nullable ECKey key, @Nullable Script redeemScript); TransactionWitness createEmptyWitness(ECKey key); Script getScriptSigWithSignature(Script scriptSig, byte[] sigBytes, int index); int getSigInsertionIndex(Sha256Hash hash, ECKey signingKey); List<ECKey> getPubKeys(); static int decodeFromOpN(int opcode); static int encodeToOpN(int value); static int getSigOpCount(byte[] program); static long getP2SHSigOpCount(byte[] scriptSig); int getNumberOfSignaturesRequiredToSpend(); int getNumberOfBytesRequiredToSpend(@Nullable ECKey pubKey, @Nullable Script redeemScript); @Deprecated boolean isPayToScriptHash(); @Deprecated boolean isSentToMultiSig(); static byte[] removeAllInstancesOf(byte[] inputScript, byte[] chunkToRemove); static byte[] removeAllInstancesOfOp(byte[] inputScript, int opCode); @Deprecated boolean isOpReturn(); @Deprecated static void executeScript(@Nullable Transaction txContainingThis, long index,
                                     Script script, LinkedList<byte[]> stack, boolean enforceNullDummy); static void executeScript(@Nullable Transaction txContainingThis, long index,
                                     Script script, LinkedList<byte[]> stack, Set<VerifyFlag> verifyFlags); @Deprecated void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey); void correctlySpends(Transaction txContainingThis, int scriptSigIndex, @Nullable TransactionWitness witness, @Nullable Coin value,
            Script scriptPubKey, Set<VerifyFlag> verifyFlags); void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey,
                                Set<VerifyFlag> verifyFlags); @Nullable ScriptType getScriptType(); @Override boolean equals(Object o); @Override int hashCode(); static final EnumSet<VerifyFlag> ALL_VERIFY_FLAGS; static final long MAX_SCRIPT_ELEMENT_SIZE; static final int SIG_SIZE; static final int MAX_P2SH_SIGOPS; }