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)
Fri, Jun 14, 2:45 PM
Unknown Object (File)
Mon, Jun 10, 10:36 AM
Unknown Object (File)
Sat, Jun 8, 8:28 AM
Unknown Object (File)
Wed, May 22, 12:32 PM
Unknown Object (File)
Tue, May 21, 8:30 PM
Unknown Object (File)
Mon, May 20, 11:39 PM
Unknown Object (File)
Mon, May 20, 9:29 AM
Unknown Object (File)
Sun, May 19, 11:38 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