Renamed Bytes32-based coding functions.

This commit is contained in:
Richard Moore 2022-09-30 05:54:00 -04:00
parent fa87757253
commit 9771b851f8
3 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ import {
import type { BytesLike } from "../utils/index.js"; import type { BytesLike } from "../utils/index.js";
export function formatBytes32String(text: string): string { export function encodeBytes32String(text: string): string {
// Get the bytes // Get the bytes
const bytes = toUtf8Bytes(text); const bytes = toUtf8Bytes(text);
@ -18,7 +18,7 @@ export function formatBytes32String(text: string): string {
return zeroPadBytes(bytes, 32); return zeroPadBytes(bytes, 32);
} }
export function parseBytes32String(_bytes: BytesLike): string { export function decodeBytes32String(_bytes: BytesLike): string {
const data = getBytes(_bytes, "bytes"); const data = getBytes(_bytes, "bytes");
// Must be 32 bytes with a null-termination // Must be 32 bytes with a null-termination

View File

@ -7,7 +7,7 @@ export {
defaultAbiCoder defaultAbiCoder
} from "./abi-coder.js"; } from "./abi-coder.js";
export { formatBytes32String, parseBytes32String } from "./bytes32.js"; export { decodeBytes32String, encodeBytes32String } from "./bytes32.js";
export { export {
ConstructorFragment, ErrorFragment, EventFragment, Fragment, ConstructorFragment, ErrorFragment, EventFragment, Fragment,

View File

@ -6,7 +6,7 @@
export { version } from "./_version.js"; export { version } from "./_version.js";
export { export {
formatBytes32String, parseBytes32String, decodeBytes32String, encodeBytes32String,
AbiCoder, defaultAbiCoder, AbiCoder, defaultAbiCoder,
ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType, ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType,