We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5e0374 commit 0eaab37Copy full SHA for 0eaab37
packages/thirdweb/src/utils/encoding/helpers/role-bytes.test.ts
@@ -0,0 +1,11 @@
1
+import { describe, expect, it } from "vitest";
2
+import { roleBytes } from "./role-bytes.js";
3
+
4
+describe("roleBytes", () => {
5
+ it('should calculate the value of lister role', () => {
6
+ expect(roleBytes("LISTER_ROLE"))
7
+ .toBe(
8
+ "0xf94103142c1baabe9ac2b5d1487bf783de9e69cfeea9a72f5c9c94afd7877b8c"
9
+ );
10
+ });
11
+});
packages/thirdweb/src/utils/encoding/helpers/role-bytes.ts
@@ -9,6 +9,6 @@ import { toBytes } from "../to-bytes.js";
* @example
* const AdminRole = roleBytes("ADMIN_ROLE");
*/
12
-export const roleBytes = (role: string) => {
+export const roleBytes = (role: string): `0x${string}` => {
13
return keccak256(toBytes(role));
14
}
0 commit comments