class TransactionStatement implements Stored {

  public String generateHash() {

    final byte[] versionByte =
        ByteUtils.shortToBytes(
            Short.reverseBytes((short) ReceiptVersion.TRANSACTION_STATEMENT.getValue()));
    final byte[] typeByte =
        ByteUtils.shortToBytes(
            Short.reverseBytes((short) ReceiptType.TRANSACTION_GROUP.getValue()));
    final byte[] sourceByte = getReceiptSource().serialize();

    byte[] results = ArrayUtils.concat(versionByte, typeByte, sourceByte);

    for (final Receipt receipt : receipts) {
      results = ArrayUtils.concat(results, receipt.serialize());
    }

    byte[] hash = Hashes.sha3_256(results);
    return ConvertUtils.toHex(hash);
  }

  public  TransactionStatement(
      String recordId, BigInteger height, ReceiptSource receiptSource, List<Receipt> receipts);

}