Page MenuHomePhabricator

[native] implement 'FindUserIdentities' RPC in `native_rust_library`
ClosedPublic

Authored by will on May 10 2024, 9:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 7:44 AM
Unknown Object (File)
Wed, Nov 6, 8:03 AM
Unknown Object (File)
Oct 30 2024, 12:07 AM
Unknown Object (File)
Oct 17 2024, 12:43 PM
Unknown Object (File)
Oct 17 2024, 12:43 PM
Unknown Object (File)
Oct 17 2024, 12:43 PM
Unknown Object (File)
Oct 17 2024, 12:43 PM
Unknown Object (File)
Oct 17 2024, 12:43 PM
Subscribers

Details

Summary

This exposes FindUserIdentities to C++ through native rust library

Depends on D11952

Test Plan

Tested rpc calls on client later in stack

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/native_rust_library/src/identity/find_user_identities.rs
34–53 ↗(On Diff #40090)

Was wondering if we should move this somewhere else in native_rust_library. Unsure if we'll need this for any future rpcs

54–55 ↗(On Diff #40090)

Implemented this and the above structs as our protobuf generated Rust code lacks the Serialize trait.

will requested review of this revision.May 10 2024, 10:04 PM
bartek added inline comments.
native/native_rust_library/src/identity/find_user_identities.rs
34–53 ↗(On Diff #40090)

Perhaps you could move it to src/identity.rs but it can stay here as well.
If we need it somewhere else, we can always move it

54–55 ↗(On Diff #40090)

Alternatively, you could use type alias to avoid wrapping the hashmap in a struct

type UserIdentities = HashMap<String, Identity>;

// then this 
impl TryFrom<UserIdentitiesResponse> for UserIdentities { ... }
// becomes the same as
impl TryFrom<UserIdentitiesResponse> for HashMap<String, Identity> { ... }
This revision is now accepted and ready to land.May 13 2024, 12:09 AM
native/native_rust_library/src/identity/find_user_identities.rs
52 ↗(On Diff #40090)

We should add it to address @ashoat's comment in https://phab.comm.dev/D12000#inline-71167

farcasterId to farcasterID in native_rust_library