Skip to content

Commit

Permalink
add more predefined value for epoch number
Browse files Browse the repository at this point in the history
  • Loading branch information
boqiu committed Jul 12, 2020
1 parent a4d99ca commit f5ecfb9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/java/conflux/web3j/request/Epoch.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ static Epoch latestMined() {
return DefaultEpoch.LATEST_MINED;
}

static Epoch latestCheckpoint() {
return DefaultEpoch.LATEST_CHECKPOINT;
}

static Epoch latestConfirmed() {
return DefaultEpoch.LATEST_CONFIRMED;
}

static Epoch numberOf(long number) {
String value = Numeric.encodeQuantity(BigInteger.valueOf(number));
return new EpochByValue(value);
Expand All @@ -39,7 +47,9 @@ static Epoch hashOf(String blockHash) {
enum DefaultEpoch implements Epoch {
EARLIEST("earliest"),
LATEST_STATE("latest_state"),
LATEST_MINED("latest_mined");
LATEST_MINED("latest_mined"),
LATEST_CHECKPOINT("latest_checkpoint"),
LATEST_CONFIRMED("latest_confirmed");

private String value;

Expand Down

0 comments on commit f5ecfb9

Please sign in to comment.