VerificationScript extends NeoSerializable { public byte[] getScript() { return script; } VerificationScript();  VerificationScript(byte[] script);  VerificationScript(ECPublicKey publicKey);  VerificationScript(List<ECPublicKey> publicKeys, int signingThreshold); byte[] getScript(); @Override byte[] toArray(); ScriptHash getScriptHash(); @Override int getSize(); int getSigningThreshold(); int getNrOfAccounts(); boolean isSingleSigScript(); boolean isMultiSigScript(); List<ECPublicKey> getPublicKeys(); @Override void deserialize(BinaryReader reader); @Override void serialize(BinaryWriter writer); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testFromPublicKey() { final String key = "035fdb1d1f06759547020891ae97c729327853aeb1256b6fe0473bc2e9fa42ff50"; final ECPublicKey ecPubKey = new ECPublicKey(Numeric.hexStringToByteArray(key)); VerificationScript script = new VerificationScript(ecPubKey); byte[] expected = Numeric.hexStringToByteArray("" + OpCode.PUSHDATA1.toString() + "21" + key + OpCode.PUSHNULL.toString() + OpCode.SYSCALL.toString() + InteropServiceCode.NEO_CRYPTO_VERIFYWITHECDSASECP256R1.getHash() ); assertArrayEquals(expected, script.getScript()); }
@Test public void testFromPublicKeys() { final String key1 = "035fdb1d1f06759547020891ae97c729327853aeb1256b6fe0473bc2e9fa42ff50"; final String key2 = "03eda286d19f7ee0b472afd1163d803d620a961e1581a8f2704b52c0285f6e022d"; List<ECPublicKey> publicKeys = Arrays.asList( new ECPublicKey(Numeric.hexStringToByteArray(key1)), new ECPublicKey(Numeric.hexStringToByteArray(key2))); VerificationScript script = new VerificationScript(publicKeys, 2); byte[] expected = Numeric.hexStringToByteArray("" + OpCode.PUSH2.toString() + OpCode.PUSHDATA1.toString() + "21" + key1 + OpCode.PUSHDATA1.toString() + "21" + key2 + OpCode.PUSH2.toString() + OpCode.PUSHNULL.toString() + OpCode.SYSCALL.toString() + InteropServiceCode.NEO_CRYPTO_CHECKMULTISIGWITHECDSASECP256R1.getHash() ); assertArrayEquals(expected, script.getScript()); }