Skip to content

Commit

Permalink
refactor so we do error checking before creating protocol data (#877)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Bowman authored Dec 11, 2023
1 parent a809c3e commit bd797bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x/participationrewards/keeper/proposal_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (

// HandleAddProtocolDataProposal is a handler for executing a passed add protocol data proposal.
func HandleAddProtocolDataProposal(ctx sdk.Context, k *Keeper, p *types.AddProtocolDataProposal) error {
protocolData := types.NewProtocolData(p.Type, p.Data)

if err := p.ValidateBasic(); err != nil {
return err
}
Expand All @@ -28,6 +26,8 @@ func HandleAddProtocolDataProposal(ctx sdk.Context, k *Keeper, p *types.AddProto
return err
}

protocolData := types.NewProtocolData(p.Type, p.Data)

k.SetProtocolData(ctx, pd.GenerateKey(), protocolData)

return nil
Expand Down

0 comments on commit bd797bc

Please sign in to comment.