Skip to content

Commit

Permalink
add event for pausing
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Aug 12, 2024
1 parent eab6e3a commit 63b7baa
Show file tree
Hide file tree
Showing 4 changed files with 348 additions and 48 deletions.
6 changes: 6 additions & 0 deletions proto/zetachain/zetacore/crosschain/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,9 @@ message EventERC20CustodyFundsMigration {
string amount = 3;
string cctx_index = 4;
}

message EventERC20CustodyPausing {
int64 chain_id = 1;
bool pause = 2;
string cctx_index = 3;
}
34 changes: 34 additions & 0 deletions typescript/zetachain/zetacore/crosschain/events_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,3 +393,37 @@ export declare class EventERC20CustodyFundsMigration extends Message<EventERC20C
static equals(a: EventERC20CustodyFundsMigration | PlainMessage<EventERC20CustodyFundsMigration> | undefined, b: EventERC20CustodyFundsMigration | PlainMessage<EventERC20CustodyFundsMigration> | undefined): boolean;
}

/**
* @generated from message zetachain.zetacore.crosschain.EventERC20CustodyPausing
*/
export declare class EventERC20CustodyPausing extends Message<EventERC20CustodyPausing> {
/**
* @generated from field: int64 chain_id = 1;
*/
chainId: bigint;

/**
* @generated from field: bool pause = 2;
*/
pause: boolean;

/**
* @generated from field: string cctx_index = 3;
*/
cctxIndex: string;

constructor(data?: PartialMessage<EventERC20CustodyPausing>);

static readonly runtime: typeof proto3;
static readonly typeName = "zetachain.zetacore.crosschain.EventERC20CustodyPausing";
static readonly fields: FieldList;

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

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

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

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

Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ func (k msgServer) UpdateERC20CustodyPauseStatus(
}
k.SetCctxAndNonceToCctxAndInboundHashToCctx(ctx, cctx)

err = ctx.EventManager().EmitTypedEvent(
&types.EventERC20CustodyPausing{
ChainId: msg.ChainId,
Pause: msg.Pause,
CctxIndex: cctx.Index,
},
)
if err != nil {
return nil, errorsmod.Wrapf(err, "failed to emit event")
}

return &types.MsgUpdateERC20CustodyPauseStatusResponse{
CctxIndex: cctx.Index,
}, nil
Expand Down
Loading

0 comments on commit 63b7baa

Please sign in to comment.