### Question:
TransactionReceipt implements org.hyperledger.besu.plugin.data.TransactionReceipt { public static TransactionReceipt readFrom(final RLPInput input) { return readFrom(input, true); } TransactionReceipt(
      final Hash stateRoot,
      final long cumulativeGasUsed,
      final List<Log> logs,
      final Optional<Bytes> revertReason); private  TransactionReceipt(
      final Hash stateRoot,
      final long cumulativeGasUsed,
      final List<Log> logs,
      final LogsBloomFilter bloomFilter,
      final Optional<Bytes> revertReason);  TransactionReceipt(
      final int status,
      final long cumulativeGasUsed,
      final List<Log> logs,
      final Optional<Bytes> revertReason); private  TransactionReceipt(
      final int status,
      final long cumulativeGasUsed,
      final List<Log> logs,
      final LogsBloomFilter bloomFilter,
      final Optional<Bytes> revertReason); private  TransactionReceipt(
      final Hash stateRoot,
      final int status,
      final long cumulativeGasUsed,
      final List<Log> logs,
      final LogsBloomFilter bloomFilter,
      final Optional<Bytes> revertReason); void writeTo(final RLPOutput out); void writeToWithRevertReason(final RLPOutput out); static TransactionReceipt readFrom(final RLPInput input); static TransactionReceipt readFrom(
      final RLPInput input, final boolean revertReasonAllowed); Hash getStateRoot(); @Override long getCumulativeGasUsed(); @Override List<Log> getLogs(); @Override LogsBloomFilter getBloomFilter(); @Override int getStatus(); TransactionReceiptType getTransactionReceiptType(); @Override Optional<Bytes> getRevertReason(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void toFromRlp() { final BlockDataGenerator gen = new BlockDataGenerator(); final TransactionReceipt receipt = gen.receipt(); final TransactionReceipt copy = TransactionReceipt.readFrom(RLP.input(RLP.encode(receipt::writeToWithRevertReason)), false); assertThat(copy).isEqualTo(receipt); }
@Test public void toFromRlpWithReason() { final BlockDataGenerator gen = new BlockDataGenerator(); final TransactionReceipt receipt = gen.receipt(Bytes.fromHexString("0x1122334455667788")); final TransactionReceipt copy = TransactionReceipt.readFrom(RLP.input(RLP.encode(receipt::writeToWithRevertReason))); assertThat(copy).isEqualTo(receipt); }