diff --git a/proto/zetachain/zetacore/observer/query.proto b/proto/zetachain/zetacore/observer/query.proto index 0e103dd331..f58e3f9118 100644 --- a/proto/zetachain/zetacore/observer/query.proto +++ b/proto/zetachain/zetacore/observer/query.proto @@ -169,7 +169,7 @@ service Query { // Queries operational flags rpc OperationalFlags(QueryOperationalFlagsRequest) returns (QueryOperationalFlagsResponse) { - option (google.api.http).get = "/zeta-chain/observer/opertaionalFlags"; + option (google.api.http).get = "/zeta-chain/observer/operationalFlags"; } } diff --git a/x/observer/client/cli/tx_update_operational_flags.go b/x/observer/client/cli/tx_update_operational_flags.go index 957f011a72..ffdaef97a6 100644 --- a/x/observer/client/cli/tx_update_operational_flags.go +++ b/x/observer/client/cli/tx_update_operational_flags.go @@ -3,7 +3,6 @@ package cli import ( "encoding/json" "os" - "path/filepath" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -31,11 +30,6 @@ func CmdUpdateOperationalFlags() *cobra.Command { restartHeight, _ := flagSet.GetInt64("restart-height") if file != "" { - file, err := filepath.Abs(file) - if err != nil { - return err - } - file = filepath.Clean(file) input, err := os.ReadFile(file) // #nosec G304 if err != nil { return err diff --git a/x/observer/types/message_update_operational_flags.go b/x/observer/types/message_update_operational_flags.go index a2961931a2..e93a20b621 100644 --- a/x/observer/types/message_update_operational_flags.go +++ b/x/observer/types/message_update_operational_flags.go @@ -44,5 +44,10 @@ func (msg *MsgUpdateOperationalFlags) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { return cosmoserrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } + + if msg.OperationalFlags.RestartHeight < 0 { + return cosmoserrors.Wrap(sdkerrors.ErrInvalidRequest, "restart height cannot be negative") + } + return nil } diff --git a/x/observer/types/query.pb.go b/x/observer/types/query.pb.go index 4717443597..d9d7fe4397 100644 --- a/x/observer/types/query.pb.go +++ b/x/observer/types/query.pb.go @@ -2383,7 +2383,7 @@ func init() { } var fileDescriptor_25b2aa420449a0c0 = []byte{ - // 2377 bytes of a gzipped FileDescriptorProto + // 2374 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x5a, 0xcf, 0x6f, 0x1b, 0xc7, 0xf5, 0xf7, 0x5a, 0x89, 0x22, 0x8d, 0x6c, 0x89, 0x1a, 0xcb, 0x3f, 0x42, 0x3b, 0xb4, 0xbc, 0xb2, 0x62, 0x59, 0x96, 0xb8, 0x36, 0xed, 0x7c, 0xfd, 0x2b, 0x8e, 0x4d, 0xfa, 0x6b, 0x49, 0x76, 0x12, @@ -2527,12 +2527,12 @@ var fileDescriptor_25b2aa420449a0c0 = []byte{ 0x5a, 0x22, 0xbf, 0x86, 0xac, 0xf1, 0x3f, 0x34, 0x74, 0x34, 0xe1, 0xdb, 0x1e, 0x7c, 0x6b, 0x77, 0x68, 0xfa, 0x9f, 0x0f, 0x65, 0x8b, 0x2f, 0xe0, 0x01, 0x28, 0x5d, 0x12, 0x94, 0xf2, 0x78, 0x25, 0x89, 0x52, 0xd1, 0xb6, 0xa3, 0x3e, 0x18, 0xfe, 0x42, 0x43, 0x99, 0xe8, 0xb7, 0x50, 0x2a, 0xf9, - 0x28, 0xe1, 0x93, 0x2d, 0x95, 0x7c, 0x94, 0xf4, 0x31, 0xd7, 0x90, 0x2d, 0x03, 0xed, 0x10, 0x97, - 0x9b, 0x81, 0x2f, 0xb6, 0xee, 0x7c, 0xf5, 0x2c, 0xa7, 0x7d, 0xfd, 0x2c, 0xa7, 0x7d, 0xfb, 0x2c, - 0xa7, 0xfd, 0xe2, 0x79, 0x6e, 0xdf, 0xd7, 0xcf, 0x73, 0xfb, 0xfe, 0xf5, 0x3c, 0xb7, 0xef, 0xf1, - 0xb9, 0x96, 0xc5, 0xdb, 0x5b, 0xb5, 0x7c, 0x9d, 0x6e, 0x06, 0x5d, 0x79, 0xbb, 0x25, 0xe3, 0xe3, - 0x40, 0x5a, 0xee, 0x76, 0x08, 0xab, 0x8d, 0x8b, 0x6f, 0xd1, 0x2e, 0xfe, 0x37, 0x00, 0x00, 0xff, - 0xff, 0x51, 0x67, 0xa4, 0x2b, 0xb0, 0x29, 0x00, 0x00, + 0x28, 0xe1, 0x93, 0x2d, 0x95, 0x7c, 0x94, 0xf4, 0x31, 0xd7, 0x90, 0x2d, 0x43, 0xf4, 0xcb, 0xac, + 0xd2, 0x9d, 0xaf, 0x9e, 0xe5, 0xb4, 0xaf, 0x9f, 0xe5, 0xb4, 0x6f, 0x9f, 0xe5, 0xb4, 0x5f, 0x3c, + 0xcf, 0xed, 0xfb, 0xfa, 0x79, 0x6e, 0xdf, 0xbf, 0x9e, 0xe7, 0xf6, 0x3d, 0x3e, 0xd7, 0xb2, 0x78, + 0x7b, 0xab, 0x96, 0xaf, 0xd3, 0xcd, 0xa0, 0x2b, 0x6f, 0xb7, 0x64, 0x7c, 0x1c, 0x48, 0xcb, 0xdd, + 0x0e, 0x61, 0xb5, 0x71, 0xf1, 0x2d, 0xda, 0xc5, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x8c, + 0xf5, 0xdd, 0xb0, 0x29, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/observer/types/query.pb.gw.go b/x/observer/types/query.pb.gw.go index 95ed008db2..48bd9447dd 100644 --- a/x/observer/types/query.pb.gw.go +++ b/x/observer/types/query.pb.gw.go @@ -2191,7 +2191,7 @@ var ( pattern_Query_TssFundsMigratorInfoAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"zeta-chain", "observer", "getAllTssFundsMigrators"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_OperationalFlags_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"zeta-chain", "observer", "opertaionalFlags"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_OperationalFlags_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"zeta-chain", "observer", "operationalFlags"}, "", runtime.AssumeColonVerbOpt(false))) ) var (