TransactionContext { public ByteString signByteStrings(ByteString... bs) throws CryptoException { if (bs == null) { return null; } if (bs.length == 0) { return null; } if (bs.length == 1 && bs[0] == null) { return null; } ByteString f = bs[0]; for (int i = 1; i < bs.length; ++i) { f = f.concat(bs[i]); } return ByteString.copyFrom(sign(f.toByteArray())); } TransactionContext(Channel channel, User user, CryptoSuite cryptoPrimitives); CryptoSuite getCryptoPrimitives(); Identities.SerializedIdentity getIdentity(); long getEpoch(); User getUser(); Channel getChannel(); long getProposalWaitTime(); void setProposalWaitTime(long proposalWaitTime); Timestamp getFabricTimestamp(); ByteString getNonce(); void verify(boolean verify); boolean getVerify(); String getChannelID(); String getTxID(); ByteString signByteString(byte[] b); ByteString signByteStrings(ByteString... bs); ByteString[] signByteStrings(User[] users, ByteString... bs); TransactionContext retryTransactionSameContext();  }
@Test public void testSignByteStrings() throws Exception { TransactionContext context = createTestContext(); Assert.assertNull(context.signByteStrings((ByteString) null)); Assert.assertNull(context.signByteStrings((ByteString[]) null)); Assert.assertNull(context.signByteStrings(new ByteString[0])); User[] users = new User[0]; Assert.assertNull(context.signByteStrings(users, (ByteString) null)); Assert.assertNull(context.signByteStrings(users, (ByteString[]) null)); Assert.assertNull(context.signByteStrings(users, new ByteString[0])); }