test: Enable API tests and standardize byte array methods#885
Draft
Abeeujah wants to merge 1 commit into
Draft
Conversation
Remove FIXME comments in `tests/api.rs` and enable the corresponding compilation checks by implementing missing byte conversion methods. Changes include: - `XOnlyPublicKey`: Rename `from_byte_array` to `try_from_byte_array` and modify `from_byte_array`. - `Keypair`: Add `from_secret_bytes`, `as_secret_bytes`, and `AsRef<[u8]>`. - `ellswift::ElligatorSwift`: Add `from_byte_array` and `to_byte_array`. - `ecdh::SharedSecret`: Add `from_secret_bytes` and `as_secret_bytes`. - `ellswift::ElligatorSwiftSharedSecret`: Add `AsRef<[u8]>` and `non_secure_erase`. This ensures consistent API patterns across these types and satisfies the requirements in `tests/api.rs`.
Member
|
Thanks for the contribution! This is too many changes in a single patch. Can you split it out so there are multiple small patches that do a single thing. API design is non-trivial so we want to make sure we get it right! |
This was referenced Feb 13, 2026
Contributor
Author
|
Hi @tcharding Thank you for mentioning, I've taken the work done so far into individual PRs which mentions this, happy to see how it proceeds from here on |
apoelstra
added a commit
that referenced
this pull request
Feb 13, 2026
e2d53a0 feat: implement byte array conversions for ElligatorSwift (Abeeujah) Pull request description: ## Description This PR implements the missing byte array conversion methods for `ElligatorSwift` to enable standard round-trip testing. Previously, the `ElligatorSwift` type lacked the necessary interface to satisfy the `bytes_rtt_test!` macro, leading to a pending `FIXME` in the test suite. ### Changes - **Added `ElligatorSwift::to_byte_array`**: Extracts the underlying 64-byte array from the FFI wrapper. - **Added `ElligatorSwift::from_byte_array`**: Constructs an `ElligatorSwift` instance from a 64-byte array. - **Enabled RTT Test**: Activated the `rtt_g` test case and removed the associated `FIXME` comment. Child #885 References #859 ACKs for top commit: apoelstra: ACK e2d53a0; successfully ran local tests; short and sweet Tree-SHA512: 1fdca66d238f3ec16dd4049dad2998e1836f1def982b2649a87c0b081b882a81287c0ebc39d3705a5d0e0e1a9aac074bd3e11cd25b2f8ea37a44f99b6db73e96
Member
|
At the very least this needs a rebase. |
Abeeujah
marked this pull request as draft
February 14, 2026 09:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove FIXME comments in
tests/api.rsand enable the corresponding compilation checks by implementing missing byte conversion methods.Changes include:
XOnlyPublicKey: Renamefrom_byte_arraytotry_from_byte_arrayand modifyfrom_byte_array.Keypair: Addfrom_secret_bytes,as_secret_bytes, andAsRef<[u8]>.ellswift::ElligatorSwift: Addfrom_byte_arrayandto_byte_array.ecdh::SharedSecret: Addfrom_secret_bytesandas_secret_bytes.ellswift::ElligatorSwiftSharedSecret: AddAsRef<[u8]>andnon_secure_erase.fixes #859