Skip to content

Commit

Permalink
fix name
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerKSI committed Dec 4, 2024
1 parent b5efc76 commit 9029a4b
Show file tree
Hide file tree
Showing 14 changed files with 612 additions and 613 deletions.
762 changes: 381 additions & 381 deletions api/band/tunnel/v1beta1/tx.pulsar.go

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions api/band/tunnel/v1beta1/tx_grpc.pb.go

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

19 changes: 9 additions & 10 deletions proto/band/tunnel/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ service Msg {
// CreateTunnel is a RPC method to create a new tunnel.
rpc CreateTunnel(MsgCreateTunnel) returns (MsgCreateTunnelResponse);

// UpdateRoute is a RPC method to update a route tunnel.
// UpdateRoute is a RPC method to update a route information of the tunnel.
rpc UpdateRoute(MsgUpdateRoute) returns (MsgUpdateRouteResponse);

// UpdateAndResetTunnel is a RPC method to update a tunnel information and reset the interval.
rpc UpdateAndResetTunnel(MsgUpdateAndResetTunnel) returns (MsgUpdateAndResetTunnelResponse);
// UpdateSignalsAndInterval is a RPC method to update a signals and interval of the tunnel.
rpc UpdateSignalsAndInterval(MsgUpdateSignalsAndInterval) returns (MsgUpdateSignalsAndIntervalResponse);

// Activate is a RPC method to activate a tunnel.
rpc Activate(MsgActivate) returns (MsgActivateResponse);
Expand Down Expand Up @@ -71,7 +71,7 @@ message MsgCreateTunnelResponse {
uint64 tunnel_id = 1 [(gogoproto.customname) = "TunnelID"];
}

// MsgUpdateRoute is the transaction message to update a route tunnel
// MsgUpdateRoute is the transaction message to update a route information of the tunnel.
message MsgUpdateRoute {
option (cosmos.msg.v1.signer) = "creator";
option (amino.name) = "tunnel/MsgUpdateRoute";
Expand All @@ -87,11 +87,10 @@ message MsgUpdateRoute {
// MsgUpdateRouteResponse is the response type for the Msg/UpdateRoute RPC method.
message MsgUpdateRouteResponse {}

// MsgUpdateAndResetTunnel is the transaction message to update a tunnel information
// and reset the interval.
message MsgUpdateAndResetTunnel {
// MsgUpdateSignalsAndInterval is the transaction message to update signals and interval of the tunnel.
message MsgUpdateSignalsAndInterval {
option (cosmos.msg.v1.signer) = "creator";
option (amino.name) = "tunnel/MsgUpdateAndResetTunnel";
option (amino.name) = "tunnel/MsgUpdateSignalsAndInterval";

// tunnel_id is the ID of the tunnel to edit.
uint64 tunnel_id = 1 [(gogoproto.customname) = "TunnelID"];
Expand All @@ -103,8 +102,8 @@ message MsgUpdateAndResetTunnel {
string creator = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

// MsgUpdateAndResetTunnelResponse is the response type for the Msg/UpdateAndResetTunnel RPC method.
message MsgUpdateAndResetTunnelResponse {}
// MsgUpdateSignalsAndIntervalResponse is the response type for the Msg/UpdateSignalsAndInterval RPC method.
message MsgUpdateSignalsAndIntervalResponse {}

// Activate is the transaction message to activate a tunnel.
message MsgActivate {
Expand Down
14 changes: 7 additions & 7 deletions x/tunnel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ The Tunnel module is designed to decentralize the creation of push-based price d
- [Params](#params)
- [Msg](#msg)
- [MsgCreateTunnel](#msgcreatetunnel)
- [MsgUpdateAndResetTunnel](#msgupdateandresettunnel)
- [MsgUpdateSignalsAndInterval](#msgupdatesignalsandinterval)
- [MsgActivate](#msgactivate)
- [MsgDeactivate](#msgdeactivate)
- [MsgTriggerTunnel](#msgtriggertunnel)
- [MsgDepositToTunnel](#msgdeposittotunnel)
- [MsgWithdrawFromTunnel](#msgwithdrawfromtunnel)
- [Events](#events)
- [Event: `create_tunnel`](#event-create_tunnel)
- [Event: `update_and_reset_tunnel`](#event-update_and_reset_tunnel)
- [Event: `update_signals_and_interval`](#event-update_signals_and_interval)
- [Event: `activate_tunnel`](#event-activate_tunnel)
- [Event: `deactivate_tunnel`](#event-deactivate_tunnel)
- [Event: `trigger_tunnel`](#event-trigger_tunnel)
Expand Down Expand Up @@ -257,16 +257,16 @@ message MsgCreateTunnel {
- **Route Selection**: Only one route can be chosen per tunnel.
- **Initial Deposit**: The initial deposit can be set to zero. Other users can contribute to the tunnel's deposit by send [MsgDepositToTunnel](#msgdeposittotunnel) message until it reaches the required minimum deposit.
### MsgUpdateAndResetTunnel
### MsgUpdateSignalsAndInterval
**Editable Arguments**: The following parameters can be modified within the tunnel: `signal_deviations` and `Interval`
```protobuf
// MsgUpdateAndResetTunnel is the transaction message to update a tunnel information
// MsgUpdateSignalsAndInterval is the transaction message to update a tunnel information
// and reset the interval.
message MsgUpdateAndResetTunnel {
message MsgUpdateSignalsAndInterval {
option (cosmos.msg.v1.signer) = "creator";
option (amino.name) = "tunnel/MsgUpdateAndResetTunnel";
option (amino.name) = "tunnel/MsgUpdateSignalsAndInterval";

// tunnel_id is the ID of the tunnel to edit.
uint64 tunnel_id = 1 [(gogoproto.customname) = "TunnelID"];
Expand Down Expand Up @@ -407,7 +407,7 @@ This event is emitted when a new tunnel is created.
| soft_deviation_bps[] | `{SignalDeviation.SoftDeviationBPS}}` |
| hard_deviation_bps[] | `{SignalDeviation.hardDeviationBPS}}` |
### Event: `update_and_reset_tunnel`
### Event: `update_signals_and_interval`
This event is emitted when an existing tunnel is edited.
Expand Down
6 changes: 3 additions & 3 deletions x/tunnel/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func GetTxCmd() *cobra.Command {
txCmd.AddCommand(
GetTxCmdCreateTunnel(),
GetTxCmdUpdateRoute(),
GetTxCmdUpdateAndResetTunnel(),
GetTxCmdUpdateSignalsAndInterval(),
GetTxCmdActivate(),
GetTxCmdDeactivate(),
GetTxCmdTriggerTunnel(),
Expand Down Expand Up @@ -206,7 +206,7 @@ func GetTxCmdUpdateIBCRoute() *cobra.Command {
return cmd
}

func GetTxCmdUpdateAndResetTunnel() *cobra.Command {
func GetTxCmdUpdateSignalsAndInterval() *cobra.Command {
cmd := &cobra.Command{
Use: "update-and-reset-tunnel [tunnel-id] [interval] [signalDeviations-json-file] ",
Short: "Update an existing tunnel and reset the latest price interval of the tunnel",
Expand All @@ -232,7 +232,7 @@ func GetTxCmdUpdateAndResetTunnel() *cobra.Command {
return err
}

msg := types.NewMsgUpdateAndResetTunnel(
msg := types.NewMsgUpdateSignalsAndInterval(
id,
signalDeviations.ToSignalDeviations(),
interval,
Expand Down
6 changes: 3 additions & 3 deletions x/tunnel/keeper/keeper_tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func (k Keeper) AddTunnel(
return &tunnel, nil
}

// UpdateAndResetTunnel edits a tunnel and reset latest signal price interval.
func (k Keeper) UpdateAndResetTunnel(
// UpdateSignalsAndInterval edits a tunnel and reset latest signal price interval.
func (k Keeper) UpdateSignalsAndInterval(
ctx sdk.Context,
tunnelID uint64,
signalDeviations []types.SignalDeviation,
Expand All @@ -97,7 +97,7 @@ func (k Keeper) UpdateAndResetTunnel(
k.SetLatestPrices(ctx, types.NewLatestPrices(tunnelID, []feedstypes.Price{}, 0))

event := sdk.NewEvent(
types.EventTypeUpdateAndResetTunnel,
types.EventTypeUpdateSignalsAndInterval,
sdk.NewAttribute(types.AttributeKeyTunnelID, fmt.Sprintf("%d", tunnel.ID)),
sdk.NewAttribute(types.AttributeKeyInterval, fmt.Sprintf("%d", tunnel.Interval)),
)
Expand Down
6 changes: 3 additions & 3 deletions x/tunnel/keeper/keeper_tunnel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (s *KeeperTestSuite) TestAddTunnel() {
s.Require().Equal(expectedPrices, latestPrices)
}

func (s *KeeperTestSuite) TestUpdateAndResetTunnel() {
func (s *KeeperTestSuite) TestUpdateSignalsAndInterval() {
ctx, k := s.ctx, s.keeper

initialRoute := &types.TSSRoute{}
Expand Down Expand Up @@ -97,8 +97,8 @@ func (s *KeeperTestSuite) TestUpdateAndResetTunnel() {
}
newInterval := uint64(20)

// call the UpdateAndResetTunnel function
err = k.UpdateAndResetTunnel(ctx, initialTunnel.ID, newSignalDeviations, newInterval)
// call the UpdateSignalsAndInterval function
err = k.UpdateSignalsAndInterval(ctx, initialTunnel.ID, newSignalDeviations, newInterval)
s.Require().NoError(err)

// validate the edited tunnel
Expand Down
12 changes: 6 additions & 6 deletions x/tunnel/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ func (k msgServer) UpdateRoute(
return &types.MsgUpdateRouteResponse{}, nil
}

// UpdateAndResetTunnel edits a tunnel and reset latest price interval.
func (k msgServer) UpdateAndResetTunnel(
// UpdateSignalsAndInterval edits a tunnel and reset latest price interval.
func (k msgServer) UpdateSignalsAndInterval(
goCtx context.Context,
msg *types.MsgUpdateAndResetTunnel,
) (*types.MsgUpdateAndResetTunnelResponse, error) {
msg *types.MsgUpdateSignalsAndInterval,
) (*types.MsgUpdateSignalsAndIntervalResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

params := k.Keeper.GetParams(ctx)
Expand All @@ -161,12 +161,12 @@ func (k msgServer) UpdateAndResetTunnel(
return nil, types.ErrInvalidTunnelCreator.Wrapf("creator %s, tunnelID %d", msg.Creator, msg.TunnelID)
}

err = k.Keeper.UpdateAndResetTunnel(ctx, msg.TunnelID, msg.SignalDeviations, msg.Interval)
err = k.Keeper.UpdateSignalsAndInterval(ctx, msg.TunnelID, msg.SignalDeviations, msg.Interval)
if err != nil {
return nil, err
}

return &types.MsgUpdateAndResetTunnelResponse{}, nil
return &types.MsgUpdateSignalsAndIntervalResponse{}, nil
}

// Activate activates a tunnel.
Expand Down
Loading

0 comments on commit 9029a4b

Please sign in to comment.