Skip to content

Commit

Permalink
remove action from tx Unpause and Pause
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed May 27, 2024
1 parent 63e2c3c commit fa956b7
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 69 deletions.
2 changes: 1 addition & 1 deletion proto/zetachain/zetacore/fungible/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ message EventZRC20Paused {
string signer = 3;
}

message EventZRC20UnPaused {
message EventZRC20Unpaused {
string msg_type_url = 1;
repeated string zrc20_addresses = 2;
string signer = 3;
Expand Down
16 changes: 8 additions & 8 deletions typescript/zetachain/zetacore/fungible/events_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ export declare class EventZRC20Paused extends Message<EventZRC20Paused> {
}

/**
* @generated from message zetachain.zetacore.fungible.EventZRC20UnPaused
* @generated from message zetachain.zetacore.fungible.EventZRC20Unpaused
*/
export declare class EventZRC20UnPaused extends Message<EventZRC20UnPaused> {
export declare class EventZRC20Unpaused extends Message<EventZRC20Unpaused> {
/**
* @generated from field: string msg_type_url = 1;
*/
Expand All @@ -227,19 +227,19 @@ export declare class EventZRC20UnPaused extends Message<EventZRC20UnPaused> {
*/
signer: string;

constructor(data?: PartialMessage<EventZRC20UnPaused>);
constructor(data?: PartialMessage<EventZRC20Unpaused>);

static readonly runtime: typeof proto3;
static readonly typeName = "zetachain.zetacore.fungible.EventZRC20UnPaused";
static readonly typeName = "zetachain.zetacore.fungible.EventZRC20Unpaused";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EventZRC20UnPaused;
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EventZRC20Unpaused;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EventZRC20UnPaused;
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EventZRC20Unpaused;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EventZRC20UnPaused;
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EventZRC20Unpaused;

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

/**
Expand Down
19 changes: 0 additions & 19 deletions x/fungible/client/cli/tx_update_zrc20_paused_status.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package cli

import (
"strconv"
"strings"

cosmoserrors "cosmossdk.io/errors"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/spf13/cobra"

"github.com/zeta-chain/zetacore/x/fungible/types"
Expand All @@ -28,14 +25,6 @@ func CmdPauseZRC20() *cobra.Command {

contractAddressList := strings.Split(strings.TrimSpace(args[0]), ",")

action, err := strconv.ParseUint(args[1], 10, 32)
if err != nil {
return err
}
if (action != 0) && (action != 1) {
return cosmoserrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid action (%d)", action)
}

msg := types.NewMsgPauseZRC20(
clientCtx.GetFromAddress().String(),
contractAddressList,
Expand Down Expand Up @@ -64,14 +53,6 @@ func CmdUnpauseZRC20() *cobra.Command {

contractAddressList := strings.Split(strings.TrimSpace(args[0]), ",")

action, err := strconv.ParseUint(args[1], 10, 32)
if err != nil {
return err
}
if (action != 0) && (action != 1) {
return cosmoserrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid action (%d)", action)
}

msg := types.NewMsgUnpauseZRC20(
clientCtx.GetFromAddress().String(),
contractAddressList,
Expand Down
4 changes: 2 additions & 2 deletions x/fungible/keeper/msg_server_unpause_zrc20.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ func (k msgServer) UnpauseZRC20(
}

err := ctx.EventManager().EmitTypedEvent(
&types.EventZRC20UnPaused{
&types.EventZRC20Unpaused{
MsgTypeUrl: sdk.MsgTypeURL(&types.MsgUnpauseZRC20{}),
Zrc20Addresses: msg.Zrc20Addresses,
Signer: msg.Creator,
},
)
if err != nil {
k.Logger(ctx).Error("failed to emit event",
"event", "EventZRC20UnPaused",
"event", "EventZRC20Unpaused",
"error", err.Error(),
)
return nil, cosmoserrors.Wrapf(types.ErrEmitEvent, "failed to emit event (%s)", err.Error())
Expand Down
78 changes: 39 additions & 39 deletions x/fungible/types/events.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fa956b7

Please sign in to comment.