-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
event enums: Rename to conform with oasis-core #253
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(non-blocking) We don't foresee searching by backend
?
3eaa525
to
a86943a
Compare
I can't think of a use case, no. And if we need to for some niche reason, we can still do prefix matching on |
dec98ed
to
f9d0b2d
Compare
a86943a
to
0384ad7
Compare
CI wouldn't trigger at the old HEAD
This came up in https://github.com/oasisprotocol/oasis-indexer/pull/246/files#r1048033749
Unlike the indexer, oasis-core does not have an enum of all event types. Instead, events are represented in a nested struct that is used as a union type. So to represent a Transfer event, for example, oasis-core use an object like
Event { Staking: { Transfer: { ... } } }
. There's no explicit enumeration/names for event types. The indexer, OTOH, needs an enum so that clients can somehow say "give me only events of type X".Enums were named somewhat arbitrarily. They were named after the last element of the "path" in the above composite object. In addition, the first element of the path (in practice, the originating tendermint app) was saved as a separate
backend
column in the DB, but it only ever makes sense to expose bothbackend
andtype
at the same time, or neither.This PR changes the enum value scheme as follows:
backend
andtype
are merged into a single field, simplifying handling and understandingEvent
to the leaf event struct has more than two elements, all elements are included in the enum name (e.g.staking.escrow.take
)