Skip to content

Commit

Permalink
fixed Pubkey panic case
Browse files Browse the repository at this point in the history
  • Loading branch information
ultd committed Jul 21, 2023
1 parent bfd96b3 commit 1964496
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/pubkey.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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].* };
}
Expand Down

0 comments on commit 1964496

Please sign in to comment.