onflow/hybrid-custody

Implement MetadataViews.ResolverCollection in HybridCustody.Manager

sisyphusSmiling opened this issue · 2 comments

Given the fact ChildAccount and OwnedAccount both implement MetadataViews.Resolver and Capabilities for both are contained in the Manager, it would be a familiar pattern for the Manager to implement MetadataViews.ResolverCollection.

Currently, Manager implements Resolver, but AFAIK there are no plans for the resource to resolve metadata views itself. Implementing ResolverCollection would make an easier entrypoint for wallet providers and the like to resolve metadata for all of a user's child and owned accounts.

Curious, how would ResolverCollection work if we're not keying by id?

    pub resource interface ResolverCollection {
        pub fun borrowViewResolver(id: UInt64): &{Resolver}
        pub fun getIDs(): [UInt64]
    }

I guess we iterate over every child account until the uuid matches?

Ohhh right...🤔 I don't think that's worth it. Child/owned accounts are referenced by their Address everywhere else in the contract. IMO better to just close this out