Skip to content

Commit

Permalink
docs: add javadoc for LigtSyncState
Browse files Browse the repository at this point in the history
  • Loading branch information
ablax committed Aug 29, 2024
1 parent 8076d9a commit a915a73
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,26 @@
import java.util.Arrays;
import java.util.Map;

/**
* Represents the light synchronization state in the genesis block.
*
* <p>This class contains the finalized block header, epoch changes, and
* the GRANDPA authority set necessary for light clients to synchronize with the blockchain.</p>
*/
@Getter
@ToString
public class LightSyncState {
private BlockHeader finalizedBlockHeader;
private EpochChanges epochChanges;
private AuthoritySet grandpaAuthoritySet;

/**
* Decodes LightSyncState from a map of hex-encoded strings.
*
* @param lightSyncStateMap A map with keys: "finalizedBlockHeader", "babeEpochChanges", and "grandpaAuthoritySet".
* @return A decoded LightSyncState instance.
* @throws IllegalStateException if any required data is missing.
*/
public static LightSyncState decode(Map<String, String> lightSyncStateMap) {
String header = lightSyncStateMap.get("finalizedBlockHeader");
String epochChanges = lightSyncStateMap.get("babeEpochChanges");
Expand Down

0 comments on commit a915a73

Please sign in to comment.