From 465edb8f3fcf82ec01fa6b2da0a64c2601004e8f Mon Sep 17 00:00:00 2001 From: rouzwelt Date: Thu, 16 Nov 2023 20:04:09 +0000 Subject: [PATCH] update --- README.md | 2 +- client/src/browserClient.ts | 12 +++++++----- server/package-lock.json | 30 +++++++++++++++--------------- server/package.json | 2 +- 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index b0ffff8..a144c02 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ It also includes an End-to-End test. ## Introduction -Rain Language server works for rain files with `.rain` extentions, example: +Rain Language server works for rain files with `.rain` extentions (utf8 encoded), example: ```rainlang @ dispair 0x78fd1edb0bdb928db6015990fecafbb964b44692e2d435693062dd4efc6254dd @ contmeta 0x56ffc3fc82109c33f1e1544157a70144fc15e7c6e9ae9c65a636fd165b1bc51c diff --git a/client/src/browserClient.ts b/client/src/browserClient.ts index 96d7a25..58b8ca3 100644 --- a/client/src/browserClient.ts +++ b/client/src/browserClient.ts @@ -538,12 +538,14 @@ async function sleep(ms: number) { ); } +function stringToUint8Array(text: string): Uint8Array { + const encoder = new TextEncoder(); + return encoder.encode(text); +} + function uint8ArrayToString(uint8array: Uint8Array): string { - let str = ""; - for (let i = 0; i < uint8array.length; i++) { - str = str + String.fromCharCode(uint8array[i]); - } - return str; + const decoder = new TextDecoder(); + return decoder.decode(uint8array); } function hexlify(data: Uint8Array): string { diff --git a/server/package-lock.json b/server/package-lock.json index 3b37f25..e69bbf1 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "license": "CAL-1.0", "dependencies": { - "@rainprotocol/rainlang": "^5.1.0", + "@rainprotocol/rainlang": "^5.1.1", "vscode-languageserver": "^8.1.0" }, "devDependencies": { @@ -992,9 +992,9 @@ } }, "node_modules/@rainprotocol/meta": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@rainprotocol/meta/-/meta-3.0.4.tgz", - "integrity": "sha512-9agcyByUFbrY9kQW9bjACWe4/0IkZmQQHxd1EizhyieiYStuD5d1Oc8u+A3IA65mRqkkJidSzKtbl8ES0TujXQ==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@rainprotocol/meta/-/meta-3.0.7.tgz", + "integrity": "sha512-xp1ctfZaXIXaLgI796uGH9m3IohKmavYnFO2gqiWj1uuHU4TaiVpfrExpo3UhQHN5WLpdZ4HSXjFlmPzCUBgag==", "dependencies": { "cbor-web": "^9.0.0", "ethers": "^5.7.2", @@ -1004,14 +1004,14 @@ } }, "node_modules/@rainprotocol/rainlang": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@rainprotocol/rainlang/-/rainlang-5.1.0.tgz", - "integrity": "sha512-zyi6qrtv5uVj66r53HOF6Jwi2mMPYuDKm6Tcayb+Y3arKtRwThaYVoPbsuc37P6CmjOIIhJuk206a9bYnjEZmA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@rainprotocol/rainlang/-/rainlang-5.1.1.tgz", + "integrity": "sha512-Nlm3FUk0jqYpwpCof8biIu6OsrCsgZwTA997KkuQKOEMn5p+w9NAF/N62snMdkOsBHCy2ZfbKTEoXesBmAly4A==", "dependencies": { "@ethereumjs/evm": "^2.0.0", "@ethereumjs/util": "^9.0.0", "@ethereumjs/vm": "^7.0.0", - "@rainprotocol/meta": "^3.0.4", + "@rainprotocol/meta": "^3.0.7", "commander": "^11.0.0", "ethers": "^5.7.2", "magic-string": "^0.30.0", @@ -2202,9 +2202,9 @@ "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==" }, "@rainprotocol/meta": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@rainprotocol/meta/-/meta-3.0.4.tgz", - "integrity": "sha512-9agcyByUFbrY9kQW9bjACWe4/0IkZmQQHxd1EizhyieiYStuD5d1Oc8u+A3IA65mRqkkJidSzKtbl8ES0TujXQ==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@rainprotocol/meta/-/meta-3.0.7.tgz", + "integrity": "sha512-xp1ctfZaXIXaLgI796uGH9m3IohKmavYnFO2gqiWj1uuHU4TaiVpfrExpo3UhQHN5WLpdZ4HSXjFlmPzCUBgag==", "requires": { "cbor-web": "^9.0.0", "ethers": "^5.7.2", @@ -2214,14 +2214,14 @@ } }, "@rainprotocol/rainlang": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@rainprotocol/rainlang/-/rainlang-5.1.0.tgz", - "integrity": "sha512-zyi6qrtv5uVj66r53HOF6Jwi2mMPYuDKm6Tcayb+Y3arKtRwThaYVoPbsuc37P6CmjOIIhJuk206a9bYnjEZmA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@rainprotocol/rainlang/-/rainlang-5.1.1.tgz", + "integrity": "sha512-Nlm3FUk0jqYpwpCof8biIu6OsrCsgZwTA997KkuQKOEMn5p+w9NAF/N62snMdkOsBHCy2ZfbKTEoXesBmAly4A==", "requires": { "@ethereumjs/evm": "^2.0.0", "@ethereumjs/util": "^9.0.0", "@ethereumjs/vm": "^7.0.0", - "@rainprotocol/meta": "^3.0.4", + "@rainprotocol/meta": "^3.0.7", "commander": "^11.0.0", "ethers": "^5.7.2", "magic-string": "^0.30.0", diff --git a/server/package.json b/server/package.json index f63db30..c8fca42 100644 --- a/server/package.json +++ b/server/package.json @@ -15,7 +15,7 @@ "url": "https://github.com/rainprotocol/rainlang-vscode/issues" }, "dependencies": { - "@rainprotocol/rainlang": "^5.1.0", + "@rainprotocol/rainlang": "^5.1.1", "vscode-languageserver": "^8.1.0" }, "devDependencies": {