Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Solve for Issue 189 - RPCs in rpc.proto and server.rs for #214

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

cryptoryda
Copy link

@cryptoryda cryptoryda commented Jan 14, 2025

Fix for Issue #189

Description

This pull request addresses the implementation of the missing GetCastsByParent RPC and other related Get... RPCs in the snapchain project.

The following updates were made to resolve the issue and achieve feature parity with the existing hubs:

  • Added the missing GetCastsByParent RPC to rpc.proto with the necessary request and response definitions.
  • Implemented the server-side logic for handling the GetCastsByParent request in server.rs.
  • Updated cast_store.rs to properly handle the storage and retrieval of casts by their parent.
  • Verified the functionality by adding and running relevant test cases for this new RPC.

Changes Made

Updated rpc.proto

  • Added the GetCastsByParent RPC definition, following the existing structure:
    proto
    rpc GetCastsByParent(CastsByParentRequest) returns (MessagesResponse);

Updated server.rs

  • Implemented the logic for get_casts_by_parent to process the request and return the appropriate response.
  • Ensured consistency with other existing RPC implementations, reusing utility functions and structures where applicable.

Updated cast_store.rs

  • Added functionality to handle storing and retrieving casts by their parent, ensuring the new RPC operates as expected.
  • Integrated with the existing cast storage logic to ensure data consistency and minimize code duplication.

How It Solves the Issue

The changes add the missing GetCastsByParent RPC to the project and update cast_store.rs to handle the necessary data queries. This enables clients to query casts by their parent, bringing the functionality in line with other similar Get... RPCs and ensuring completeness of the API.

Checklist

  • Added missing GetCastsByParent RPC to rpc.proto.
  • Implemented GetCastsByParent RPC logic in server.rs.
  • Updated cast_store.rs to handle casts by parent.
  • Verified with unit and integration tests.
  • Reviewed for code quality and adherence to project guidelines.

Reused existing utility functions to maintain code consistency with other rpcs

integrated proper error handling and response formatting
added the necessary functionality to store and fetch casts by their parent identifier
@cryptoryda
Copy link
Author

@sanjayprabhu Feel free to let me know if you have any questions.

@cryptoryda cryptoryda changed the title Solve for Issue 189 - RPCs in rpc.proto and server.rs for Fix: Solve for Issue 189 - RPCs in rpc.proto and server.rs for Jan 14, 2025
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