Skip to content
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

(Update) Using of different events for different actions #177

Open
varasev opened this issue Aug 30, 2018 · 0 comments
Open

(Update) Using of different events for different actions #177

varasev opened this issue Aug 30, 2018 · 0 comments

Comments

@varasev
Copy link
Contributor

varasev commented Aug 30, 2018

Several events contain a string field which encodes the actual reason of the event emission, such as action in KeysManager:

event MiningKeyChanged(address key, string action);
event VotingKeyChanged(address key, address indexed miningKey, string action);
event PayoutKeyChanged(address key, address indexed miningKey, string action);

action is not arbitrary: it can take only three different values: "swapped", "added", and "removed".

This means that, every time these events are emitted, some more gas is consumed to send the string along, and an event listener has to match the action field against these three values to really know what happened. It seems that we could instead use different events for different actions. E.g.:

event MiningKeyAdded(address key);
event MiningKeyRemoved(address key);
event MiningKeySwapped(address key);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant