Skip to content

Commit

Permalink
Merge pull request #31 from casper-ecosystem/dev/hotfix-for-textencoder
Browse files Browse the repository at this point in the history
reverted textencoder usage & version bump
  • Loading branch information
hoffmannjan authored Apr 13, 2021
2 parents 8062d76 + 493a6fc commit a930ecd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to casper-client-sdk.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.0.39

### Fixed

- Reverted usage of `TextEncoder` to support Node.js versions < 11.

## 1.0.38

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "casper-client-sdk",
"version": "1.0.38",
"version": "1.0.39",
"license": "Apache 2.0",
"description": "SDK to interact with the Casper blockchain",
"main": "dist/lib.node.js",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/byterepr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export function toBytesU512(u512: BigNumberish): Uint8Array {
* Serializes a string into an array of bytes.
*/
export function toBytesString(str: string): Uint8Array {
const arr = new TextEncoder().encode(str);
const arr = Uint8Array.from(Buffer.from(str));
return concat([toBytesU32(arr.byteLength), arr]);
}

Expand Down

0 comments on commit a930ecd

Please sign in to comment.