Skip to content

test(canton): cover template suffix matching near-misses #772

@Pessina

Description

@Pessina

Follow-up from PR #740.

Code:

/// Check if a template ID matches a given suffix at a module boundary.
/// Requires the suffix to be preceded by `:` (package separator) or match exactly.
///
/// TODO(test): every event gets filtered through this — a bug means events are
/// silently ignored. Test exact match ("Signer:Signer"), prefix match
/// ("abc123:Signer:Signer"), and near-misses ("FakeSigner:Signer",
/// "Signer:SignerExtra").
pub fn template_suffix_matches(template_id: &str, suffix: &str) -> bool {

Context: every Canton event filter depends on template_suffix_matches. Add tests for exact match (Signer:Signer), package-prefixed match (abc123:Signer:Signer), and near-misses like FakeSigner:Signer and Signer:SignerExtra so malformed template IDs are not silently accepted or valid events ignored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions