[Chore] Registers the TreeStore onto the bus#856
[Chore] Registers the TreeStore onto the bus#856dylanlott wants to merge 2 commits intochore/introduce-submodulefrom
Conversation
6730e6f to
11bc8fa
Compare
h5law
left a comment
There was a problem hiding this comment.
@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?
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
92360c8 to
fcb480e
Compare
Done 👍
It existed, it was just in |
h5law
left a comment
There was a problem hiding this comment.
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, |
| } | ||
|
|
||
| func (m *bus) GetTreeStoreModule() modules.TreeStoreModule { | ||
| return getModuleFromRegistry[modules.PersistenceModule](m, modules.PersistenceModuleName).GetBus().GetTreeStoreModule() |
There was a problem hiding this comment.
| return getModuleFromRegistry[modules.PersistenceModule](m, modules.PersistenceModuleName).GetBus().GetTreeStoreModule() | |
| return getModuleFromRegistry[modules.TreeStoreModule](m, modules.TreeStoreModuleName) |
This works, its what I'm currently using. Once the getModuleFromRegistry takes Submodule not Module this can merge. As we register it to the bus this should be the way we retrieve not through persistence anymore
|
Superseded by #861 |
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
make develop_test; if any code changes were mademake test_e2eon k8s LocalNet; if any code changes were madee2e-devnet-testpasses tests on DevNet; if any code was changedRequired Checklist
godocformat comments on touched members (see: tip.golang.org/doc/comment)If Applicable Checklist
shared/docs/*if I updatedshared/*README(s)