Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
revert switch to sharding to use default
Browse files Browse the repository at this point in the history
  • Loading branch information
schomatis committed Oct 22, 2021
1 parent 0e831ed commit ba2d000
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions io/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,11 @@ func (d *BasicDirectory) GetCidBuilder() cid.Builder {
}

// SwitchToSharding returns a HAMT implementation of this directory.
func (d *BasicDirectory) SwitchToSharding(ctx context.Context, shardWidth int) (*HAMTDirectory, error) {
func (d *BasicDirectory) SwitchToSharding(ctx context.Context) (*HAMTDirectory, error) {
hamtDir := new(HAMTDirectory)
hamtDir.dserv = d.dserv

shard, err := hamt.NewShard(d.dserv, shardWidth)
shard, err := hamt.NewShard(d.dserv, DefaultShardWidth)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -574,7 +574,7 @@ func (d *UpgradeableDirectory) AddChild(ctx context.Context, name string, nd ipl
if !switchToHAMT {
return basicDir.AddChild(ctx, name, nd)
}
hamtDir, err = basicDir.SwitchToSharding(ctx, DefaultShardWidth)
hamtDir, err = basicDir.SwitchToSharding(ctx)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion io/directory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func TestIntegrityOfDirectorySwitch(t *testing.T) {
}
compareDirectoryEntries(t, basicDir, hamtDir)

hamtDirFromSwitch, err := basicDir.SwitchToSharding(ctx, DefaultShardWidth)
hamtDirFromSwitch, err := basicDir.SwitchToSharding(ctx)
assert.NoError(t, err)
basicDirFromSwitch, err := hamtDir.switchToBasic(ctx)
assert.NoError(t, err)
Expand Down

0 comments on commit ba2d000

Please sign in to comment.