pokt-network / pocket

Official implementation of the Pocket Network Protocol v1
https://pokt.network
MIT License
61 stars 33 forks source link

[Chore] Registers the TreeStore onto the bus #856

Closed dylanlott closed 1 year ago

dylanlott commented 1 year ago

Description

tl;dr- a one-liner that registers the TreeStore submodule to the bus.

This was enabled by a change made in #855 after the TreeStore was modularized that creates a concrete Submodule implementation and allows them to be passed to the bus registration function like full modules. This PR updates the TreeStore to take full advantage of that submodule interface change and expose it on the bus for use in external modules, e.g. the IBC module.

Issue

References a discussion abodut submodules and bus registration brought up during #808 Updates the TreeStore submodule to register itself on the bus as a submodule which was enabled by #855

Type of change

Please mark the relevant option(s):

List of changes

Testing

Required Checklist

If Applicable Checklist

dylanlott commented 1 year ago

@dylanlott Could you also add a function to the bus like so GetTreeStore() in shared/modules/bus_module.go and runtime/bus.go so the module can be retirved from the registry?

Done 👍

Also not sure if the treestore module has it but just incase the module registry requires the GetModuleName() function in order to register the module

It existed, it was just in trees/trees.go. I moved it to trees/module.go though because it's better there.

dylanlott commented 1 year ago

LFG!

Left a comment you need to use the treestore module name and type in the bus get function but besides that its 💶

So, I was going to bring that up: We can't use the name of the tree store submodule, we have to access it through the persistence module's getter because it's a Submodule. Okay I see the problem now. Investigating a better solution now.

dylanlott commented 1 year ago

Superseded by #861