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 1
1
.{
2
2
.fingerprint = 0xdc47aff950fd68c0 ,
3
3
.name = .solana_program_sdk ,
4
- .version = "0.16.1 " ,
4
+ .version = "0.16.2 " ,
5
5
.minimum_zig_version = "0.14.0" ,
6
6
7
7
// This field is optional.
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ pub const PublicKey = extern struct {
47
47
}
48
48
49
49
pub fn equals (self : PublicKey , other : PublicKey ) bool {
50
- return self .bytes == other .bytes ;
50
+ return std . mem . eql ( u8 , & self .bytes , & other .bytes ) ;
51
51
}
52
52
53
53
pub fn isPointOnCurve (self : PublicKey ) bool {
@@ -238,3 +238,10 @@ test "public_key: comptime find program address" {
238
238
try testing .expectFmt ("2PjSSVURwJV4o9wz1BDVwwddvcUCuF1NKFpcQBF9emYJ" , "{}" , .{pda .address });
239
239
try comptime testing .expectEqual (@as (u8 , 255 ), pda .bump_seed [0 ]);
240
240
}
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