@Test public void testNumber() { for (int i = -100; i <= 100; i++) { Script s = new ScriptBuilder().number(i).build(); for (ScriptChunk ch : s.chunks) { assertTrue(Integer.toString(i), ch.isShortestPossiblePushData()); } } }
public ScriptBuilder number(long num) { return number(chunks.size(), num); }
ScriptBuilder { public ScriptBuilder number(long num) { return number(chunks.size(), num); } }
ScriptBuilder { public ScriptBuilder number(long num) { return number(chunks.size(), num); } ScriptBuilder();  ScriptBuilder(Script template); }
ScriptBuilder { public ScriptBuilder number(long num) { return number(chunks.size(), num); } ScriptBuilder();  ScriptBuilder(Script template); ScriptBuilder addChunk(ScriptChunk chunk); ScriptBuilder addChunk(int index, ScriptChunk chunk); ScriptBuilder op(int opcode); ScriptBuilder op(int index, int opcode); ScriptBuilder data(byte[] data); ScriptBuilder data(int index, byte[] data); ScriptBuilder number(long num); ScriptBuilder number(int index, long num); ScriptBuilder smallNum(int num); ScriptBuilder smallNum(int index, int num); Script build(); static Script createOutputScript(Address to); static Script createOutputScript(ECKey key); static Script createInputScript(@Nullable TransactionSignature signature, ECKey pubKey); static Script createInputScript(@Nullable TransactionSignature signature); static Script createMultiSigOutputScript(int threshold, List<ECKey> pubkeys); static Script createMultiSigInputScript(List<TransactionSignature> signatures); static Script createMultiSigInputScript(TransactionSignature... signatures); static Script createMultiSigInputScriptBytes(List<byte[]> signatures); static Script createP2SHMultiSigInputScript(@Nullable List<TransactionSignature> signatures,
                                                       Script multisigProgram); static Script createMultiSigInputScriptBytes(List<byte[]> signatures, @Nullable byte[] multisigProgramBytes); static Script updateScriptWithSignature(Script scriptSig, byte[] signature, int targetIndex,
                                                   int sigsPrefixCount, int sigsSuffixCount); static Script createP2SHOutputScript(byte[] hash); static Script createP2SHOutputScript(Script redeemScript); static Script createP2SHOutputScript(int threshold, List<ECKey> pubkeys); static Script createRedeemScript(int threshold, List<ECKey> pubkeys); static Script createOpReturnScript(byte[] data); static Script createCLTVPaymentChannelOutput(BigInteger time, ECKey from, ECKey to); static Script createCLTVPaymentChannelRefund(TransactionSignature signature); static Script createCLTVPaymentChannelP2SHRefund(TransactionSignature signature, Script redeemScript); static Script createCLTVPaymentChannelP2SHInput(byte[] from, byte[] to, Script redeemScript); static Script createCLTVPaymentChannelInput(TransactionSignature from, TransactionSignature to); static Script createCLTVPaymentChannelInput(byte[] from, byte[] to); }
ScriptBuilder { public ScriptBuilder number(long num) { return number(chunks.size(), num); } ScriptBuilder();  ScriptBuilder(Script template); ScriptBuilder addChunk(ScriptChunk chunk); ScriptBuilder addChunk(int index, ScriptChunk chunk); ScriptBuilder op(int opcode); ScriptBuilder op(int index, int opcode); ScriptBuilder data(byte[] data); ScriptBuilder data(int index, byte[] data); ScriptBuilder number(long num); ScriptBuilder number(int index, long num); ScriptBuilder smallNum(int num); ScriptBuilder smallNum(int index, int num); Script build(); static Script createOutputScript(Address to); static Script createOutputScript(ECKey key); static Script createInputScript(@Nullable TransactionSignature signature, ECKey pubKey); static Script createInputScript(@Nullable TransactionSignature signature); static Script createMultiSigOutputScript(int threshold, List<ECKey> pubkeys); static Script createMultiSigInputScript(List<TransactionSignature> signatures); static Script createMultiSigInputScript(TransactionSignature... signatures); static Script createMultiSigInputScriptBytes(List<byte[]> signatures); static Script createP2SHMultiSigInputScript(@Nullable List<TransactionSignature> signatures,
                                                       Script multisigProgram); static Script createMultiSigInputScriptBytes(List<byte[]> signatures, @Nullable byte[] multisigProgramBytes); static Script updateScriptWithSignature(Script scriptSig, byte[] signature, int targetIndex,
                                                   int sigsPrefixCount, int sigsSuffixCount); static Script createP2SHOutputScript(byte[] hash); static Script createP2SHOutputScript(Script redeemScript); static Script createP2SHOutputScript(int threshold, List<ECKey> pubkeys); static Script createRedeemScript(int threshold, List<ECKey> pubkeys); static Script createOpReturnScript(byte[] data); static Script createCLTVPaymentChannelOutput(BigInteger time, ECKey from, ECKey to); static Script createCLTVPaymentChannelRefund(TransactionSignature signature); static Script createCLTVPaymentChannelP2SHRefund(TransactionSignature signature, Script redeemScript); static Script createCLTVPaymentChannelP2SHInput(byte[] from, byte[] to, Script redeemScript); static Script createCLTVPaymentChannelInput(TransactionSignature from, TransactionSignature to); static Script createCLTVPaymentChannelInput(byte[] from, byte[] to);  }