diff --git a/bindings/napi/blst.zig b/bindings/napi/blst.zig index 8a1384f8e..5a75b7670 100644 --- a/bindings/napi/blst.zig +++ b/bindings/napi/blst.zig @@ -136,10 +136,10 @@ pub const PublicKey = struct { pub fn toBytes(self: *const PublicKey, compress: ?js.Boolean) !js.Uint8Array { if (try boolOrDefault(compress, true)) { const bytes = self.raw.compress(); - return js.Uint8Array.from(bytes[0..]); + return js.Uint8Array.fromExternal(bytes[0..]); } const bytes = self.raw.serialize(); - return js.Uint8Array.from(bytes[0..]); + return js.Uint8Array.fromExternal(bytes[0..]); } pub fn toHex(self: *const PublicKey, compress: ?js.Boolean) !js.String { @@ -214,10 +214,10 @@ pub const Signature = struct { pub fn toBytes(self: *const Signature, compress: ?js.Boolean) !js.Uint8Array { if (try boolOrDefault(compress, true)) { const bytes = self.raw.compress(); - return js.Uint8Array.from(bytes[0..]); + return js.Uint8Array.fromExternal(bytes[0..]); } const bytes = self.raw.serialize(); - return js.Uint8Array.from(bytes[0..]); + return js.Uint8Array.fromExternal(bytes[0..]); } pub fn toHex(self: *const Signature, compress: ?js.Boolean) !js.String { @@ -295,9 +295,9 @@ pub const SecretKey = struct { } /// Serializes the SecretKey to bytes (32 bytes). - pub fn toBytes(self: *const SecretKey) js.Uint8Array { + pub fn toBytes(self: *const SecretKey) !js.Uint8Array { const bytes = self.raw.serialize(); - return js.Uint8Array.from(bytes[0..]); + return js.Uint8Array.fromExternal(bytes[0..]); } pub fn toHex(self: *const SecretKey) !js.String { diff --git a/build.zig.zon b/build.zig.zon index 29ace6b05..d7a5737d9 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -36,8 +36,8 @@ .hash = "zig_yaml-0.1.0-C1161kFWAwDxjKAFmklKwWVDvz2mmq0Q__bDhGGjeyd3", }, .zapi = .{ - .url = "git+https://github.com/chainsafe/zapi?ref=zapi-v2.0.0#f9fa8b0237352326e9f970b62588b6af01e3e384", - .hash = "zapi-2.0.0-rIqzUcc3BABKRuJlzpYNtiMVCOFybuVSGOLmk0KOCeel", + .url = "git+https://github.com/chainsafe/zapi?ref=zapi-v2.1.0#c5c877af9742d9d7fd6cab2ce6fec698817d56cd", + .hash = "zapi-2.1.0-rIqzUbxNBADOW16nSYQfUOtib1TgC8PxbR4ggN6ezYfA", }, .zbench = .{ .url = "git+https://github.com/hendriknielaender/zBench#b2b89c475e3ef1bb2bd71255c80478a82d3e0ca8",