Skip to content

Fix API compatibility issues in RPC implementations#65

Open
alchemistkay wants to merge 1 commit intopurpleprotocol:mainfrom
alchemistkay:fix-rpc-api-compatibility
Open

Fix API compatibility issues in RPC implementations#65
alchemistkay wants to merge 1 commit intopurpleprotocol:mainfrom
alchemistkay:fix-rpc-api-compatibility

Conversation

@alchemistkay
Copy link
Contributor

Summary

This PR fixes compilation errors in the RPC implementations (GetBlockchainInfo, GetBlockHash, and GetBlockStats) that were introduced after PR #63 was merged due to upstream API changes.

Changes

  • Update mempool access to use tx_map and current_size_bytes fields
  • Update shard method calls to use backend accessor
  • Handle BlockHeader.hash() now returning Option<&Hash256>
  • Update BlockData field access (transactions renamed to txs)
  • Update BlockHeader field access (pos renamed to height)
  • Remove timestamp field usage (removed from BlockHeader in protocol update)
  • Remove transaction fee field usage (no longer stored in blocks)

Testing

All 722 tests pass successfully after these changes.

Related

Fixes compilation errors introduced after #63 was merged.

This commit fixes compilation errors in the RPC implementations (GetBlockchainInfo,
GetBlockHash, and GetBlockStats) that were introduced after PR purpleprotocol#63 was merged due to
upstream API changes.

Changes:
- Update mempool access to use tx_map and current_size_bytes fields
- Update shard method calls to use backend accessor
- Handle BlockHeader.hash() now returning Option<&Hash256>
- Update BlockData field access (transactions renamed to txs)
- Update BlockHeader field access (pos renamed to height)
- Remove timestamp field usage (removed from BlockHeader in protocol update)
- Remove transaction fee field usage (no longer stored in blocks)

All 722 tests pass successfully after these changes.
alchemistkay added a commit to alchemistkay/purplecoin that referenced this pull request Oct 30, 2025
This commit implements three previously stubbed mempool RPC commands and
includes API compatibility fixes similar to PR purpleprotocol#65.

New RPC implementations:
- GetMempoolInfo: Returns mempool statistics (transaction count, total size)
- GetRawMempool: Returns all transaction hashes from the entire mempool
- GetRawMempoolShard: Returns transaction hashes filtered by chain_id/shard

API compatibility fixes:
- Update mempool access to use tx_map and current_size_bytes fields
- Update shard method calls to use backend accessor
- Handle BlockHeader.hash() now returning Option<&Hash256>
- Update BlockData field access (transactions renamed to txs)
- Update BlockHeader field access (pos renamed to height)
- Remove timestamp field usage (removed from BlockHeader in protocol update)
- Remove transaction fee field usage (no longer stored in blocks)

New struct added:
- RawMempool: Contains transaction_hashes vector and total_transactions count
alchemistkay added a commit to alchemistkay/purplecoin that referenced this pull request Oct 30, 2025
This commit implements three previously stubbed mempool RPC commands and
includes API compatibility fixes similar to PR purpleprotocol#65.

New RPC implementations:
- GetMempoolInfo: Returns mempool statistics (transaction count, total size)
- GetRawMempool: Returns all transaction hashes from the entire mempool
- GetRawMempoolShard: Returns transaction hashes filtered by chain_id/shard

API compatibility fixes:
- Update mempool access to use tx_map and current_size_bytes fields
- Update shard method calls to use backend accessor
- Handle BlockHeader.hash() now returning Option<&Hash256>
- Update BlockData field access (transactions renamed to txs)
- Update BlockHeader field access (pos renamed to height)
- Remove timestamp field usage (removed from BlockHeader in protocol update)
- Remove transaction fee field usage (no longer stored in blocks)

New struct added:
- RawMempool: Contains transaction_hashes vector and total_transactions count
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.

1 participant