Repository navigation
test(wallet-core): add known-vector round-trip tests for provision_wallet/import_wallet - #398
Merged
Emmyt24 merged 2 commits intoSep 29, 2026
Conversation
…allet/import_wallet provision_wallet/import_wallet lacked a known-answer test vector proving a specific mnemonic derives a specific, independently-verifiable account, unlike the rigor already applied to raw derivation in derive.rs. Adds a cited test vector and round-trip tests. Two required tests are added to crates/wallet-core/src/provision.rs: - import_wallet_derives_the_expected_account_for_a_known_sep0005_test_vector Uses the published SEP-0005 Test 1 vector (no passphrase, 12-word mnemonic) from https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0005.md. The same vector is independently verified by js-stellar-base, go/txnbuild, and the Python stellar-sdk, plus derive.rs's own sep0005_account_0_matches_official_vector. Asserts import_wallet derives exactly GDRXE2BQUC3AZNPVFSCEZ76NJ3WWL25FYFK6RGZGIEKWE4SOOHSUJUJ6. - provision_wallet_returns_a_mnemonic_and_account_that_are_mutually_consistent_via_import_wallet Calls provision_wallet, then re-imports its mnemonic via import_wallet and asserts the account matches — proving the two functions are mutual inverses end-to-end. The two pre-existing tests are preserved and renamed for clarity: - provision_then_reopen_seed_yields_same_account → sealed_seed_opens_and_re_derives_same_account - import_reproduces_account_from_mnemonic → superseded by the explicit vector test above Closes Octo-Protocol-org#360
|
@daree-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…n-vector-roundtrip
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.
Summary
provision_walletandimport_walletincrates/wallet-core/src/provision.rslacked a known-answer test proving that a specific mnemonic derives a specific, independently-verifiable account address — unlike the rigor already applied to raw derivation inderive.rsvia SEP-0005's own test vectors. This PR closes that gap.What changed
crates/wallet-core/src/provision.rs— two new tests added, two existing tests renamed for clarity:import_wallet_derives_the_expected_account_for_a_known_sep0005_test_vectorUses the published SEP-0005 Test 1 vector (no passphrase, 12-word mnemonic):
derive.rs's ownsep0005_account_0_matches_official_vectortestimport_walletderives exactlyGDRXE2BQUC3AZNPVFSCEZ76NJ3WWL25FYFK6RGZGIEKWE4SOOHSUJUJ6from the known mnemonicprovision_wallet_returns_a_mnemonic_and_account_that_are_mutually_consistent_via_import_walletprovision_wallet, then re-imports the returned mnemonic viaimport_walletRenamed existing tests (no logic change)
provision_then_reopen_seed_yields_same_account→sealed_seed_opens_and_re_derives_same_accountimport_reproduces_account_from_mnemonic→ superseded by the explicit cited-vector test aboveTest vector citation
Tested
Closes #360