Skip to content

Commit

Permalink
fix: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
djm07073 committed Jun 21, 2024
1 parent 9b76612 commit 28832bf
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions x/ophost/types/hook/bridge_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,14 @@ func (h BridgeHook) BridgeCreated(
if !hasPermChannels {
return nil
}
var challengers []sdk.AccAddress
for _, challenger := range bridgeConfig.Challengers {
challenger, err := h.ac.StringToBytes(challenger)
if err != nil {
return err
}
challengers = append(challengers, challenger)
}
if len(challengers) != 1 {

if len(bridgeConfig.Challengers) != 1 {
return errors.New("only one challenger is allowed on bridge creation")
}
challengers := make([]sdk.AccAddress, 1)
challengerStr, _ := h.ac.StringToBytes(bridgeConfig.Challengers[0])
challengers[0] = challengerStr

sdkCtx := sdk.UnwrapSDKContext(ctx)
for _, permChannel := range metadata.PermChannels {
portID, channelID := permChannel.PortID, permChannel.ChannelID
Expand Down

0 comments on commit 28832bf

Please sign in to comment.