-
Notifications
You must be signed in to change notification settings - Fork 2
Fix Zig 0.15.1 API compatibility issues and enable CLI enhancement foundation #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3c844aa
2df6204
228f6b5
06316e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,11 +12,13 @@ pub const TransactionSigner = struct { | |
| return error.InvalidSecretKeyLength; | ||
| } | ||
|
|
||
| // Create Ed25519 keypair from 32-byte seed | ||
| var seed: [32]u8 = undefined; | ||
| @memcpy(&seed, secret_key[0..32]); | ||
|
|
||
| const keypair = try ed25519.KeyPair.create(seed); | ||
| // Create Ed25519 keypair from 32-byte seed - need to extend to 64 bytes for SecretKey | ||
| var full_seed: [64]u8 = undefined; | ||
| @memcpy(full_seed[0..32], secret_key[0..32]); | ||
| @memset(full_seed[32..64], 0); // Zero pad the rest | ||
|
|
||
| const secret_key_obj = try ed25519.SecretKey.fromBytes(full_seed); | ||
| const keypair = try ed25519.KeyPair.fromSecretKey(secret_key_obj); | ||
|
|
||
| return TransactionSigner{ | ||
| .allocator = allocator, | ||
|
|
@@ -55,7 +57,7 @@ pub const TransactionSigner = struct { | |
| size, | ||
| timestamp, | ||
| nonce, | ||
| std.fmt.fmtSliceHexLower(&self.keypair.public_key.bytes), | ||
| std.fmt.bytesToHex(&self.keypair.public_key.bytes, .lower), | ||
|
||
| } | ||
| ); | ||
|
|
||
|
|
@@ -95,7 +97,7 @@ pub const TransactionSigner = struct { | |
| order_id, | ||
| timestamp, | ||
| nonce, | ||
| std.fmt.fmtSliceHexLower(&self.keypair.public_key.bytes), | ||
| std.fmt.bytesToHex(&self.keypair.public_key.bytes, .lower), | ||
|
||
| } | ||
| ); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The std.fmt.bytesToHex function in Zig 0.15.1 returns a formatter object, not a string slice. When used inside a format string with the {s} specifier, it may not work as expected. Consider using std.fmt.fmtSliceHexLower (if available) or allocating a buffer and using std.fmt.bufPrint with a proper format specifier like {} instead of {s}.