@Test(expected = ScriptFormatException.class) public void throwOnInvalidScriptFormat1() { VerificationScript script = new VerificationScript( Numeric.hexStringToByteArray("0123456789abcdef")); script.getPublicKeys(); }
public List<ECPublicKey> getPublicKeys() { BinaryReader reader = new BinaryReader(this.script); List<ECPublicKey> keys = new ArrayList<>(); try { if (isSingleSigScript()) { reader.readByte(); reader.readByte(); keys.add(new ECPublicKey(reader.readECPoint())); return keys; } else if (isMultiSigScript()) { reader.readPushInteger(); while (reader.readByte() == OpCode.PUSHDATA1.getCode()) { reader.readByte(); keys.add(new ECPublicKey(reader.readECPoint())); } return keys; } } catch (IOException | DeserializationException e) { throw new RuntimeException(e); } throw new ScriptFormatException("The verification script is in an incorrect format. No " + "public keys can be read from it."); }
VerificationScript extends NeoSerializable { public List<ECPublicKey> getPublicKeys() { BinaryReader reader = new BinaryReader(this.script); List<ECPublicKey> keys = new ArrayList<>(); try { if (isSingleSigScript()) { reader.readByte(); reader.readByte(); keys.add(new ECPublicKey(reader.readECPoint())); return keys; } else if (isMultiSigScript()) { reader.readPushInteger(); while (reader.readByte() == OpCode.PUSHDATA1.getCode()) { reader.readByte(); keys.add(new ECPublicKey(reader.readECPoint())); } return keys; } } catch (IOException | DeserializationException e) { throw new RuntimeException(e); } throw new ScriptFormatException("The verification script is in an incorrect format. No " + "public keys can be read from it."); } }
VerificationScript extends NeoSerializable { public List<ECPublicKey> getPublicKeys() { BinaryReader reader = new BinaryReader(this.script); List<ECPublicKey> keys = new ArrayList<>(); try { if (isSingleSigScript()) { reader.readByte(); reader.readByte(); keys.add(new ECPublicKey(reader.readECPoint())); return keys; } else if (isMultiSigScript()) { reader.readPushInteger(); while (reader.readByte() == OpCode.PUSHDATA1.getCode()) { reader.readByte(); keys.add(new ECPublicKey(reader.readECPoint())); } return keys; } } catch (IOException | DeserializationException e) { throw new RuntimeException(e); } throw new ScriptFormatException("The verification script is in an incorrect format. No " + "public keys can be read from it."); } VerificationScript();  VerificationScript(byte[] script);  VerificationScript(ECPublicKey publicKey);  VerificationScript(List<ECPublicKey> publicKeys, int signingThreshold); }
VerificationScript extends NeoSerializable { public List<ECPublicKey> getPublicKeys() { BinaryReader reader = new BinaryReader(this.script); List<ECPublicKey> keys = new ArrayList<>(); try { if (isSingleSigScript()) { reader.readByte(); reader.readByte(); keys.add(new ECPublicKey(reader.readECPoint())); return keys; } else if (isMultiSigScript()) { reader.readPushInteger(); while (reader.readByte() == OpCode.PUSHDATA1.getCode()) { reader.readByte(); keys.add(new ECPublicKey(reader.readECPoint())); } return keys; } } catch (IOException | DeserializationException e) { throw new RuntimeException(e); } throw new ScriptFormatException("The verification script is in an incorrect format. No " + "public keys can be read from it."); } 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(); }
VerificationScript extends NeoSerializable { public List<ECPublicKey> getPublicKeys() { BinaryReader reader = new BinaryReader(this.script); List<ECPublicKey> keys = new ArrayList<>(); try { if (isSingleSigScript()) { reader.readByte(); reader.readByte(); keys.add(new ECPublicKey(reader.readECPoint())); return keys; } else if (isMultiSigScript()) { reader.readPushInteger(); while (reader.readByte() == OpCode.PUSHDATA1.getCode()) { reader.readByte(); keys.add(new ECPublicKey(reader.readECPoint())); } return keys; } } catch (IOException | DeserializationException e) { throw new RuntimeException(e); } throw new ScriptFormatException("The verification script is in an incorrect format. No " + "public keys can be read from it."); } 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();  }