Skip to content

Commit a423a72

Browse files
authored
Merge pull request #260 from sigstore/fix-naming
Change rootHash() to getRootHash() for consistency
2 parents 5e5cf4e + 87a7edf commit a423a72

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

sigstore-java/src/main/java/dev/sigstore/rekor/client/RekorEntry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ interface InclusionProof {
5959
*
6060
* @return SHA256 hash value expressed in hexadecimal format
6161
*/
62-
String rootHash();
62+
String getRootHash();
6363

6464
/** The size of the merkle tree at the time the inclusion proof was generated. */
6565
Long getTreeSize();

sigstore-java/src/main/java/dev/sigstore/rekor/client/RekorVerifier.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ public void verifyInclusionProof(RekorEntry entry) throws RekorVerificationExcep
131131
}
132132

133133
var calcuatedRootHash = Hex.toHexString(currentHash);
134-
if (!calcuatedRootHash.equals(inclusionProof.rootHash())) {
134+
if (!calcuatedRootHash.equals(inclusionProof.getRootHash())) {
135135
throw new RekorVerificationException(
136136
"Calculated inclusion proof root hash does not match provided root hash\n"
137137
+ calcuatedRootHash
138138
+ "\n"
139-
+ inclusionProof.rootHash());
139+
+ inclusionProof.getRootHash());
140140
}
141141
}
142142

sigstore-java/src/test/java/dev/sigstore/rekor/client/RekorClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private void assertEntry(RekorResponse resp, Optional<RekorEntry> entry) {
159159
assertEquals(resp.getEntry().getLogID(), entry.get().getLogID());
160160
assertTrue(entry.get().getVerification().getInclusionProof().isPresent());
161161
assertNotNull(entry.get().getVerification().getInclusionProof().get().getTreeSize());
162-
assertNotNull(entry.get().getVerification().getInclusionProof().get().rootHash());
162+
assertNotNull(entry.get().getVerification().getInclusionProof().get().getRootHash());
163163
assertNotNull(entry.get().getVerification().getInclusionProof().get().getLogIndex());
164164
assertTrue(entry.get().getVerification().getInclusionProof().get().getHashes().size() > 0);
165165
}

0 commit comments

Comments
 (0)