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
F2117237: D11998.diff
Wed, Jun 26, 10:56 AM
Unknown Object (File)
Mon, Jun 24, 6:31 PM
Unknown Object (File)
Mon, Jun 24, 4:26 AM
Unknown Object (File)
Thu, Jun 20, 3:04 PM
Unknown Object (File)
Wed, Jun 19, 9:48 AM
Unknown Object (File)
Wed, Jun 19, 9:45 AM
Unknown Object (File)
Wed, Jun 19, 9:11 AM
Unknown Object (File)
Tue, Jun 18, 7:34 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
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/native_rust_library/src/identity/find_user_identities.rs
34–53

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

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

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

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

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

farcasterId to farcasterID in native_rust_library