@@ -68,66 +68,6 @@ describe('.dag', function () {
68
68
} )
69
69
} )
70
70
71
- it ( 'should be able to get part of a dag-cbor node' , ( done ) => {
72
- const cbor = {
73
- foo : 'dag-cbor-bar'
74
- }
75
- ipfs . dag . put ( cbor , { format : 'dag-cbor' , hashAlg : 'sha2-256' } , ( err , cid ) => {
76
- expect ( err ) . to . not . exist ( )
77
- expect ( cid . codec ) . to . equal ( 'dag-cbor' )
78
- cid = cid . toBaseEncodedString ( 'base32' )
79
- expect ( cid ) . to . equal ( 'bafyreic6f672hnponukaacmk2mmt7vs324zkagvu4hcww6yba6kby25zce' )
80
- ipfs . dag . get ( cid , 'foo' , ( err , result ) => {
81
- expect ( err ) . to . not . exist ( )
82
- expect ( result . value ) . to . equal ( 'dag-cbor-bar' )
83
- done ( )
84
- } )
85
- } )
86
- } )
87
-
88
- it ( 'should be able to traverse from one dag-cbor node to another' , ( done ) => {
89
- const cbor1 = {
90
- foo : 'dag-cbor-bar'
91
- }
92
-
93
- ipfs . dag . put ( cbor1 , { format : 'dag-cbor' , hashAlg : 'sha2-256' } , ( err , cid1 ) => {
94
- expect ( err ) . to . not . exist ( )
95
-
96
- const cbor2 = {
97
- other : {
98
- '/' : cid1 . toBaseEncodedString ( 'base32' )
99
- }
100
- }
101
-
102
- ipfs . dag . put ( cbor2 , { format : 'dag-cbor' , hashAlg : 'sha2-256' } , ( err , cid2 ) => {
103
- expect ( err ) . to . not . exist ( )
104
-
105
- ipfs . dag . get ( cid2 , 'other/foo' , ( err , result ) => {
106
- expect ( err ) . to . not . exist ( )
107
- expect ( result . value ) . to . equal ( 'dag-cbor-bar' )
108
- done ( )
109
- } )
110
- } )
111
- } )
112
- } )
113
-
114
- it ( 'should be able to put and get a DAG node with format raw' , ( done ) => {
115
- const buf = Buffer . from ( [ 0 , 1 , 2 , 3 ] )
116
-
117
- ipfs . dag . put ( buf , {
118
- format : 'raw' ,
119
- hashAlg : 'sha2-256'
120
- } , ( err , cid ) => {
121
- expect ( err ) . to . not . exist ( )
122
-
123
- ipfs . dag . get ( cid , ( err , result ) => {
124
- expect ( err ) . to . not . exist ( )
125
- expect ( result . value ) . to . deep . equal ( buf )
126
- done ( )
127
- } )
128
- } )
129
- } )
130
-
131
71
it ( 'should callback with error when missing DAG resolver for multicodec from requested CID' , ( done ) => {
132
72
ipfs . block . put ( Buffer . from ( [ 0 , 1 , 2 , 3 ] ) , {
133
73
cid : new CID ( 'z8mWaJ1dZ9fH5EetPuRsj8jj26pXsgpsr' )
0 commit comments