@@ -0,0 +1,2614 @@
+package uk.gov.register.service;%0A%0Aimport uk.gov.register.db.EntryMerkleLeafStore;%0Aimport uk.gov.register.db.EntryQueryDAO;%0Aimport uk.gov.register.views.ConsistencyProof;%0Aimport uk.gov.register.views.EntryProof;%0Aimport uk.gov.register.views.RegisterProof;%0Aimport uk.gov.verifiablelog.VerifiableLog;%0Aimport uk.gov.verifiablelog.store.memoization.MemoizationStore;%0A%0Aimport javax.inject.Inject;%0Aimport javax.xml.bind.DatatypeConverter;%0Aimport java.security.MessageDigest;%0Aimport java.security.NoSuchAlgorithmException;%0Aimport java.util.List;%0Aimport java.util.stream.Collectors;%0A%0Apublic class VerifiableLogService %7B%0A    private final EntryQueryDAO entryDAO;%0A    private final MemoizationStore memoizationStore;%0A    private final VerifiableLog verifiableLog;%0A%0A    @Inject%0A    public VerifiableLogService(EntryQueryDAO entryDAO, MemoizationStore memoizationStore) throws NoSuchAlgorithmException %7B%0A        this.entryDAO = entryDAO;%0A        this.memoizationStore = memoizationStore;%0A        this.verifiableLog = createVerifiableLog(entryDAO);%0A    %7D%0A%0A    public RegisterProof getRegisterProof() throws NoSuchAlgorithmException %7B%0A        try %7B%0A            entryDAO.begin();%0A            String rootHash = bytesToString(verifiableLog.currentRoot());%0A            return new RegisterProof(rootHash);%0A        %7D finally %7B%0A            entryDAO.rollback();%0A        %7D%0A    %7D%0A%0A    public EntryProof getEntryProof(int entryNumber, int totalEntries)%7B%0A        try %7B%0A            entryDAO.begin();%0A%0A            List%3CString%3E auditProof = verifiableLog.auditProof(entryNumber, totalEntries).stream()%0A                    .map(this::bytesToString).collect(Collectors.toList());%0A%0A            return new EntryProof(Integer.toString(entryNumber), auditProof);%0A        %7D finally %7B%0A            entryDAO.rollback();%0A        %7D%0A    %7D%0A%0A    public ConsistencyProof getConsistencyProof(int totalEntries1, int totalEntries2)%7B%0A        try %7B%0A            entryDAO.begin();%0A            List%3CString%3E consistencyProof = verifiableLog.consistencyProof(totalEntries1, totalEntries2).stream()%0A                    .map(this::bytesToString).collect(Collectors.toList());%0A%0A            return new ConsistencyProof(consistencyProof);%0A        %7D finally %7B%0A            entryDAO.rollback();%0A        %7D%0A    %7D%0A%0A    private VerifiableLog createVerifiableLog(EntryQueryDAO entryDAO) throws NoSuchAlgorithmException %7B%0A        return new VerifiableLog(MessageDigest.getInstance(%22SHA-256%22), new EntryMerkleLeafStore(entryDAO), memoizationStore);%0A    %7D%0A%0A    private String bytesToString(byte%5B%5D bytes) %7B%0A        return DatatypeConverter.printHexBinary(bytes).toLowerCase();%0A    %7D%0A%0A%0A%7D%0A

Add VerifiableLogService class