Skip to content

Commit

Permalink
Test that sequence number has higher precedence than expiry
Browse files Browse the repository at this point in the history
  • Loading branch information
ianopolous committed Dec 14, 2023
1 parent 143c845 commit e4cfae8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/java/org/peergos/EmbeddedIpfsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ public void publishPresignedValue() throws Exception {
byte[] res2 = node1.resolveValue(publisher.publicKey()).join();
Assert.assertTrue(Arrays.equals(res2, value2));

// publish an updated value with earlier expiry
byte[] value3 = "3rd value to put in IPNS".getBytes();
byte[] signedRecord3 = IPNS.createSignedRecord(value3, expiry.minusDays(1), 3, ttlNanos, publisher);
node1.publishPresignedRecord(pub, signedRecord3).join();
node1.publishPresignedRecord(pub, signedRecord3).join();
node1.publishPresignedRecord(pub, signedRecord3).join();

byte[] res3 = node1.resolveValue(publisher.publicKey()).join();
Assert.assertTrue(Arrays.equals(res3, value3));

node1.stop();
}

Expand Down

0 comments on commit e4cfae8

Please sign in to comment.