Skip to content

Commit

Permalink
Just use layout.PartialTileSize (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter authored Dec 9, 2024
1 parent 6d75e83 commit 0d5a770
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func (n *nodeCache) GetNode(ctx context.Context, id compact.NodeID) ([]byte, err
// GetEntryBundle fetches the entry bundle at the given _tile index_.
func GetEntryBundle(ctx context.Context, f EntryBundleFetcherFunc, i, logSize uint64) (api.EntryBundle, error) {
bundle := api.EntryBundle{}
sRaw, err := f(ctx, i, uint8(logSize%layout.EntryBundleWidth))
sRaw, err := f(ctx, i, layout.PartialTileSize(0, i, logSize))
if err != nil {
if errors.Is(err, os.ErrNotExist) {
return bundle, fmt.Errorf("leaf bundle at index %d not found: %v", i, err)
Expand Down
4 changes: 2 additions & 2 deletions storage/gcp/gcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,13 @@ func TestBundleRoundtrip(t *testing.T) {
t.Fatalf("setEntryBundle: %v", err)
}

expPath := layout.EntriesPath(test.index, uint8(test.logSize%layout.EntryBundleWidth))
expPath := layout.EntriesPath(test.index, layout.PartialTileSize(0, test.index, test.logSize))
_, ok := m.mem[expPath]
if !ok {
t.Fatalf("want bundle at %v but found none", expPath)
}

got, err := s.getEntryBundle(ctx, test.index, uint8(test.logSize%layout.EntryBundleWidth))
got, err := s.getEntryBundle(ctx, test.index, layout.PartialTileSize(0, test.index, test.logSize))
if err != nil {
t.Fatalf("getEntryBundle: %v", err)
}
Expand Down

0 comments on commit 0d5a770

Please sign in to comment.