@@ -51,12 +51,14 @@ func (m *MsgRegisterNodeRequest) ValidateBasic() error {
5151 return types .NewErrorInvalidMessage (fmt .Errorf ("invalid from: %w" , err ))
5252 }
5353
54- if prices := m .GetGigabytePrices (); ! prices .IsValid () {
55- return types .NewErrorInvalidMessage ("gigabyte_prices must be valid" )
54+ gigabytePrices := m .GetGigabytePrices ()
55+ if err := gigabytePrices .Validate (); err != nil {
56+ return types .NewErrorInvalidMessage (fmt .Errorf ("invalid gigabyte_prices: %w" , err ))
5657 }
5758
58- if prices := m .GetHourlyPrices (); ! prices .IsValid () {
59- return types .NewErrorInvalidMessage ("hourly_prices must be valid" )
59+ hourlyPrices := m .GetHourlyPrices ()
60+ if err := hourlyPrices .Validate (); err != nil {
61+ return types .NewErrorInvalidMessage (fmt .Errorf ("invalid hourly_prices: %w" , err ))
6062 }
6163
6264 if len (m .RemoteAddrs ) == 0 {
@@ -110,12 +112,14 @@ func (m *MsgUpdateNodeDetailsRequest) ValidateBasic() error {
110112 return types .NewErrorInvalidMessage (fmt .Errorf ("invalid from: %w" , err ))
111113 }
112114
113- if prices := m .GetGigabytePrices (); ! prices .IsValid () {
114- return types .NewErrorInvalidMessage ("gigabyte_prices must be valid" )
115+ gigabytePrices := m .GetGigabytePrices ()
116+ if err := gigabytePrices .Validate (); err != nil {
117+ return types .NewErrorInvalidMessage (fmt .Errorf ("invalid gigabyte_prices: %w" , err ))
115118 }
116119
117- if prices := m .GetHourlyPrices (); ! prices .IsValid () {
118- return types .NewErrorInvalidMessage ("hourly_prices must be valid" )
120+ hourlyPrices := m .GetHourlyPrices ()
121+ if err := hourlyPrices .Validate (); err != nil {
122+ return types .NewErrorInvalidMessage (fmt .Errorf ("invalid hourly_prices: %w" , err ))
119123 }
120124
121125 if len (m .RemoteAddrs ) > 0 {
0 commit comments