Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Pending

### Update
- fix: allow `extendTo` to be 0 in `ExtendFootprintTTLOperation`. ([#810](https://github.com/lightsail-network/java-stellar-sdk/issues/810))

## 4.0.0

This release contains everything from 4.0.0-beta0, plus the changes made since. Below is the changelog since 3.1.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public abstract static class ExtendFootprintTTLOperationBuilder<
C extends ExtendFootprintTTLOperation, B extends ExtendFootprintTTLOperationBuilder<C, B>>
extends OperationBuilder<C, B> {
public B extendTo(Long extendTo) {
if (extendTo <= 0 || extendTo > 0xFFFFFFFFL) {
// `extendTo` can be 0, see
// https://github.com/lightsail-network/java-stellar-sdk/issues/810
if (extendTo < 0 || extendTo > 0xFFFFFFFFL) {
throw new IllegalArgumentException("extendTo isn't a ledger quantity (uint32)");
}
this.extendTo = extendTo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ public void testNotEqualsSource() {
Assert.assertNotEquals(operation1, operation2);
}

@Test
public void testLedgersToExpireIsZero() {
ExtendFootprintTTLOperation op = ExtendFootprintTTLOperation.builder().extendTo(0L).build();
assertEquals(Long.valueOf(0), op.getExtendTo());
}

@Test
public void testLedgersToExpireIsInvalidThrowsLessThanZero() {
try {
Expand Down
Loading