From 1964496ab8bccec79ad535147468cecbf36daa21 Mon Sep 17 00:00:00 2001 From: ultd Date: Fri, 21 Jul 2023 08:16:19 -0500 Subject: [PATCH] fixed Pubkey panic case --- src/core/pubkey.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/pubkey.zig b/src/core/pubkey.zig index f2591877b..01fe8155d 100644 --- a/src/core/pubkey.zig +++ b/src/core/pubkey.zig @@ -79,8 +79,8 @@ pub const Pubkey = struct { return Self{ .data = bytes[0..32].*, .cached_str = null }; } var written = encoder.encode(&bytes, &dest) catch @panic("could not encode pubkey"); - if (written != 44) { - std.debug.panic("written is not 44, written: {}, dest: {any}, bytes: {any}", .{ written, dest, bytes }); + if (written > 44) { + std.debug.panic("written is > 44, written: {}, dest: {any}, bytes: {any}", .{ written, dest, bytes }); } return Self{ .data = bytes[0..32].*, .cached_str = dest[0..44].* }; }