Skip to content

feat: wire masternode engine methods to UniFFI bridge#31

Merged
xdustinface merged 3 commits into
v0.42-devfrom
claude/issue-29-20260313-2035
Mar 13, 2026
Merged

feat: wire masternode engine methods to UniFFI bridge#31
xdustinface merged 3 commits into
v0.42-devfrom
claude/issue-29-20260313-2035

Conversation

@xdustinface
Copy link
Copy Markdown
Owner

Summary

  • Add masternode_engine() async accessor to DashSpvClient
  • Wire get_masternode_count() to return real count from MasternodeListEngine
  • Wire get_masternodes() to return real MasternodeListEntry data mapped to MasternodeInfo
  • Comprehensive tests for masternode bridge methods

Closes #29

Test plan

  • Bridge tests pass for masternode methods
  • get_masternode_count returns 0 when engine not enabled
  • get_masternodes returns empty vec when engine not enabled

- Add `masternode_engine()` async accessor on `DashSpvClient` that
  returns `Option<Arc<RwLock<MasternodeListEngine>>>` (clone of field)
- Implement `SpvClient::get_masternode_count()`: reads the latest
  masternode list from the engine and returns the entry count; returns
  0 when masternodes are disabled or no list received yet
- Implement `SpvClient::get_masternodes()`: iterates the latest
  masternode list and maps `MasternodeListEntry` fields to `MasternodeInfo`
  (pro_reg_tx_hash → pro_tx_hash, service_address → address,
  is_valid → "Enabled"/"PoSeBanned"); pose_penalty/last_paid_height/
  registered_height default to 0 as they are not in the SML diff
- Replace stub bridge tests with no-engine and empty-engine variants
- Add DashSpvClient-level tests for masternode_engine() accessor and
  a populated-engine scenario using a manually constructed MasternodeList

Closes #29

Co-authored-by: Kevin Rombach <xdustinface@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@xdustinface xdustinface force-pushed the claude/issue-29-20260313-2035 branch from 33ba2f6 to 4b2f3b6 Compare March 13, 2026 20:51
@xdustinface xdustinface merged commit 29d6983 into v0.42-dev Mar 13, 2026
49 of 52 checks passed
@xdustinface xdustinface deleted the claude/issue-29-20260313-2035 branch March 13, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire up UniFFI masternode methods to MasternodeListEngine

1 participant