Skip to content
Merged
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
9 changes: 8 additions & 1 deletion query_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type IncludeData struct {
Payload bool `json:"payload"`
ContentType bool `json:"contentType"`
Expiration bool `json:"expiration"`
Creator bool `json:"creator"`
Owner bool `json:"owner"`
CreatedAtBlock bool `json:"createdAtBlock"`
LastModifiedAtBlock bool `json:"lastModifiedAtBlock"`
Expand Down Expand Up @@ -58,6 +59,7 @@ func (o *Options) GetIncludeData() IncludeData {
Key: true,
ContentType: true,
Payload: true,
Creator: true,
Owner: true,
Attributes: true,
Expiration: true,
Expand Down Expand Up @@ -90,6 +92,7 @@ type EntityData struct {
Value hexutil.Bytes `json:"value,omitempty"`
ContentType *string `json:"contentType,omitempty"`
ExpiresAt *uint64 `json:"expiresAt,omitempty"`
Creator *common.Address `json:"creator,omitempty"`
Owner *common.Address `json:"owner,omitempty"`
CreatedAtBlock *uint64 `json:"createdAtBlock,omitempty"`
LastModifiedAtBlock *uint64 `json:"lastModifiedAtBlock,omitempty"`
Expand Down Expand Up @@ -276,7 +279,7 @@ func nonSyntheticPredicate(k string) bool {
return !strings.HasPrefix(k, "$")
}

func anyPredicate(k string) bool {
func anyPredicate(string) bool {
return true
}

Expand Down Expand Up @@ -309,6 +312,10 @@ func toPayload(r store.RetrievePayloadsRow, includeData IncludeData) *EntityData
res.ExpiresAt = pointerOf(r.NumericAttributes.Values["$expiration"])
}

if includeData.Creator {
res.Creator = pointerOf(common.HexToAddress(r.StringAttributes.Values["$creator"]))
}

if includeData.Owner {
res.Owner = pointerOf(common.HexToAddress(r.StringAttributes.Values["$owner"]))
}
Expand Down