feat: add offline one-sided transaction signing cucumber test#7743
feat: add offline one-sided transaction signing cucumber test#77430xPepeSilvia wants to merge 1 commit intotari-project:developmentfrom
Conversation
Add a complete integration test covering the full offline signing gRPC flow: create a view-only wallet, prepare a one-sided transaction for offline signing via gRPC, sign the transaction using exported spend keys (simulating an air-gapped signing device), broadcast the signed transaction via the view-only wallet, and verify the receiving wallet confirms the funds. New files: - OfflineSigning.feature: Cucumber scenario for the full flow - offline_signing_steps.rs: Step definitions for prepare, sign, broadcast Modified: - world.rs: Add offline_signing_prepared/signed state fields - steps/mod.rs: Register new step module Closes tari-project#7736 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces integration tests for the offline one-sided transaction signing flow. It adds new fields to the TariWorld struct to store transaction state, a Cucumber feature file outlining the full signing process, and the necessary step definitions to handle gRPC-based preparation, offline signing, and broadcasting. The review feedback suggests updating the Debug implementation for TariWorld to include the new fields for better observability and replacing a magic number with an enum variant in the gRPC request for improved readability.
| // Used for offline signing integration test — stores prepared and signed transaction JSON between steps. | ||
| pub offline_signing_prepared: Option<String>, | ||
| pub offline_signing_signed: Option<String>, |
There was a problem hiding this comment.
| address: receiver_wallet_address, | ||
| amount, | ||
| fee_per_gram: fee, | ||
| payment_type: 2, // ONE_SIDED_TO_STEALTH_ADDRESS |
There was a problem hiding this comment.
Using the raw integer 2 for payment_type is a magic number. It is better to use the generated enum variant for improved readability and maintainability.
| payment_type: 2, // ONE_SIDED_TO_STEALTH_ADDRESS | |
| payment_type: grpc::payment_recipient::PaymentType::OneSidedToStealthAddress as i32, |
Summary
PrepareOneSidedTransactionForSigning, signs offline usingsign_locked_transactionwith the exported spend key, broadcasts viaBroadcastSignedOneSidedTransaction, and verifies the receiver has confirmed fundsCloses #7736
Test plan
OfflineSigning.featurescenario passes end-to-end🤖 Generated with Claude Code