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

Add query endpoint for subcribers who are validators, simplify AddPublisher proposal #277

Merged
merged 4 commits into from
Feb 4, 2024

Conversation

EricBolten
Copy link
Contributor

@EricBolten EricBolten commented Feb 3, 2024

  • Run one query to return all subscribers who are also validators
  • Allow governance to update an existing publisher

func (k Keeper) GetValidatorSubscribers(ctx sdk.Context) (subscribers []*types.Subscriber) {
allSubscribers := k.GetSubscribers(ctx)
for _, subscriber := range allSubscribers {
subscriberAddress, err := sdk.AccAddressFromBech32(subscriber.Address)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have ptsd from this method now. As long as we're confident it's impossible to get a non-somm prefixed address through AddSubcriber this is fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing it to log an error and continue instead for now

@EricBolten EricBolten changed the title Add query endpoint for subcribers who are validators Add query endpoint for subcribers who are validators, simplify AddPublisher proposal Feb 4, 2024
@EricBolten
Copy link
Contributor Author

Confirmed with @cbrit on Telegram.

@EricBolten EricBolten merged commit 7061880 into main Feb 4, 2024
10 checks passed
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

Successfully merging this pull request may close these issues.

2 participants