feat: distinguish Ed25519 and Smart Wallet authorization types#296
Open
Okorie2000-code wants to merge 1 commit into
Open
Conversation
- Add SignatureKind enum (Ed25519 / SmartWallet / Unknown) to auth_signature.rs - Add AuthSignatureInfo struct that combines kind, address, and decoded signatures - Add decode_auth_entry_signature_info() function returning AuthSignatureInfo - Add signature_kind() method to AddressCredential in auth.rs - Add render_auth_credential() renderer in renderers.rs for human-readable output - Ed25519: shows 'Ed25519' label, public key, and signature hex - Smart Wallet: shows 'Smart Wallet' label and contract ID - Export SignatureKind and AuthSignatureInfo from prism_core and decode module - Fix pre-existing duplicate pub mod decode_context; declaration in mod.rs - Add focused tests: SignatureKind detection, Ed25519/SmartWallet from XDR, contract ID extraction, invalid payload, source account, existing behavior Closes Toolbox-Lab#271
Contributor
|
@Okorie2000-code fix merge conflicts |
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
G...= Ed25519,C...= Smart Wallet).SignatureKindenum (Ed25519/SmartWallet/Unknown) andAuthSignatureInfostruct toauth_signature.rs.decode_auth_entry_signature_info()function that returns structured type information.signature_kind()method toAddressCredentialinauth.rs.render_auth_credential()torenderers.rs:SignatureKindandAuthSignatureInfofromprism_coreroot and decode module.pub mod decode_context;indecode/mod.rs.Tests Added
signature_kind_from_g_address_is_ed25519signature_kind_from_c_address_is_smart_walletsignature_kind_from_unknown_prefix_is_unknownsignature_kind_from_empty_address_is_unknownauth_signature_info_ed25519_from_account_addressauth_signature_info_smart_wallet_from_contract_addresscontract_id_extracted_for_smart_walletdecode_auth_entry_signature_info_invalid_payloaddecode_auth_entry_signature_info_source_account_returns_noneexisting_decode_auth_entry_signatures_unchangedaddress_credential_ed25519_kind_from_account_addressaddress_credential_smart_wallet_kind_from_contract_addressValidation
cargo fmt --all -- --check cargo check cargo testAll checks pass.
Closes #271