Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed May 27, 2024
1 parent 1fcda05 commit 15e6ea4
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/cli/zetacored/zetacored_tx_observer.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ zetacored tx observer [flags]
* [zetacored tx observer remove-chain-params](zetacored_tx_observer_remove-chain-params.md) - Broadcast message to remove chain params
* [zetacored tx observer reset-chain-nonces](zetacored_tx_observer_reset-chain-nonces.md) - Broadcast message to reset chain nonces
* [zetacored tx observer update-chain-params](zetacored_tx_observer_update-chain-params.md) - Broadcast message updateChainParams
* [zetacored tx observer update-gas-price-increase-flags](zetacored_tx_observer_update-gas-price-increase-flags.md) - Enable inbound and outbound cross-chain flags
* [zetacored tx observer update-gas-price-increase-flags](zetacored_tx_observer_update-gas-price-increase-flags.md) - Update the gas price increase flags
* [zetacored tx observer update-keygen](zetacored_tx_observer_update-keygen.md) - command to update the keygen block via a group proposal
* [zetacored tx observer update-observer](zetacored_tx_observer_update-observer.md) - Broadcast message add-observer
* [zetacored tx observer vote-tss](zetacored_tx_observer_vote-tss.md) - Vote for a new TSS creation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tx observer update-gas-price-increase-flags

Enable inbound and outbound cross-chain flags
Update the gas price increase flags

```
zetacored tx observer update-gas-price-increase-flags [epochLength] [retryInterval] [gasPriceIncreasePercent] [gasPriceIncreaseMax] [maxPendingCctxs] [flags]
Expand Down
9 changes: 9 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 {

## MsgEnableCCTXFlags

EnableCCTXFlags 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 MsgEnableCCTXFlags {
string creator = 1;
Expand All @@ -138,6 +141,9 @@ message MsgEnableCCTXFlags {

## MsgDisableCCTXFlags

DisableCCTXFlags 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 MsgDisableCCTXFlags {
string creator = 1;
Expand All @@ -148,6 +154,9 @@ message MsgDisableCCTXFlags {

## MsgUpdateGasPriceIncreaseFlags

UpdateGasPriceIncreaseFlags updates the GasPriceIncreaseFlags. These flags control the increase of gas prices.
The flags are updated by the policy account with the groupOperational policy type.

```proto
message MsgUpdateGasPriceIncreaseFlags {
string creator = 1;
Expand Down
14 changes: 7 additions & 7 deletions x/observer/client/cli/tx_update_gas_price_increase_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
func CmdUpdateGasPriceIncreaseFlags() *cobra.Command {
cmd := &cobra.Command{
Use: "update-gas-price-increase-flags [epochLength] [retryInterval] [gasPriceIncreasePercent] [gasPriceIncreaseMax] [maxPendingCctxs]",
Short: "Enable inbound and outbound cross-chain flags",
Args: cobra.ExactArgs(2),
Short: "Update the gas price increase flags",
Args: cobra.ExactArgs(5),
RunE: func(cmd *cobra.Command, args []string) (err error) {

clientCtx, err := client.GetClientTxContext(cmd)
Expand Down Expand Up @@ -45,11 +45,11 @@ func CmdUpdateGasPriceIncreaseFlags() *cobra.Command {
return err
}
gasPriceIncreaseFlags := types.GasPriceIncreaseFlags{
epochLength,
time.Duration(retryInterval),
uint32(gasPriceIncreasePercent),
uint32(gasPriceIncreaseMax),
uint32(maxPendingCctxs)}
EpochLength: epochLength,
RetryInterval: time.Duration(retryInterval),
GasPriceIncreasePercent: uint32(gasPriceIncreasePercent),
GasPriceIncreaseMax: uint32(gasPriceIncreaseMax),
MaxPendingCctxs: uint32(maxPendingCctxs)}
msg := types.NewMsgUpdateGasPriceIncreaseFlags(clientCtx.GetFromAddress().String(), gasPriceIncreaseFlags)
err = msg.ValidateBasic()
if err != nil {
Expand Down
6 changes: 4 additions & 2 deletions x/observer/keeper/msg_server_disable_cctx_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/zeta-chain/zetacore/x/observer/types"
)

// DisableCCTXFlags 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.
func (k msgServer) DisableCCTXFlags(
goCtx context.Context,
msg *types.MsgDisableCCTXFlags,
Expand All @@ -18,7 +20,7 @@ func (k msgServer) DisableCCTXFlags(
// check permission
if !k.GetAuthorityKeeper().IsAuthorized(ctx, msg.Creator, authoritytypes.PolicyType_groupEmergency) {
return &types.MsgDisableCCTXFlagsResponse{}, authoritytypes.ErrUnauthorized.Wrap(
"EnableCCTXFlags can only be executed by the correct policy account",
"DisableCCTXFlags can only be executed by the correct policy account",
)
}

Expand Down Expand Up @@ -46,7 +48,7 @@ func (k msgServer) DisableCCTXFlags(
})

if err != nil {
ctx.Logger().Error("Error emitting event EventCrosschainFlagsUpdated :", err)
ctx.Logger().Error("Error emitting event EventCCTXFlagsDisabled :", 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.MsgDisableCCTXFlagsResponse{}, nil
Expand Down
4 changes: 3 additions & 1 deletion x/observer/keeper/msg_server_enable_cctx_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/zeta-chain/zetacore/x/observer/types"
)

// EnableCCTXFlags 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.
func (k msgServer) EnableCCTXFlags(
goCtx context.Context,
msg *types.MsgEnableCCTXFlags,
Expand Down Expand Up @@ -46,7 +48,7 @@ func (k msgServer) EnableCCTXFlags(
})

if err != nil {
ctx.Logger().Error("Error emitting event EventCrosschainFlagsUpdated :", err)
ctx.Logger().Error("Error emitting EventCCTXFlagsEnabled :", 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.MsgEnableCCTXFlagsResponse{}, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/zeta-chain/zetacore/x/observer/types"
)

// UpdateGasPriceIncreaseFlags updates the GasPriceIncreaseFlags. These flags control the increase of gas prices.
// The flags are updated by the policy account with the groupOperational policy type.
func (k msgServer) UpdateGasPriceIncreaseFlags(
goCtx context.Context,
msg *types.MsgUpdateGasPriceIncreaseFlags,
Expand All @@ -18,7 +20,7 @@ func (k msgServer) UpdateGasPriceIncreaseFlags(
// check permission
if !k.GetAuthorityKeeper().IsAuthorized(ctx, msg.Creator, authoritytypes.PolicyType_groupOperational) {
return &types.MsgUpdateGasPriceIncreaseFlagsResponse{}, authoritytypes.ErrUnauthorized.Wrap(
"EnableCCTXFlags can only be executed by the correct policy account",
"UpdateGasPriceIncreaseFlags can only be executed by the correct policy account",
)
}
// check if the value exists,
Expand All @@ -45,7 +47,7 @@ func (k msgServer) UpdateGasPriceIncreaseFlags(
})

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

Check warning on line 50 in x/observer/keeper/msg_server_update_gas_price_increase_flags.go

View check run for this annotation

Codecov / codecov/patch

x/observer/keeper/msg_server_update_gas_price_increase_flags.go#L50

Added line #L50 was not covered by tests
}

return &types.MsgUpdateGasPriceIncreaseFlagsResponse{}, nil
Expand Down

0 comments on commit 15e6ea4

Please sign in to comment.