File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 11.{
22 .fingerprint = 0xdc47aff950fd68c0 ,
33 .name = .solana_program_sdk ,
4- .version = "0.16.1 " ,
4+ .version = "0.16.2 " ,
55 .minimum_zig_version = "0.14.0" ,
66
77 // This field is optional.
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ pub const PublicKey = extern struct {
4747 }
4848
4949 pub fn equals (self : PublicKey , other : PublicKey ) bool {
50- return self .bytes == other .bytes ;
50+ return std . mem . eql ( u8 , & self .bytes , & other .bytes ) ;
5151 }
5252
5353 pub fn isPointOnCurve (self : PublicKey ) bool {
@@ -238,3 +238,10 @@ test "public_key: comptime find program address" {
238238 try testing .expectFmt ("2PjSSVURwJV4o9wz1BDVwwddvcUCuF1NKFpcQBF9emYJ" , "{}" , .{pda .address });
239239 try comptime testing .expectEqual (@as (u8 , 255 ), pda .bump_seed [0 ]);
240240}
241+
242+ test "public_key: equality" {
243+ const id = comptime PublicKey .comptimeFromBase58 ("11111111111111111111111111111111" );
244+ const id2 = comptime PublicKey .comptimeFromBase58 ("11111111111111111111111111111111" );
245+ try testing .expectEqual (id , id2 );
246+ try testing .expect (id .equals (id2 ));
247+ }
You can’t perform that action at this time.
0 commit comments