Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fork choice implementaion/updates #213

Merged
merged 6 commits into from
Dec 3, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,91 @@ public BeaconBlock getHead(

Hash32 headRoot = spec.get_head(new Store() {

@Override
public Time getTime() {
throw new UnsupportedOperationException("not yet implemented");
}

@Override
public void setTime(Time time) {
throw new UnsupportedOperationException("not yet implemented");
}

@Override
public Time getGenesisTime() {
throw new UnsupportedOperationException("not yet implemented");
}

@Override
public Checkpoint getJustifiedCheckpoint() {
return chainStorage.getJustifiedStorage().get().get();
}

@Override
public void setJustifiedCheckpoint(Checkpoint checkpoint) {
chainStorage.getBestJustifiedStorage().set(checkpoint);
}

@Override
public Checkpoint getBestJustifiedCheckpoint() {
return chainStorage.getBestJustifiedStorage().get().get();
}

@Override
public void setBestJustifiedCheckpoint(Checkpoint checkpoint) {
chainStorage.getBestJustifiedStorage().set(checkpoint);
}

@Override
public Checkpoint getFinalizedCheckpoint() {
return chainStorage.getFinalizedStorage().get().get();
}

@Override
public void setFinalizedCheckpoint(Checkpoint checkpoint) {
chainStorage.getFinalizedStorage().set(checkpoint);
}

@Override
public Optional<BeaconState> getCheckpointState(Checkpoint checkpoint) {
throw new UnsupportedOperationException("not yet implemented");
}

@Override
public void setCheckpointState(Checkpoint checkpoint, BeaconState state) {
throw new UnsupportedOperationException("not yet implemented");
}

@Override
public Optional<BeaconBlock> getBlock(Hash32 root) {
return chainStorage.getBlockStorage().get(root);
}

@Override
public void setBlock(Hash32 root, BeaconBlock block) {
throw new UnsupportedOperationException("not yet implemented");
}

@Override
public Optional<BeaconState> getState(Hash32 root) {
return chainStorage.getStateStorage().get(root);
}

@Override
public void setState(Hash32 root, BeaconState state) {
throw new UnsupportedOperationException("not yet implemented");
}

@Override
public Optional<LatestMessage> getLatestMessage(ValidatorIndex index) {
return latestAttestationStorage.apply(index);
}

@Override
public void setLatestMessage(ValidatorIndex index, LatestMessage message) {
throw new UnsupportedOperationException("not yet implemented");
}

@Override
public List<Hash32> getChildren(Hash32 root) {
return chainStorage.getBlockStorage().getChildren(root, SEARCH_LIMIT).stream()
Expand Down
Loading