user3004369
user3004369

Reputation:

Resolving relations inside a chain transaction

I've tested the possibility of resolving the relations with the "composer-client" library. I see in the API reference that the "composer-client.AssetRegistry" class has "resolve" and "resolveAll" Methods from its super-class "Registry". The methods are useful when developing a client application.

However, the composer-runtime.AssetRegistry has only "get" and "getAll" methods, which return registry records without resolving the "relations".

I can't seem to find any way of resolving the relations inside the transaction code. Any clues on that? Thx.

Upvotes: 0

Views: 224

Answers (1)

SamS
SamS

Reputation: 144

You're right that the composer-runtime doesn't offer the resolve/resolveAll methods currently. Having said that, you may not need these functions since any objects that are passed as parameters to the transaction code should be fully resolved and so you should be able to access everything you need from the objects that you're passed.

I guess it depends on what your use case is really. If you're wanting to get assets from AssetRegistries independently from within your transaction code then you'll have to resolve the relationships manually, following the relationships using the runtime API as things currently stand.

Upvotes: 1

Related Questions