Skip to content

Commit

Permalink
rename events
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed May 29, 2024
1 parent 100491f commit aa28f5e
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 118 deletions.
6 changes: 6 additions & 0 deletions docs/spec/observer/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ message MsgVoteTSS {

## MsgEnableCCTX

EnableCCTX enables the IsInboundEnabled and IsOutboundEnabled flags.These flags control the creation of inbounds and outbounds.
The flags are enabled by the policy account with the groupOperational policy type.

```proto
message MsgEnableCCTX {
string creator = 1;
Expand All @@ -138,6 +141,9 @@ message MsgEnableCCTX {

## MsgDisableCCTX

DisableCCTX disables the IsInboundEnabled and IsOutboundEnabled flags. These flags control the creation of inbounds and outbounds.
The flags are disabled by the policy account with the groupEmergency policy type.

```proto
message MsgDisableCCTX {
string creator = 1;
Expand Down
4 changes: 2 additions & 2 deletions proto/zetachain/zetacore/observer/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ message EventNewObserverAdded {
uint64 observer_last_block_count = 5;
}

message EventCCTXFlagsDisabled {
message EventCCTXDisabled {
string msg_type_url = 1;
bool isInboundEnabled = 2;
bool isOutboundEnabled = 3;
}

message EventCCTXFlagsEnabled {
message EventCCTXEnabled {
string msg_type_url = 1;
bool isInboundEnabled = 2;
bool isOutboundEnabled = 3;
Expand Down
32 changes: 16 additions & 16 deletions typescript/zetachain/zetacore/observer/events_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ export declare class EventNewObserverAdded extends Message<EventNewObserverAdded
}

/**
* @generated from message zetachain.zetacore.observer.EventCCTXFlagsDisabled
* @generated from message zetachain.zetacore.observer.EventCCTXDisabled
*/
export declare class EventCCTXFlagsDisabled extends Message<EventCCTXFlagsDisabled> {
export declare class EventCCTXDisabled extends Message<EventCCTXDisabled> {
/**
* @generated from field: string msg_type_url = 1;
*/
Expand All @@ -148,25 +148,25 @@ export declare class EventCCTXFlagsDisabled extends Message<EventCCTXFlagsDisabl
*/
isOutboundEnabled: boolean;

constructor(data?: PartialMessage<EventCCTXFlagsDisabled>);
constructor(data?: PartialMessage<EventCCTXDisabled>);

static readonly runtime: typeof proto3;
static readonly typeName = "zetachain.zetacore.observer.EventCCTXFlagsDisabled";
static readonly typeName = "zetachain.zetacore.observer.EventCCTXDisabled";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EventCCTXFlagsDisabled;
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EventCCTXDisabled;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EventCCTXFlagsDisabled;
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EventCCTXDisabled;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EventCCTXFlagsDisabled;
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EventCCTXDisabled;

static equals(a: EventCCTXFlagsDisabled | PlainMessage<EventCCTXFlagsDisabled> | undefined, b: EventCCTXFlagsDisabled | PlainMessage<EventCCTXFlagsDisabled> | undefined): boolean;
static equals(a: EventCCTXDisabled | PlainMessage<EventCCTXDisabled> | undefined, b: EventCCTXDisabled | PlainMessage<EventCCTXDisabled> | undefined): boolean;
}

/**
* @generated from message zetachain.zetacore.observer.EventCCTXFlagsEnabled
* @generated from message zetachain.zetacore.observer.EventCCTXEnabled
*/
export declare class EventCCTXFlagsEnabled extends Message<EventCCTXFlagsEnabled> {
export declare class EventCCTXEnabled extends Message<EventCCTXEnabled> {
/**
* @generated from field: string msg_type_url = 1;
*/
Expand All @@ -182,19 +182,19 @@ export declare class EventCCTXFlagsEnabled extends Message<EventCCTXFlagsEnabled
*/
isOutboundEnabled: boolean;

constructor(data?: PartialMessage<EventCCTXFlagsEnabled>);
constructor(data?: PartialMessage<EventCCTXEnabled>);

static readonly runtime: typeof proto3;
static readonly typeName = "zetachain.zetacore.observer.EventCCTXFlagsEnabled";
static readonly typeName = "zetachain.zetacore.observer.EventCCTXEnabled";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EventCCTXFlagsEnabled;
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EventCCTXEnabled;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EventCCTXFlagsEnabled;
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EventCCTXEnabled;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EventCCTXFlagsEnabled;
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EventCCTXEnabled;

static equals(a: EventCCTXFlagsEnabled | PlainMessage<EventCCTXFlagsEnabled> | undefined, b: EventCCTXFlagsEnabled | PlainMessage<EventCCTXFlagsEnabled> | undefined): boolean;
static equals(a: EventCCTXEnabled | PlainMessage<EventCCTXEnabled> | undefined, b: EventCCTXEnabled | PlainMessage<EventCCTXEnabled> | undefined): boolean;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions x/observer/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ func GetTxCmd() *cobra.Command {
CmdEncode(),
CmdResetChainNonces(),
CmdVoteTSS(),
CmdEnableCCTXFlags(),
CmdDisableCCTXFlags(),
CmdEnableCCTX(),
CmdDisableCCTX(),
CmdUpdateGasPriceIncreaseFlags(),
)

Expand Down
6 changes: 3 additions & 3 deletions x/observer/client/cli/tx_disable_cctx_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"github.com/zeta-chain/zetacore/x/observer/types"
)

func CmdDisableCCTXFlags() *cobra.Command {
func CmdDisableCCTX() *cobra.Command {
cmd := &cobra.Command{
Use: "disable-cctx-flags [disable-inbound] [disable-outbound]",
Short: "Disable inbound and outbound cross-chain flags",
Use: "disable-cctx [disable-inbound] [disable-outbound]",
Short: "Disable inbound and outbound for CCTX",
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) (err error) {

Expand Down
6 changes: 3 additions & 3 deletions x/observer/client/cli/tx_enable_cctx_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"github.com/zeta-chain/zetacore/x/observer/types"
)

func CmdEnableCCTXFlags() *cobra.Command {
func CmdEnableCCTX() *cobra.Command {
cmd := &cobra.Command{
Use: "enable-cctx-flags [enable-inbound] [enable-outbound]",
Short: "Enable inbound and outbound cross-chain flags",
Use: "enable-cctx [enable-inbound] [enable-outbound]",
Short: "Enable inbound and outbound for CCTX",
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) (err error) {

Expand Down
4 changes: 2 additions & 2 deletions x/observer/keeper/msg_server_disable_cctx_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ func (k msgServer) DisableCCTX(

k.SetCrosschainFlags(ctx, flags)

err := ctx.EventManager().EmitTypedEvents(&types.EventCCTXFlagsDisabled{
err := ctx.EventManager().EmitTypedEvents(&types.EventCCTXDisabled{
MsgTypeUrl: sdk.MsgTypeURL(&types.MsgDisableCCTX{}),
IsInboundEnabled: flags.IsInboundEnabled,
IsOutboundEnabled: flags.IsOutboundEnabled,
})

if err != nil {
ctx.Logger().Error("Error emitting event EventCCTXFlagsDisabled :", err)
ctx.Logger().Error("Error emitting event EventCCTXDisabled :", err)

Check warning on line 51 in x/observer/keeper/msg_server_disable_cctx_flags.go

View check run for this annotation

Codecov / codecov/patch

x/observer/keeper/msg_server_disable_cctx_flags.go#L51

Added line #L51 was not covered by tests
}

return &types.MsgDisableCCTXResponse{}, nil
Expand Down
4 changes: 2 additions & 2 deletions x/observer/keeper/msg_server_enable_cctx_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ func (k msgServer) EnableCCTX(

k.SetCrosschainFlags(ctx, flags)

err := ctx.EventManager().EmitTypedEvents(&types.EventCCTXFlagsEnabled{
err := ctx.EventManager().EmitTypedEvents(&types.EventCCTXEnabled{
MsgTypeUrl: sdk.MsgTypeURL(&types.MsgEnableCCTX{}),
IsInboundEnabled: flags.IsInboundEnabled,
IsOutboundEnabled: flags.IsOutboundEnabled,
})

if err != nil {
ctx.Logger().Error("Error emitting EventCCTXFlagsEnabled :", err)
ctx.Logger().Error("Error emitting EventCCTXEnabled :", err)

Check warning on line 51 in x/observer/keeper/msg_server_enable_cctx_flags.go

View check run for this annotation

Codecov / codecov/patch

x/observer/keeper/msg_server_enable_cctx_flags.go#L51

Added line #L51 was not covered by tests
}

return &types.MsgEnableCCTXResponse{}, nil
Expand Down
Loading

0 comments on commit aa28f5e

Please sign in to comment.