func (msg MsgRespondService) ValidateBasic() error {
	if err := ValidateProvider(msg.Provider); err != nil {
		return err
	}
	if err := ValidateRequestID(msg.RequestId); err != nil {
		return err
	}
	if err := ValidateResponseResult(msg.Result); err != nil {
		return err
	}
	result, err := ParseResult(msg.Result)
	if err != nil {
		return err
	}
	return ValidateOutput(result.Code, msg.Output)
}
ValidateBasic implements Msg.
package types
import (
	sdk "github.com/cosmos/cosmos-sdk/types"
)
const (
	TypeMsgDefineService         = "define_service"           
	TypeMsgBindService           = "bind_service"             
	TypeMsgUpdateServiceBinding  = "update_service_binding"   
	TypeMsgSetWithdrawAddress    = "set_withdraw_address"     
	TypeMsgDisableServiceBinding = "disable_service_binding"  
	TypeMsgEnableServiceBinding  = "enable_service_binding"   
	TypeMsgRefundServiceDeposit  = "refund_service_deposit"   
	TypeMsgCallService           = "call_service"             
	TypeMsgRespondService        = "respond_service"          
	TypeMsgPauseRequestContext   = "pause_request_context"    
	TypeMsgStartRequestContext   = "start_request_context"    
	TypeMsgKillRequestContext    = "kill_request_context"     
	TypeMsgUpdateRequestContext  = "update_request_context"   
	TypeMsgWithdrawEarnedFees    = "withdraw_earned_fees"     
)
var (
	_ sdk.Msg = &MsgDefineService{}
	_ sdk.Msg = &MsgBindService{}
	_ sdk.Msg = &MsgUpdateServiceBinding{}
	_ sdk.Msg = &MsgSetWithdrawAddress{}
	_ sdk.Msg = &MsgDisableServiceBinding{}
	_ sdk.Msg = &MsgEnableServiceBinding{}
	_ sdk.Msg = &MsgRefundServiceDeposit{}
	_ sdk.Msg = &MsgCallService{}
	_ sdk.Msg = &MsgStartRequestContext{}
	_ sdk.Msg = &MsgPauseRequestContext{}
	_ sdk.Msg = &MsgKillRequestContext{}
	_ sdk.Msg = &MsgUpdateRequestContext{}
	_ sdk.Msg = &MsgRespondService{}
	_ sdk.Msg = &MsgWithdrawEarnedFees{}
)
func NewMsgDefineService(
	name string,
	description string,
	tags []string,
	author string,
	authorDescription,
	schemas string,
) *MsgDefineService {
	return &MsgDefineService{
		Name:              name,
		Description:       description,
		Tags:              tags,
		Author:            author,
		AuthorDescription: authorDescription,
		Schemas:           schemas,
	}
}
func (msg MsgDefineService) Route() string { return RouterKey }
func (msg MsgDefineService) Type() string { return TypeMsgDefineService }
func (msg MsgDefineService) ValidateBasic() error {
	if err := ValidateAuthor(msg.Author); err != nil {
		return err
	}
	if err := ValidateServiceName(msg.Name); err != nil {
		return err
	}
	if err := ValidateServiceDescription(msg.Description); err != nil {
		return err
	}
	if err := ValidateAuthorDescription(msg.AuthorDescription); err != nil {
		return err
	}
	if err := ValidateTags(msg.Tags); err != nil {
		return err
	}
	return ValidateServiceSchemas(msg.Schemas)
}
func (msg MsgDefineService) GetSignBytes() []byte {
	if len(msg.Tags) == 0 {
		msg.Tags = nil
	}
	bz := ModuleCdc.MustMarshalJSON(&msg)
	return sdk.MustSortJSON(bz)
}
func (msg MsgDefineService) GetSigners() []sdk.AccAddress {
	from, err := sdk.AccAddressFromBech32(msg.Author)
	if err != nil {
		panic(err)
	}
	return []sdk.AccAddress{from}
}
func NewMsgBindService(
	serviceName string,
	provider string,
	deposit sdk.Coins,
	pricing string,
	qos uint64,
	options string,
	owner string,
) *MsgBindService {
	return &MsgBindService{
		ServiceName: serviceName,
		Provider:    provider,
		Deposit:     deposit,
		Pricing:     pricing,
		QoS:         qos,
		Options:     options,
		Owner:       owner,
	}
}
func (msg MsgBindService) Route() string { return RouterKey }
func (msg MsgBindService) Type() string { return TypeMsgBindService }
func (msg MsgBindService) GetSignBytes() []byte {
	if msg.Deposit.Empty() {
		msg.Deposit = nil
	}
	b := ModuleCdc.MustMarshalJSON(&msg)
	return sdk.MustSortJSON(b)
}
func (msg MsgBindService) ValidateBasic() error {
	if err := ValidateProvider(msg.Provider); err != nil {
		return err
	}
	if err := ValidateOwner(msg.Owner); err != nil {
		return err
	}
	if err := ValidateServiceName(msg.ServiceName); err != nil {
		return err
	}
	if err := ValidateServiceDeposit(msg.Deposit); err != nil {
		return err
	}
	if err := ValidateQoS(msg.QoS); err != nil {
		return err
	}
	if err := ValidateOptions(msg.Options); err != nil {
		return err
	}
	return ValidatePricing(msg.Pricing)
}
func (msg MsgBindService) GetSigners() []sdk.AccAddress {
	from, err := sdk.AccAddressFromBech32(msg.Owner)
	if err != nil {
		panic(err)
	}
	return []sdk.AccAddress{from}
}
func NewMsgUpdateServiceBinding(
	serviceName string,
	provider string,
	deposit sdk.Coins,
	pricing string,
	qos uint64,
	options string,
	owner string,
) *MsgUpdateServiceBinding {
	return &MsgUpdateServiceBinding{
		ServiceName: serviceName,
		Provider:    provider,
		Deposit:     deposit,
		Pricing:     pricing,
		QoS:         qos,
		Options:     options,
		Owner:       owner,
	}
}
func (msg MsgUpdateServiceBinding) Route() string { return RouterKey }
func (msg MsgUpdateServiceBinding) Type() string { return TypeMsgUpdateServiceBinding }
func (msg MsgUpdateServiceBinding) GetSignBytes() []byte {
	if msg.Deposit.Empty() {
		msg.Deposit = nil
	}
	b := ModuleCdc.MustMarshalJSON(&msg)
	return sdk.MustSortJSON(b)
}
func (msg MsgUpdateServiceBinding) ValidateBasic() error {
	if err := ValidateProvider(msg.Provider); err != nil {
		return err
	}
	if err := ValidateOwner(msg.Owner); err != nil {
		return err
	}
	if err := ValidateServiceName(msg.ServiceName); err != nil {
		return err
	}
	if !msg.Deposit.Empty() {
		if err := ValidateServiceDeposit(msg.Deposit); err != nil {
			return err
		}
	}
	if len(msg.Options) != 0 {
		if err := ValidateOptions(msg.Options); err != nil {
			return err
		}
	}
	if len(msg.Pricing) != 0 {
		return ValidatePricing(msg.Pricing)
	}
	return nil
}
func (msg MsgUpdateServiceBinding) GetSigners() []sdk.AccAddress {
	from, err := sdk.AccAddressFromBech32(msg.Owner)
	if err != nil {
		panic(err)
	}
	return []sdk.AccAddress{from}
}
func NewMsgSetWithdrawAddress(owner, withdrawAddr string) *MsgSetWithdrawAddress {
	return &MsgSetWithdrawAddress{
		Owner:           owner,
		WithdrawAddress: withdrawAddr,
	}
}
func (msg MsgSetWithdrawAddress) Route() string { return RouterKey }
func (msg MsgSetWithdrawAddress) Type() string { return TypeMsgSetWithdrawAddress }
func (msg MsgSetWithdrawAddress) GetSignBytes() []byte {
	b := ModuleCdc.MustMarshalJSON(&msg)
	return sdk.MustSortJSON(b)
}
func (msg MsgSetWithdrawAddress) ValidateBasic() error {
	if err := ValidateOwner(msg.Owner); err != nil {
		return err
	}
	return ValidateWithdrawAddress(msg.WithdrawAddress)
}
func (msg MsgSetWithdrawAddress) Normalize() MsgSetWithdrawAddress {
	return msg
}
func (msg MsgSetWithdrawAddress) GetSigners() []sdk.AccAddress {
	from, err := sdk.AccAddressFromBech32(msg.Owner)
	if err != nil {
		panic(err)
	}
	return []sdk.AccAddress{from}
}
func NewMsgDisableServiceBinding(serviceName, provider, owner string) *MsgDisableServiceBinding {
	return &MsgDisableServiceBinding{
		ServiceName: serviceName,
		Provider:    provider,
		Owner:       owner,
	}
}
func (msg MsgDisableServiceBinding) Route() string { return RouterKey }
func (msg MsgDisableServiceBinding) Type() string { return TypeMsgDisableServiceBinding }
func (msg MsgDisableServiceBinding) GetSignBytes() []byte {
	b := ModuleCdc.MustMarshalJSON(&msg)
	return sdk.MustSortJSON(b)
}
func (msg MsgDisableServiceBinding) ValidateBasic() error {
	if err := ValidateProvider(msg.Provider); err != nil {
		return err
	}
	if err := ValidateOwner(msg.Owner); err != nil {
		return err
	}
	return ValidateServiceName(msg.ServiceName)
}
func (msg MsgDisableServiceBinding) GetSigners() []sdk.AccAddress {
	from, err := sdk.AccAddressFromBech32(msg.Owner)
	if err != nil {
		panic(err)
	}
	return []sdk.AccAddress{from}
}
func NewMsgEnableServiceBinding(
	serviceName string,
	provider string,
	deposit sdk.Coins,
	owner string,
) *MsgEnableServiceBinding {
	return &MsgEnableServiceBinding{
		ServiceName: serviceName,
		Provider:    provider,
		Deposit:     deposit,
		Owner:       owner,
	}
}
func (msg MsgEnableServiceBinding) Route() string { return RouterKey }
func (msg MsgEnableServiceBinding) Type() string { return TypeMsgEnableServiceBinding }
func (msg MsgEnableServiceBinding) GetSignBytes() []byte {
	if msg.Deposit.Empty() {
		msg.Deposit = nil
	}
	b := ModuleCdc.MustMarshalJSON(&msg)
	return sdk.MustSortJSON(b)
}
func (msg MsgEnableServiceBinding) ValidateBasic() error {
	if err := ValidateProvider(msg.Provider); err != nil {
		return err
	}
	if err := ValidateOwner(msg.Owner); err != nil {
		return err
	}
	if err := ValidateServiceName(msg.ServiceName); err != nil {
		return err
	}
	if !msg.Deposit.Empty() {
		if err := ValidateServiceDeposit(msg.Deposit); err != nil {
			return err
		}
	}
	return nil
}
func (msg MsgEnableServiceBinding) GetSigners() []sdk.AccAddress {
	from, err := sdk.AccAddressFromBech32(msg.Owner)
	if err != nil {
		panic(err)
	}
	return []sdk.AccAddress{from}
}
func NewMsgRefundServiceDeposit(serviceName, provider, owner string) *MsgRefundServiceDeposit {
	return &MsgRefundServiceDeposit{
		ServiceName: serviceName,
		Provider:    provider,
		Owner:       owner,
	}
}
func (msg MsgRefundServiceDeposit) Route() string { return RouterKey }
func (msg MsgRefundServiceDeposit) Type() string { return TypeMsgRefundServiceDeposit }
func (msg MsgRefundServiceDeposit) GetSignBytes() []byte {
	b := ModuleCdc.MustMarshalJSON(&msg)
	return sdk.MustSortJSON(b)
}
func (msg MsgRefundServiceDeposit) ValidateBasic() error {
	if err := ValidateProvider(msg.Provider); err != nil {
		return err
	}
	if err := ValidateOwner(msg.Owner); err != nil {
		return err
	}
	return ValidateServiceName(msg.ServiceName)
}
func (msg MsgRefundServiceDeposit) GetSigners() []sdk.AccAddress {
	from, err := sdk.AccAddressFromBech32(msg.Owner)
	if err != nil {
		panic(err)
	}
	return []sdk.AccAddress{from}
}
func NewMsgCallService(
	serviceName string,
	providers []string,
	consumer string,
	input string,
	serviceFeeCap sdk.Coins,
	timeout int64,
	repeated bool,
	repeatedFrequency uint64,
	repeatedTotal int64,
) *MsgCallService {
	return &MsgCallService{
		ServiceName:       serviceName,
		Providers:         providers,
		Consumer:          consumer,
		Input:             input,
		ServiceFeeCap:     serviceFeeCap,
		Timeout:           timeout,
		Repeated:          repeated,
		RepeatedFrequency: repeatedFrequency,
		RepeatedTotal:     repeatedTotal,
	}
}
func (msg MsgCallService) Route() string { return RouterKey }
func (msg MsgCallService) Type() string { return TypeMsgCallService }
func (msg MsgCallService) GetSignBytes() []byte {
	if len(msg.Providers) == 0 {
		msg.Providers = nil
	}
	if msg.ServiceFeeCap.Empty() {
		msg.ServiceFeeCap = nil
	}
	b := ModuleCdc.MustMarshalJSON(&msg)
	return sdk.MustSortJSON(b)
}
func (msg MsgCallService) ValidateBasic() error {
	if err := ValidateConsumer(msg.Consumer); err != nil {
		return err
	}
	pds := make([]sdk.AccAddress, len(msg.Providers))
	for i, provider := range msg.Providers {
		pd, err := sdk.AccAddressFromBech32(provider)
		if err != nil {
			return err
		}
		pds[i] = pd
	}
	return ValidateRequest(
		msg.ServiceName,
		msg.ServiceFeeCap,
		pds,
		msg.Input,
		msg.Timeout,
		msg.Repeated,
		msg.RepeatedFrequency,
		msg.RepeatedTotal,
	)
}
func (msg MsgCallService) GetSigners() []sdk.AccAddress {
	from, err := sdk.AccAddressFromBech32(msg.Consumer)
	if err != nil {
		panic(err)
	}
	return []sdk.AccAddress{from}
}
func NewMsgRespondService(requestID, provider, result, output string) *MsgRespondService {
	return &MsgRespondService{
		RequestId: requestID,
		Provider:  provider,
		Result:    result,
		Output:    output,
	}
}
func (msg MsgRespondService) Route() string { return RouterKey }
func (msg MsgRespondService) Type() string { return TypeMsgRespondService }
func (msg MsgRespondService) GetSignBytes() []byte {
	b := ModuleCdc.MustMarshalJSON(&msg)
	return sdk.MustSortJSON(b)
}