Skip to content

Commit

Permalink
Merge pull request #1665 from 0chain/feat/storageversion-list
Browse files Browse the repository at this point in the history
Add storage version in list
  • Loading branch information
dabasov authored Nov 12, 2024
2 parents c47be59 + daee72e commit 7f879ce
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions zboxcore/sdk/listworker.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ type ListResult struct {
ActualThumbnailHash string `json:"actual_thumbnail_hash"`
ActualThumbnailSize int64 `json:"actual_thumbnail_size"`

CreatedAt common.Timestamp `json:"created_at"`
UpdatedAt common.Timestamp `json:"updated_at"`
Children []*ListResult `json:"list"`
Consensus `json:"-"`
deleteMask zboxutil.Uint128 `json:"-"`
CreatedAt common.Timestamp `json:"created_at"`
UpdatedAt common.Timestamp `json:"updated_at"`
Children []*ListResult `json:"list"`
StorageVersion int `json:"storage_version"`
Consensus `json:"-"`
deleteMask zboxutil.Uint128 `json:"-"`
}

type ListRequestOptions func(req *ListRequest)
Expand Down Expand Up @@ -234,8 +235,9 @@ func (req *ListRequest) GetListFromBlobbers() (*ListResult, error) {
return nil, err
}
result := &ListResult{
ClientId: req.ClientId,
deleteMask: zboxutil.NewUint128(1).Lsh(uint64(len(req.blobbers))).Sub64(1),
ClientId: req.ClientId,
deleteMask: zboxutil.NewUint128(1).Lsh(uint64(len(req.blobbers))).Sub64(1),
StorageVersion: req.storageVersion,
}
selected := make(map[string]*ListResult)
childResultMap := make(map[string]*ListResult)
Expand Down Expand Up @@ -316,7 +318,8 @@ func (lr *ListResult) populateChildren(children []fileref.RefEntity, childResult
consensus: 0,
fullconsensus: req.fullconsensus,
},
LookupHash: child.GetLookupHash(),
LookupHash: child.GetLookupHash(),
StorageVersion: req.storageVersion,
}
childResultMap[actualHash] = childResult
}
Expand Down

0 comments on commit 7f879ce

Please sign in to comment.