Skip to content

[V107-specific] EventVersion emission

Multipartite requested to merge Multi/EventVersion into develop

[V107-specific]

Intended to close #1482 (closed)
'THORChain doesn't emit a "version" event when the network version changes'.

Something I noticed while writing this is that the "set_version" events in handler_version.go don't go through the kaboodle of event types and functions. Rather, their implementation is this:

	ctx.EventManager().EmitEvent(
		cosmos.NewEvent("set_version",
			cosmos.NewAttribute("thor_address", msg.Signer.String()),
			cosmos.NewAttribute("version", msg.Version)))

In particular, this is right after a BondCost event emission through the usual h.mgr.EventMgr() route.
This partly stood out to me in that it used ctx.EventManager(), and so I wondered whether it would even work before the
mgr.eventMgr, err = GetEventManager(v)
in managers.go (if desired).

Not knowing the usefulness of the kaboodle (for instance if front-ends or Midgard might benefit from the protobuf type) I kept it,
but would welcome more information about its intended function.

The output of .String() for semver.Version was checked in the Go Playground here.

Edited by Multipartite

Merge request reports