class PrivateWorldStateReader {

  public Optional<Bytes> getContractCode(
      final String privacyGroupId, final Hash blockHash, final Address contractAddress) {
    final Hash latestStateRoot =
        privateStateRootResolver.resolveLastStateRoot(
            Bytes32.wrap(Bytes.fromBase64String(privacyGroupId)), blockHash);

    return privateWorldStateArchive
        .get(latestStateRoot)
        .flatMap(worldState -> Optional.ofNullable(worldState.get(contractAddress)))
        .flatMap(account -> Optional.ofNullable(account.getCode()));
  }

  public  PrivateWorldStateReader(
      final PrivateStateRootResolver privateStateRootResolver,
      final WorldStateArchive privateWorldStateArchive,
      final PrivateStateStorage privateStateStorage);

}