Skip to content

Commit

Permalink
Merge pull request #550 from bandprotocol/fix-command
Browse files Browse the repository at this point in the history
Adjust wording, params
  • Loading branch information
RogerKSI authored Jan 13, 2025
2 parents ae94e87 + 732205e commit 415d192
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## [v3.0.0](https://github.com/bandprotocol/chain/releases/tag/v3.0.0)

* (bump) Use go 1.22.3
* (bump) Use cosmos-sdk package v0.50.10 / ibc-go v8.5.2
* (bump) Use cosmos-sdk package v0.50.11 / ibc-go v8.5.2
* (bump) replace github.com/tendermint/tendermint by github.com/cometbft/cometbft v0.38.12
* (bump) migrated from gogo/protobuf to cosmos/gogoproto
* (bump) Use go-owasm v0.3.1
Expand Down
2 changes: 1 addition & 1 deletion scripts/start_grogu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ sleep 3
# add feeder to bandchain
echo "y" | bandd tx feeds add-feeders $(grogu keys list -a) --from validator --gas-prices 0.0025uband --keyring-backend test --chain-id bandchain

# wait for addding feeder transaction success
# wait for adding feeder transaction success
sleep 3

# run grogu
Expand Down
2 changes: 1 addition & 1 deletion scripts/tunnel/update_and_reset_tunnel.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bandd tx tunnel update-and-reset-tunnel 1 60 ./scripts/tunnel/signal_deviations.json --from requester --keyring-backend test --gas-prices 0.0025uband -y --chain-id bandchain
bandd tx tunnel update-signals-and-interval 1 60 ./scripts/tunnel/signal_deviations.json --from requester --keyring-backend test --gas-prices 0.0025uband -y --chain-id bandchain
38 changes: 29 additions & 9 deletions x/bandtss/keeper/keeper_signing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package keeper_test
import (
"go.uber.org/mock/gomock"

"cosmossdk.io/math"

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/bandprotocol/chain/v3/pkg/tss"
Expand Down Expand Up @@ -35,6 +37,8 @@ func (s *KeeperTestSuite) TestCreateDirectSigningRequest() {
{
name: "test success with only current group",
preProcess: func(s *KeeperTestSuite) {
params := s.keeper.GetParams(s.ctx)

s.keeper.SetCurrentGroup(s.ctx, types.NewCurrentGroup(currentGroupID, s.ctx.BlockTime()))

s.tssKeeper.EXPECT().GetGroup(gomock.Any(), currentGroupID).
Expand All @@ -46,10 +50,12 @@ func (s *KeeperTestSuite) TestCreateDirectSigningRequest() {
gomock.Any(),
bandtesting.Alice.Address,
types.ModuleName,
sdk.NewCoins(sdk.NewInt64Coin("uband", 20)),
params.FeePerSigner.MulInt(math.NewInt(2)),
).Return(nil)
},
postCheck: func(s *KeeperTestSuite) {
params := s.keeper.GetParams(s.ctx)

// check mapping of tss signingID -> bandtss signingID
actualMappedSigningID := s.keeper.GetSigningIDMapping(s.ctx, tss.SigningID(1))
s.Require().Equal(types.SigningID(1), actualMappedSigningID)
Expand All @@ -59,7 +65,7 @@ func (s *KeeperTestSuite) TestCreateDirectSigningRequest() {
s.Require().NoError(err)
s.Require().Equal(types.Signing{
ID: types.SigningID(1),
FeePerSigner: sdk.NewCoins(sdk.NewInt64Coin("uband", 10)),
FeePerSigner: params.FeePerSigner,
Requester: bandtesting.Alice.Address.String(),
CurrentGroupSigningID: tss.SigningID(1),
IncomingGroupSigningID: tss.SigningID(0),
Expand All @@ -74,6 +80,8 @@ func (s *KeeperTestSuite) TestCreateDirectSigningRequest() {
{
name: "test failed insufficient member in current group even normal incoming group",
preProcess: func(s *KeeperTestSuite) {
params := s.keeper.GetParams(s.ctx)

incomingGroupID := tss.GroupID(2)
transition := types.GroupTransition{
SigningID: tss.SigningID(1),
Expand Down Expand Up @@ -103,7 +111,7 @@ func (s *KeeperTestSuite) TestCreateDirectSigningRequest() {
gomock.Any(),
bandtesting.Alice.Address,
types.ModuleName,
sdk.NewCoins(sdk.NewInt64Coin("uband", 20)),
params.FeePerSigner.MulInt(math.NewInt(2)),
).Return(nil)
},
postCheck: func(s *KeeperTestSuite) {
Expand All @@ -118,6 +126,8 @@ func (s *KeeperTestSuite) TestCreateDirectSigningRequest() {
{
name: "test success with only current group; insufficient member on incoming group",
preProcess: func(s *KeeperTestSuite) {
params := s.keeper.GetParams(s.ctx)

incomingGroupID := tss.GroupID(2)
transition := types.GroupTransition{
SigningID: tss.SigningID(1),
Expand Down Expand Up @@ -158,10 +168,12 @@ func (s *KeeperTestSuite) TestCreateDirectSigningRequest() {
gomock.Any(),
bandtesting.Alice.Address,
types.ModuleName,
sdk.NewCoins(sdk.NewInt64Coin("uband", 20)),
params.FeePerSigner.MulInt(math.NewInt(2)),
).Return(nil)
},
postCheck: func(s *KeeperTestSuite) {
params := s.keeper.GetParams(s.ctx)

// check mapping of tss signingID -> bandtss signingID
actualMappedSigningID := s.keeper.GetSigningIDMapping(s.ctx, tss.SigningID(1))
s.Require().Equal(types.SigningID(1), actualMappedSigningID)
Expand All @@ -171,7 +183,7 @@ func (s *KeeperTestSuite) TestCreateDirectSigningRequest() {
s.Require().NoError(err)
s.Require().Equal(types.Signing{
ID: types.SigningID(1),
FeePerSigner: sdk.NewCoins(sdk.NewInt64Coin("uband", 10)),
FeePerSigner: params.FeePerSigner,
Requester: bandtesting.Alice.Address.String(),
CurrentGroupSigningID: tss.SigningID(1),
IncomingGroupSigningID: tss.SigningID(0),
Expand All @@ -189,6 +201,8 @@ func (s *KeeperTestSuite) TestCreateDirectSigningRequest() {
{
name: "test success with both current and incoming group",
preProcess: func(s *KeeperTestSuite) {
params := s.keeper.GetParams(s.ctx)

incomingGroupID := tss.GroupID(2)
transition := types.GroupTransition{
SigningID: tss.SigningID(1),
Expand All @@ -210,10 +224,12 @@ func (s *KeeperTestSuite) TestCreateDirectSigningRequest() {
gomock.Any(),
bandtesting.Alice.Address,
types.ModuleName,
sdk.NewCoins(sdk.NewInt64Coin("uband", 20)),
params.FeePerSigner.MulInt(math.NewInt(2)),
).Return(nil)
},
postCheck: func(s *KeeperTestSuite) {
params := s.keeper.GetParams(s.ctx)

// check mapping of tss signingID -> bandtss signingID
bandtssSignignID := s.keeper.GetSigningIDMapping(s.ctx, tss.SigningID(2))
s.Require().Equal(types.SigningID(1), bandtssSignignID)
Expand All @@ -225,7 +241,7 @@ func (s *KeeperTestSuite) TestCreateDirectSigningRequest() {
s.Require().NoError(err)
s.Require().Equal(types.Signing{
ID: types.SigningID(1),
FeePerSigner: sdk.NewCoins(sdk.NewInt64Coin("uband", 10)),
FeePerSigner: params.FeePerSigner,
Requester: bandtesting.Alice.Address.String(),
CurrentGroupSigningID: tss.SigningID(2),
IncomingGroupSigningID: tss.SigningID(3),
Expand All @@ -240,6 +256,8 @@ func (s *KeeperTestSuite) TestCreateDirectSigningRequest() {
{
name: "request only current group; transition message is not signed",
preProcess: func(s *KeeperTestSuite) {
params := s.keeper.GetParams(s.ctx)

incomingGroupID := tss.GroupID(2)
transition := types.GroupTransition{
SigningID: tss.SigningID(1),
Expand All @@ -259,10 +277,12 @@ func (s *KeeperTestSuite) TestCreateDirectSigningRequest() {
gomock.Any(),
bandtesting.Alice.Address,
types.ModuleName,
sdk.NewCoins(sdk.NewInt64Coin("uband", 20)),
params.FeePerSigner.MulInt(math.NewInt(2)),
).Return(nil)
},
postCheck: func(s *KeeperTestSuite) {
params := s.keeper.GetParams(s.ctx)

// check mapping of tss signingID -> bandtss signingID
bandtssSignignID := s.keeper.GetSigningIDMapping(s.ctx, tss.SigningID(4))
s.Require().Equal(types.SigningID(1), bandtssSignignID)
Expand All @@ -272,7 +292,7 @@ func (s *KeeperTestSuite) TestCreateDirectSigningRequest() {
s.Require().NoError(err)
s.Require().Equal(types.Signing{
ID: types.SigningID(1),
FeePerSigner: sdk.NewCoins(sdk.NewInt64Coin("uband", 10)),
FeePerSigner: params.FeePerSigner,
Requester: bandtesting.Alice.Address.String(),
CurrentGroupSigningID: tss.SigningID(4),
IncomingGroupSigningID: tss.SigningID(0),
Expand Down
4 changes: 2 additions & 2 deletions x/bandtss/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ func (s *AppTestSuite) TestSuccessRequestSignatureOnCurrentGroup() {

msg, err := types.NewMsgRequestSignature(
tsstypes.NewTextSignatureOrder([]byte("msg")),
sdk.NewCoins(sdk.NewInt64Coin("uband", 100)),
sdk.NewCoins(sdk.NewInt64Coin("uband", 1000)),
bandtesting.FeePayer.Address.String(),
)
s.Require().NoError(err)
Expand Down Expand Up @@ -540,7 +540,7 @@ func (s *AppTestSuite) TestSuccessRequestSignatureOnBothGroups() {

msg, err := types.NewMsgRequestSignature(
tsstypes.NewTextSignatureOrder([]byte("msg")),
sdk.NewCoins(sdk.NewInt64Coin("uband", 100)),
sdk.NewCoins(sdk.NewInt64Coin("uband", 1000)),
bandtesting.FeePayer.Address.String(),
)
s.Require().NoError(err)
Expand Down
4 changes: 2 additions & 2 deletions x/bandtss/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const (
DefaultRewardPercentage = uint64(10)
)

// DefaultFeePerSigner is the default value for the signing request fee. The value is ["10uband"]
var DefaultFeePerSigner = sdk.NewCoins(sdk.NewInt64Coin("uband", 10))
// DefaultFeePerSigner is the default value for the signing request fee per signer.
var DefaultFeePerSigner = sdk.NewCoins(sdk.NewInt64Coin("uband", 50))

// NewParams creates a new Params instance
func NewParams(
Expand Down
4 changes: 2 additions & 2 deletions x/tunnel/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ func GetTxCmdUpdateIBCRoute() *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",
Use: "update-signals-and-interval [tunnel-id] [interval] [signalDeviations-json-file] ",
Short: "Update signals and interval of the existing tunnel",
Args: cobra.ExactArgs(3),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientTxContext(cmd)
Expand Down
2 changes: 1 addition & 1 deletion x/tunnel/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var (
DefaultMaxDeviationBPS = uint64(3000)
DefaultMinDeposit = sdk.NewCoins(sdk.NewInt64Coin("uband", 1_000_000_000))
DefaultMaxSignals = uint64(25)
DefaultBasePacketFee = sdk.NewCoins(sdk.NewInt64Coin("uband", 10_000))
DefaultBasePacketFee = sdk.NewCoins(sdk.NewInt64Coin("uband", 500))
)

// NewParams creates a new Params instance
Expand Down

0 comments on commit 415d192

Please sign in to comment.