From d7cd1adf5af68dcc2b0a5b4858e751f45bf24a45 Mon Sep 17 00:00:00 2001 From: kogisin Date: Fri, 22 Sep 2023 17:36:02 +0900 Subject: [PATCH 1/8] feat: remove TODO comment --- custom/bank/keeper/keeper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom/bank/keeper/keeper.go b/custom/bank/keeper/keeper.go index a71599d8c..deda06011 100644 --- a/custom/bank/keeper/keeper.go +++ b/custom/bank/keeper/keeper.go @@ -41,7 +41,7 @@ func NewBaseKeeper( authority string, ) Keeper { keeper := Keeper{ - BaseKeeper: bankkeeper.NewBaseKeeper(cdc, storeKey, ak, blockedAddrs, authority), // TODO: how to set authority? + BaseKeeper: bankkeeper.NewBaseKeeper(cdc, storeKey, ak, blockedAddrs, authority), ak: alliancekeeper.Keeper{}, sk: stakingkeeper.Keeper{}, tfmk: tfmk, From 7cd63776c15c62d23d05b4f27bae61d1c4c1fd58 Mon Sep 17 00:00:00 2001 From: kogisin Date: Fri, 22 Sep 2023 17:38:22 +0900 Subject: [PATCH 2/8] fix: fix invalid stateless check in MsgAddAccountToFundModuleSet --- x/mint/types/msg.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/mint/types/msg.go b/x/mint/types/msg.go index 7e212589d..4e81a18be 100644 --- a/x/mint/types/msg.go +++ b/x/mint/types/msg.go @@ -68,14 +68,14 @@ func (m MsgAddAccountToFundModuleSet) GetSignBytes() []byte { // ValidateBasic does a sanity check on the provided data. func (m MsgAddAccountToFundModuleSet) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(m.AllowedAddress) + _, err := sdk.AccAddressFromBech32(m.Authority) if err != nil { - return errorsmod.Wrap(err, "from address must be valid address") + return errorsmod.Wrap(err, "authority must be valid address") } _, err = sdk.AccAddressFromBech32(m.AllowedAddress) if err != nil { - return errorsmod.Wrap(err, "from address must be valid address") + return errorsmod.Wrap(err, "allowed address must be valid address") } return nil From 8b0e15f4aebbbe1794720705e24450e9ddac6a3f Mon Sep 17 00:00:00 2001 From: kogisin Date: Fri, 22 Sep 2023 17:40:25 +0900 Subject: [PATCH 3/8] fix: remove duplicate validation --- x/mint/keeper/msg_server.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/x/mint/keeper/msg_server.go b/x/mint/keeper/msg_server.go index 89a6c2876..64a984a44 100644 --- a/x/mint/keeper/msg_server.go +++ b/x/mint/keeper/msg_server.go @@ -70,10 +70,6 @@ func (ms msgServer) FundModuleAccount(goCtx context.Context, req *types.MsgFundM func (ms msgServer) AddAccountToFundModuleSet(goCtx context.Context, req *types.MsgAddAccountToFundModuleSet) (*types.MsgAddAccountToFundModuleSetResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - err := req.ValidateBasic() - if err != nil { - return nil, errorsmod.Wrapf(types.ErrValidationMsg, "invalid req msg %v - err %v", req, err) - } if ms.authority != req.Authority { return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.authority, req.Authority) From b7e0b5e2974fec0c20e98907adefcb0ba8b407b1 Mon Sep 17 00:00:00 2001 From: kogisin Date: Fri, 22 Sep 2023 17:42:17 +0900 Subject: [PATCH 4/8] fix: typographic error --- x/ratelimit/client/cli/tx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ratelimit/client/cli/tx.go b/x/ratelimit/client/cli/tx.go index f4bdde62b..81a06d730 100644 --- a/x/ratelimit/client/cli/tx.go +++ b/x/ratelimit/client/cli/tx.go @@ -11,7 +11,7 @@ import ( // GetTxCmd returns the tx commands for router func GetTxCmd() *cobra.Command { txCmd := &cobra.Command{ - Use: "transfermiddleware", + Use: "ratelimit", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, Short: fmt.Sprintf("Tx commands for the %s module", types.ModuleName), From e08342b5559b46ce9f08571b0ea3088df689a3da Mon Sep 17 00:00:00 2001 From: kogisin Date: Fri, 22 Sep 2023 17:44:09 +0900 Subject: [PATCH 5/8] chore: use types.ModuleName and rename cli.go to query.go --- x/ratelimit/client/cli/tx.go | 2 +- x/transfermiddleware/client/cli/{cli.go => query.go} | 2 +- x/transfermiddleware/client/cli/tx.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename x/transfermiddleware/client/cli/{cli.go => query.go} (97%) diff --git a/x/ratelimit/client/cli/tx.go b/x/ratelimit/client/cli/tx.go index 81a06d730..4cc99b618 100644 --- a/x/ratelimit/client/cli/tx.go +++ b/x/ratelimit/client/cli/tx.go @@ -11,7 +11,7 @@ import ( // GetTxCmd returns the tx commands for router func GetTxCmd() *cobra.Command { txCmd := &cobra.Command{ - Use: "ratelimit", + Use: types.ModuleName, DisableFlagParsing: true, SuggestionsMinimumDistance: 2, Short: fmt.Sprintf("Tx commands for the %s module", types.ModuleName), diff --git a/x/transfermiddleware/client/cli/cli.go b/x/transfermiddleware/client/cli/query.go similarity index 97% rename from x/transfermiddleware/client/cli/cli.go rename to x/transfermiddleware/client/cli/query.go index 6e4aec095..39a1fbc2c 100644 --- a/x/transfermiddleware/client/cli/cli.go +++ b/x/transfermiddleware/client/cli/query.go @@ -14,7 +14,7 @@ import ( // GetQueryCmd returns the query commands for router func GetQueryCmd() *cobra.Command { queryCmd := &cobra.Command{ - Use: "transfermiddleware", + Use: types.ModuleName, DisableFlagParsing: true, SuggestionsMinimumDistance: 2, } diff --git a/x/transfermiddleware/client/cli/tx.go b/x/transfermiddleware/client/cli/tx.go index 65757d25d..8947cd60d 100644 --- a/x/transfermiddleware/client/cli/tx.go +++ b/x/transfermiddleware/client/cli/tx.go @@ -15,7 +15,7 @@ import ( // GetTxCmd returns the tx commands for router func GetTxCmd() *cobra.Command { txCmd := &cobra.Command{ - Use: "transfermiddleware", + Use: types.ModuleName, DisableFlagParsing: true, SuggestionsMinimumDistance: 2, Short: "Registry and remove IBC dotsama chain information", From df9903e4dbf4f48c04758f0165c8c55ee84e031d Mon Sep 17 00:00:00 2001 From: kogisin Date: Mon, 25 Sep 2023 19:38:44 +0900 Subject: [PATCH 6/8] ci: add an explicit permissions for interchaintest workflow action --- .github/workflows/interchaintest.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/interchaintest.yml b/.github/workflows/interchaintest.yml index c605eaf7f..6473c261e 100644 --- a/.github/workflows/interchaintest.yml +++ b/.github/workflows/interchaintest.yml @@ -9,6 +9,9 @@ on: jobs: build-and-push-image: runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - name: Check out the repo uses: actions/checkout@v3 From 1d6dd617414a200e900070116d13b2977d33b88b Mon Sep 17 00:00:00 2001 From: kogisin Date: Mon, 25 Sep 2023 19:58:40 +0900 Subject: [PATCH 7/8] ci: replace to actor to test --- .github/workflows/interchaintest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/interchaintest.yml b/.github/workflows/interchaintest.yml index 6473c261e..829de73b8 100644 --- a/.github/workflows/interchaintest.yml +++ b/.github/workflows/interchaintest.yml @@ -21,7 +21,7 @@ jobs: uses: docker/login-action@v2 with: registry: ghcr.io - username: ${{ github.repository_owner }} + username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push id: build_push_image From cf3951d994fbbe1f265d79364d4c2ea3c70a9da0 Mon Sep 17 00:00:00 2001 From: kogisin Date: Mon, 25 Sep 2023 20:07:11 +0900 Subject: [PATCH 8/8] revert: revert tested codes --- .github/workflows/interchaintest.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/interchaintest.yml b/.github/workflows/interchaintest.yml index 829de73b8..c605eaf7f 100644 --- a/.github/workflows/interchaintest.yml +++ b/.github/workflows/interchaintest.yml @@ -9,9 +9,6 @@ on: jobs: build-and-push-image: runs-on: ubuntu-latest - permissions: - contents: read - packages: write steps: - name: Check out the repo uses: actions/checkout@v3 @@ -21,7 +18,7 @@ jobs: uses: docker/login-action@v2 with: registry: ghcr.io - username: ${{ github.actor }} + username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push id: build_push_image