-
Notifications
You must be signed in to change notification settings - Fork 586
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: emitting an event when handling a client upgrade proposal (back…
…port #1570) (#1766) * feat: emitting an event when handling a client upgrade proposal (#1570) * feat: emitting an event when handling a client upgrade proposal * refactor: only emit event if err is nil * refactor: idiotmatic go: (cherry picked from commit 8422d0c) # Conflicts: # CHANGELOG.md # modules/core/02-client/keeper/events.go * fix conflicts * add new line * remove unused import Co-authored-by: Sean King <seantking@users.noreply.github.com> Co-authored-by: crodriguezvega <carlos@interchain.io>
- Loading branch information
1 parent
a061fab
commit bb3d1cf
Showing
4 changed files
with
42 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package keeper | ||
|
||
import ( | ||
"fmt" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
"github.com/cosmos/ibc-go/v2/modules/core/02-client/types" | ||
) | ||
|
||
// EmitUpgradeClientProposalEvent emits an upgrade client proposal event | ||
func EmitUpgradeClientProposalEvent(ctx sdk.Context, title string, height int64) { | ||
ctx.EventManager().EmitEvent( | ||
sdk.NewEvent( | ||
types.EventTypeUpgradeClientProposal, | ||
sdk.NewAttribute(types.AttributeKeyUpgradePlanTitle, title), | ||
sdk.NewAttribute(types.AttributeKeyUpgradePlanHeight, fmt.Sprintf("%d", height)), | ||
), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters