Skip to content
This repository was archived by the owner on Jul 6, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/utils/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export function bytes32ToString(value: string): string {
}

export function stringToBytes32(value: string): string {
if (value.length > 32) {
throw new PolymathError({ message: 'String can be a maximum 32 characters long', code: ErrorCode.InvalidLength });
}
return ethersUtils.formatBytes32String(value);
}

Expand Down