@Test public void testToBase64EnvelopeXdrBuilderNoSignatures() throws FormatException, IOException { KeyPair source = KeyPair.fromSecretSeed("SCH27VUZZ6UAKB67BDNF6FA42YMBMQCBKXWGMFD5TZ6S5ZZCZFLRXKHS"); KeyPair destination = KeyPair.fromAccountId("GDW6AUTBXTOC7FIKUO5BOO3OGLK4SF7ZPOBLMQHMZDI45J2Z6VXRB5NR"); Account account = new Account(source, 2908908335136768L); Transaction transaction = new Transaction.Builder(account) .addOperation(new CreateAccountOperation.Builder(destination, "2000").build()) .build(); try { transaction.toEnvelopeXdrBase64(); fail(); } catch (RuntimeException exception) { assertTrue(exception.getMessage().contains("Transaction must be signed by at least one signer.")); } }
public String toEnvelopeXdrBase64() { try { kin.base.xdr.TransactionEnvelope envelope = this.toEnvelopeXdr(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); XdrDataOutputStream xdrOutputStream = new XdrDataOutputStream(outputStream); kin.base.xdr.TransactionEnvelope.encode(xdrOutputStream, envelope); Base64 base64Codec = new Base64(); return base64Codec.encodeAsString(outputStream.toByteArray()); } catch (IOException e) { throw new AssertionError(e); } }
Transaction { public String toEnvelopeXdrBase64() { try { kin.base.xdr.TransactionEnvelope envelope = this.toEnvelopeXdr(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); XdrDataOutputStream xdrOutputStream = new XdrDataOutputStream(outputStream); kin.base.xdr.TransactionEnvelope.encode(xdrOutputStream, envelope); Base64 base64Codec = new Base64(); return base64Codec.encodeAsString(outputStream.toByteArray()); } catch (IOException e) { throw new AssertionError(e); } } }
Transaction { public String toEnvelopeXdrBase64() { try { kin.base.xdr.TransactionEnvelope envelope = this.toEnvelopeXdr(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); XdrDataOutputStream xdrOutputStream = new XdrDataOutputStream(outputStream); kin.base.xdr.TransactionEnvelope.encode(xdrOutputStream, envelope); Base64 base64Codec = new Base64(); return base64Codec.encodeAsString(outputStream.toByteArray()); } catch (IOException e) { throw new AssertionError(e); } } Transaction(KeyPair sourceAccount, int fee, long sequenceNumber, Operation[] operations, Memo memo, TimeBounds timeBounds); }
Transaction { public String toEnvelopeXdrBase64() { try { kin.base.xdr.TransactionEnvelope envelope = this.toEnvelopeXdr(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); XdrDataOutputStream xdrOutputStream = new XdrDataOutputStream(outputStream); kin.base.xdr.TransactionEnvelope.encode(xdrOutputStream, envelope); Base64 base64Codec = new Base64(); return base64Codec.encodeAsString(outputStream.toByteArray()); } catch (IOException e) { throw new AssertionError(e); } } Transaction(KeyPair sourceAccount, int fee, long sequenceNumber, Operation[] operations, Memo memo, TimeBounds timeBounds); void sign(KeyPair signer); void sign(byte[] preimage); byte[] hash(); byte[] signatureBase(); KeyPair getSourceAccount(); long getSequenceNumber(); List<DecoratedSignature> getSignatures(); Memo getMemo(); Operation[] getOperations(); TimeBounds getTimeBounds(); int getFee(); kin.base.xdr.Transaction toXdr(); kin.base.xdr.TransactionEnvelope toEnvelopeXdr(); String toEnvelopeXdrBase64(); static Transaction fromEnvelopeXdr(String envelope); static Transaction fromEnvelopeXdr(TransactionEnvelope envelope); }
Transaction { public String toEnvelopeXdrBase64() { try { kin.base.xdr.TransactionEnvelope envelope = this.toEnvelopeXdr(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); XdrDataOutputStream xdrOutputStream = new XdrDataOutputStream(outputStream); kin.base.xdr.TransactionEnvelope.encode(xdrOutputStream, envelope); Base64 base64Codec = new Base64(); return base64Codec.encodeAsString(outputStream.toByteArray()); } catch (IOException e) { throw new AssertionError(e); } } Transaction(KeyPair sourceAccount, int fee, long sequenceNumber, Operation[] operations, Memo memo, TimeBounds timeBounds); void sign(KeyPair signer); void sign(byte[] preimage); byte[] hash(); byte[] signatureBase(); KeyPair getSourceAccount(); long getSequenceNumber(); List<DecoratedSignature> getSignatures(); Memo getMemo(); Operation[] getOperations(); TimeBounds getTimeBounds(); int getFee(); kin.base.xdr.Transaction toXdr(); kin.base.xdr.TransactionEnvelope toEnvelopeXdr(); String toEnvelopeXdrBase64(); static Transaction fromEnvelopeXdr(String envelope); static Transaction fromEnvelopeXdr(TransactionEnvelope envelope);  }