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

fix: edit finality provider commission-rate #296

Merged
merged 5 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
* [#277](https://github.com/babylonlabs-io/finality-provider/pull/277) Poll many blocks in poller
* [#291](https://github.com/babylonlabs-io/finality-provider/pull/291) chore: remove skip height

### Bug Fixes

* [#296](https://github.com/babylonlabs-io/finality-provider/pull/296) fix: edit finality provider commission-rate

## v0.14.3

### Improvements
Expand Down
12 changes: 11 additions & 1 deletion finality-provider/service/client/rpcclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,21 @@

// EditFinalityProvider - edit the finality provider data.
func (c *FinalityProviderServiceGRpcClient) EditFinalityProvider(
ctx context.Context, fpPk *bbntypes.BIP340PubKey, desc *proto.Description, rate string) error {

Check failure on line 136 in finality-provider/service/client/rpcclient.go

View workflow job for this annotation

GitHub Actions / lint_test / lint

unnecessary leading newline (whitespace)

if rate == "" {
currentProvider, err := c.QueryFinalityProviderInfo(ctx, fpPk)
if err != nil {
return fmt.Errorf("failed to get current provider info: %w", err)
}
rate = currentProvider.FinalityProvider.Commission
}

req := &proto.EditFinalityProviderRequest{BtcPk: fpPk.MarshalHex(), Description: desc, Commission: rate}

_, err := c.client.EditFinalityProvider(ctx, req)
if err != nil {
return err
return fmt.Errorf("failed to edit finality provider: %w", err)
}

return nil
Expand Down
Loading