• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tari-project / tari / 15641608958

13 Jun 2025 06:36PM UTC coverage: 71.528% (-0.5%) from 72.049%
15641608958

push

github

web-flow
feat: integrated address support for Ledger (#7198)

## Description
This PR implements integrated address support for the
minotari_ledger_wallet application, allowing the Ledger hardware wallet
to handle addresses with embedded payment IDs. The implementation
supports variable-sized addresses from 67 bytes (standard dual
addresses) up to 323 bytes (with maximum 256-byte payment IDs).

### Key Changes:
- Updated address size constants and validation to support
variable-length addresses
- Modified address parsing functions to accept `&[u8]` instead of
fixed-size arrays
- Added payment ID extraction utility functions
- Enhanced transaction confirmation UI to display payment ID information
- Updated protocol data structures to include address size prefixes
- Added comprehensive test coverage and documentation

## Motivation and Context
Integrated addresses enable users to embed payment identifiers directly
within Tari addresses, improving payment tracking and reconciliation.
This feature is particularly important for exchanges, merchants, and
other services that need to associate payments with specific orders or
accounts. The Ledger wallet previously only supported fixed 67-byte dual
addresses, limiting its utility for these use cases.

## How Has This Been Tested?
- All existing unit tests pass without modification
- Added comprehensive new test suite covering:
  - Standard dual address compatibility (67 bytes)
  - Integrated addresses with various payment ID sizes
  - Boundary condition testing (min/max sizes)
  - Invalid address size rejection
  - Payment ID extraction and validation
- Compilation verified with `cargo check` and `cargo clippy`
- Both common and comms modules tested successfully

## What process can a PR reviewer use to test or verify this change?
1. **Compilation Check**: Run `cargo check` in
`applications/minotari_ledger_wallet/` to verify no compilation errors
2. **Unit Tests**: Run `cargo test` in both `common/` and `comms/`
subdire... (continued)

97 of 118 new or added lines in 3 files covered. (82.2%)

643 existing lines in 27 files now uncovered.

81159 of 113465 relevant lines covered (71.53%)

564889.43 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/base_layer/core/src/base_node/proto/rpc.rs
1
//  Copyright 2020, The Tari Project
2
//
3
//  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
4
//  following conditions are met:
5
//
6
//  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
7
//  disclaimer.
8
//
9
//  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
10
//  following disclaimer in the documentation and/or other materials provided with the distribution.
11
//
12
//  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
13
//  products derived from this software without specific prior written permission.
14
//
15
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
16
//  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
//  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18
//  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
//  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20
//  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21
//  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22

23
use std::convert::{TryFrom, TryInto};
24

25
use tari_utilities::ByteArray;
26

27
use crate::{blocks::Block, mempool::FeePerGramStat, proto::base_node as proto};
28

29
impl TryFrom<Block> for proto::BlockBodyResponse {
30
    type Error = String;
31

UNCOV
32
    fn try_from(block: Block) -> Result<Self, Self::Error> {
×
UNCOV
33
        Ok(Self {
×
UNCOV
34
            hash: block.hash().to_vec(),
×
UNCOV
35
            body: Some(block.body.try_into()?),
×
36
        })
UNCOV
37
    }
×
38
}
39

40
impl From<Vec<FeePerGramStat>> for proto::GetMempoolFeePerGramStatsResponse {
41
    fn from(stats: Vec<FeePerGramStat>) -> Self {
×
42
        Self {
×
43
            stats: stats.into_iter().map(Into::into).collect(),
×
44
        }
×
45
    }
×
46
}
47

48
impl From<FeePerGramStat> for proto::MempoolFeePerGramStat {
49
    fn from(stat: FeePerGramStat) -> Self {
×
50
        Self {
×
51
            order: stat.order,
×
52
            min_fee_per_gram: stat.min_fee_per_gram.as_u64(),
×
53
            avg_fee_per_gram: stat.avg_fee_per_gram.as_u64(),
×
54
            max_fee_per_gram: stat.max_fee_per_gram.as_u64(),
×
55
        }
×
56
    }
×
57
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc