Skip to content

Commit

Permalink
Merge remote-tracking branch 'pokt/main' into issues/612/param/min-st…
Browse files Browse the repository at this point in the history
…ake-gateway

* pokt/main:
  [Gateway] chore: add `MsgUpdateParam` to gateway module (#808)
  • Loading branch information
bryanchriswhite committed Sep 30, 2024
2 parents a77877b + 1223502 commit 28962ba
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions x/gateway/types/message_update_param.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ import (

var _ cosmostypes.Msg = (*MsgUpdateParam)(nil)

func NewMsgUpdateParam(authority string, name string, value any) *MsgUpdateParam {
var valueAsType isMsgUpdateParam_AsType
func NewMsgUpdateParam(authority string, name string, asType any) *MsgUpdateParam {
var asTypeIface isMsgUpdateParam_AsType

switch v := value.(type) {
switch t := asType.(type) {
case *cosmostypes.Coin:
valueAsType = &MsgUpdateParam_AsCoin{AsCoin: v}
asTypeIface = &MsgUpdateParam_AsCoin{AsCoin: t}
default:
panic(fmt.Sprintf("unexpected param value type: %T", value))
panic(fmt.Sprintf("unexpected param value type: %T", asType))
}

return &MsgUpdateParam{
Authority: authority,
Name: name,
AsType: valueAsType,
AsType: asTypeIface,
}
}

Expand Down

0 comments on commit 28962ba

Please sign in to comment.