Skip to content

Commit

Permalink
api: support farcaster frame census origin
Browse files Browse the repository at this point in the history
Signed-off-by: p4u <[email protected]>
  • Loading branch information
p4u committed Feb 9, 2024
1 parent 1894efb commit 8e1ec02
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/api_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ func CensusTypeToOrigin(ctype CensusTypeDescription) (models.CensusOrigin, []byt
case CensusTypeWeighted, CensusTypeZKWeighted:
origin = models.CensusOrigin_OFF_CHAIN_TREE_WEIGHTED
root = ctype.RootHash
case CensusTypeFarcaster:
origin = models.CensusOrigin_FARCASTER_FRAME
root = ctype.RootHash
default:
return 0, nil, ErrCensusTypeUnknown.Withf("%q", ctype)
}
Expand Down
2 changes: 2 additions & 0 deletions api/census_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func encodeCensusType(t models.Census_Type) string {
return CensusTypeWeighted
case models.Census_CA:
return CensusTypeCSP
case models.Census_FARCASTER_FRAME:
return CensusTypeFarcaster
}

return CensusTypeUnknown
Expand Down
1 change: 1 addition & 0 deletions api/censuses.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const (
CensusTypeWeighted = "weighted"
CensusTypeZKWeighted = "zkweighted"
CensusTypeCSP = "csp"
CensusTypeFarcaster = "farcaster"
CensusTypeUnknown = "unknown"

MaxCensusAddBatchSize = 8192
Expand Down

0 comments on commit 8e1ec02

Please sign in to comment.