File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
javascript/engine-js/src/repo/sources Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1
1
import { ResolveResult , SourceInterface } from "./SourceInterface" ;
2
2
import { TokenScriptEngine } from "../../Engine" ;
3
- import * as fs from 'fs' ;
3
+ import * as fs from 'fs/promises ' ;
4
4
5
- const loadFile = ( filePath : string ) : string => {
6
- return fs . readFileSync ( filePath , 'utf-8' ) ;
5
+ const loadFile = async ( filePath : string ) : Promise < string > => {
6
+ return fs . readFile ( filePath , 'utf-8' ) ;
7
7
} ;
8
8
9
- const overrideXML : string = loadFile ( './ts.xml' ) ;
10
-
11
9
/**
12
10
* The ScriptURI source implement ethereum EIP-5169
13
11
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-5169.md
@@ -44,7 +42,7 @@ export class RegistryScriptURI implements SourceInterface {
44
42
45
43
if ( uri . includes ( "QmUY21P7eKY2p4NpU65Ma9gWq3UhLC3aYBDNAePEXzwgBe" ) ) {
46
44
return {
47
- xml : overrideXML ,
45
+ xml : await loadFile ( './ts.xml' ) ,
48
46
sourceUrl : uri
49
47
}
50
48
}
You can’t perform that action at this time.
0 commit comments