Skip to content

Commit

Permalink
refactor: get rid of bytes_to_hex.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jjleng authored and banool committed Sep 15, 2022
1 parent bbd6842 commit 5090886
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 84 deletions.
2 changes: 1 addition & 1 deletion ecosystem/typescript/sdk/src/aptos_account.ts
Expand Up @@ -4,8 +4,8 @@
import nacl from "tweetnacl";
import sha3 from "js-sha3";
import * as bip39 from "@scure/bip39";
import { bytesToHex } from "@noble/hashes/utils";
import { derivePath } from "./utils/hd-key";
import { bytesToHex } from "./bytes_to_hex.js";
import { HexString, MaybeHexString } from "./hex_string";
import * as Gen from "./generated/index";
import { Memoize } from "./utils";
Expand Down
35 changes: 0 additions & 35 deletions ecosystem/typescript/sdk/src/bytes_to_hex.test.ts

This file was deleted.

40 changes: 0 additions & 40 deletions ecosystem/typescript/sdk/src/bytes_to_hex.ts

This file was deleted.

2 changes: 1 addition & 1 deletion ecosystem/typescript/sdk/src/hex_string.ts
@@ -1,7 +1,7 @@
// Copyright (c) Aptos
// SPDX-License-Identifier: Apache-2.0

import { bytesToHex, hexToBytes } from "./bytes_to_hex.js";
import { bytesToHex, hexToBytes } from "@noble/hashes/utils";
import { HexEncodedBytes } from "./generated";

// eslint-disable-next-line no-use-before-define
Expand Down
1 change: 0 additions & 1 deletion ecosystem/typescript/sdk/src/index.ts
Expand Up @@ -4,7 +4,6 @@
// All parts of our package are accessible as imports, but we re-export our higher level API here for convenience
export * from "./aptos_account";
export * from "./aptos_client";
export * from "./bytes_to_hex.js";
export * from "./coin_client";
export * from "./faucet_client";
export * from "./hex_string";
Expand Down
Expand Up @@ -3,7 +3,7 @@

/* eslint-disable max-len */
import nacl from "tweetnacl";
import { bytesToHex } from "../bytes_to_hex.js";
import { bytesToHex, hexToBytes } from "@noble/hashes/utils";
import { bcsSerializeUint64, bcsToBytes, Bytes } from "./bcs";
import { HexString } from "../hex_string";

Expand Down Expand Up @@ -31,10 +31,6 @@ const ADDRESS_4 = "0x01";
const PRIVATE_KEY = "9bf49a6a0755f953811fce125f2683d50429c3bb49e074147e0089a52eae155f";
const TXN_EXPIRE = "18446744073709551615";

function hexToBytes(hex: string) {
return new HexString(hex).toUint8Array();
}

function hexSignedTxn(signedTxn: Uint8Array): string {
return bytesToHex(signedTxn);
}
Expand Down
Expand Up @@ -11,7 +11,7 @@
import path from "path";
import nacl from "tweetnacl";
import fs from "fs";
import { bytesToHex } from "../bytes_to_hex.js";
import { bytesToHex } from "@noble/hashes/utils";
import {
AccountAddress,
ChainId,
Expand Down

0 comments on commit 5090886

Please sign in to comment.