This repository was archived by the owner on Aug 11, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ class IPLDResolver {
185
185
const options = mergeOptions ( defaultOptions , userOptions )
186
186
187
187
const cidOptions = {
188
- version : options . cidVersion ,
188
+ cidVersion : options . cidVersion ,
189
189
hashAlg : options . hashAlg ,
190
190
onlyHash : options . onlyHash
191
191
}
Original file line number Diff line number Diff line change @@ -135,6 +135,24 @@ module.exports = (repo) => {
135
135
await expect ( resolver . get ( cid ) ) . to . eventually . be . rejected ( )
136
136
}
137
137
} )
138
+
139
+ it ( 'should return a v0 CID when specified' , async ( ) => {
140
+ const node = dagPB . DAGNode . create ( Buffer . from ( 'a dag-pb node' ) )
141
+ const cid = await resolver . put ( node , multicodec . DAG_PB , {
142
+ cidVersion : 0
143
+ } )
144
+
145
+ expect ( cid . version ) . to . equal ( 0 )
146
+ } )
147
+
148
+ it ( 'should return a v1 CID when specified' , async ( ) => {
149
+ const node = dagPB . DAGNode . create ( Buffer . from ( 'a dag-pb node' ) )
150
+ const cid = await resolver . put ( node , multicodec . DAG_PB , {
151
+ cidVersion : 1
152
+ } )
153
+
154
+ expect ( cid . version ) . to . equal ( 1 )
155
+ } )
138
156
} )
139
157
} )
140
158
}
You can’t perform that action at this time.
0 commit comments