Skip to content

Commit f9f5fe6

Browse files
Update
1 parent 8d9e23d commit f9f5fe6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

javascript/engine-js/src/repo/sources/RegistryScriptURI.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import {ResolveResult, SourceInterface} from "./SourceInterface";
22
import {TokenScriptEngine} from "../../Engine";
3-
import * as fs from 'fs';
3+
import * as fs from 'fs/promises';
44

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');
77
};
88

9-
const overrideXML: string = loadFile('./ts.xml');
10-
119
/**
1210
* The ScriptURI source implement ethereum EIP-5169
1311
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-5169.md
@@ -44,7 +42,7 @@ export class RegistryScriptURI implements SourceInterface {
4442

4543
if (uri.includes("QmUY21P7eKY2p4NpU65Ma9gWq3UhLC3aYBDNAePEXzwgBe")) {
4644
return {
47-
xml: overrideXML,
45+
xml: await loadFile('./ts.xml'),
4846
sourceUrl: uri
4947
}
5048
}

0 commit comments

Comments
 (0)