@@ -105,7 +105,7 @@ module.exports = function weaveDrive(mod, FS) {
105
105
106
106
var bytesLength = result . length ;
107
107
108
- var node = FS . createDataFile ( '/' , 'block/' + id , result , true , false ) ;
108
+ var node = FS . createDataFile ( '/' , 'block/' + id , Buffer . from ( result , 'utf-8' ) , true , false ) ;
109
109
110
110
var stream = FS . open ( '/block/' + id , 'r' ) ;
111
111
return stream ;
@@ -135,7 +135,7 @@ module.exports = function weaveDrive(mod, FS) {
135
135
//.then(x => (console.error(x), x))
136
136
. then ( x => JSON . stringify ( x ) ) ;
137
137
138
- var node = FS . createDataFile ( '/' , 'tx/' + id , result , true , false ) ;
138
+ var node = FS . createDataFile ( '/' , 'tx/' + id , Buffer . from ( result , 'utf-8' ) , true , false ) ;
139
139
var stream = FS . open ( '/tx/' + id , 'r' ) ;
140
140
return stream ;
141
141
} ,
@@ -220,7 +220,7 @@ module.exports = function weaveDrive(mod, FS) {
220
220
if ( result === 'No results' ) {
221
221
return result
222
222
}
223
- FS . createDataFile ( '/' , 'tx2/' + id , result , true , false ) ;
223
+ FS . createDataFile ( '/' , 'tx2/' + id , Buffer . from ( result , 'utf-8' ) , true , false ) ;
224
224
var stream = FS . open ( '/tx2/' + id , 'r' ) ;
225
225
226
226
return stream ;
0 commit comments