Skip to content

nip55: add round-trip test for AndroidSigningRateLimiterStorage encrypted-prefs adapter #313

@kwsantiago

Description

@kwsantiago

Gap

AndroidSigningRateLimiterStorage (app/src/main/kotlin/io/privkey/keep/nip55/AndroidSigningRateLimiterStorage.kt) is the SigningRateLimiterStorage adapter the Rust persistent SigningRateLimiter calls back into for every auto-sign request. It has no test coverage for its load / save / remove / clear round-trip through KeystoreEncryptedPrefs.

The ~224 lines of Kotlin velocity logic this replaced had no Android tests either (that coverage now lives in Rust), so an encoding or persistence regression in the adapter, the exact seam that gates auto-signing, would currently ship silently.

Proposed

Add an instrumented round-trip test against a real KeystoreEncryptedPrefs (or an in-memory SharedPreferences fake) covering:

  • save then load returns the stored value
  • load of an absent key returns null
  • remove then load returns null
  • clear wipes all entries
  • durability: values written via save (now commit()) survive a fresh adapter instance

Mirrors #309 (the audit-chain FFI-seam round-trip test).

Context

Introduced by the persistent-limiter refactor (branch nip55-persistent-limiter-android, commit e40c899). Surfaced during PR review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    easynip55NIP-55 signer protocolp3Lowest Priority

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions