@@ -30,7 +30,7 @@ var DefaultShardWidth = 256
30
30
type Directory interface {
31
31
32
32
// SetPrefix sets the CID prefix of the root node.
33
- SetPrefix (* cid.Prefix )
33
+ SetPrefix (cid.Format )
34
34
35
35
// AddChild adds a (name, key) pair to the root node.
36
36
AddChild (context.Context , string , ipld.Node ) error
@@ -52,7 +52,7 @@ type Directory interface {
52
52
GetNode () (ipld.Node , error )
53
53
54
54
// GetPrefix returns the CID Prefix used.
55
- GetPrefix () * cid.Prefix
55
+ GetPrefix () cid.Format
56
56
}
57
57
58
58
// TODO: Evaluate removing `dserv` from this layer and providing it in MFS.
@@ -128,7 +128,7 @@ func NewDirectoryFromNode(dserv ipld.DAGService, node ipld.Node) (Directory, err
128
128
}
129
129
130
130
// SetPrefix implements the `Directory` interface.
131
- func (d * BasicDirectory ) SetPrefix (prefix * cid.Prefix ) {
131
+ func (d * BasicDirectory ) SetPrefix (prefix cid.Format ) {
132
132
d .node .SetPrefix (prefix )
133
133
}
134
134
@@ -180,8 +180,8 @@ func (d *BasicDirectory) GetNode() (ipld.Node, error) {
180
180
}
181
181
182
182
// GetPrefix implements the `Directory` interface.
183
- func (d * BasicDirectory ) GetPrefix () * cid.Prefix {
184
- return & d .node .Prefix
183
+ func (d * BasicDirectory ) GetPrefix () cid.Format {
184
+ return d .node .Prefix ()
185
185
}
186
186
187
187
// SwitchToSharding returns a HAMT implementation of this directory.
@@ -193,7 +193,7 @@ func (d *BasicDirectory) SwitchToSharding(ctx context.Context) (Directory, error
193
193
if err != nil {
194
194
return nil , err
195
195
}
196
- shard .SetPrefix (& d .node .Prefix )
196
+ shard .SetPrefix (d .node .Prefix () )
197
197
hamtDir .shard = shard
198
198
199
199
for _ , lnk := range d .node .Links () {
@@ -212,7 +212,7 @@ func (d *BasicDirectory) SwitchToSharding(ctx context.Context) (Directory, error
212
212
}
213
213
214
214
// SetPrefix implements the `Directory` interface.
215
- func (d * HAMTDirectory ) SetPrefix (prefix * cid.Prefix ) {
215
+ func (d * HAMTDirectory ) SetPrefix (prefix cid.Format ) {
216
216
d .shard .SetPrefix (prefix )
217
217
}
218
218
@@ -252,6 +252,6 @@ func (d *HAMTDirectory) GetNode() (ipld.Node, error) {
252
252
}
253
253
254
254
// GetPrefix implements the `Directory` interface.
255
- func (d * HAMTDirectory ) GetPrefix () * cid.Prefix {
255
+ func (d * HAMTDirectory ) GetPrefix () cid.Format {
256
256
return d .shard .Prefix ()
257
257
}
0 commit comments