From 92c2633a4b5418774761dcb85ef64959d251943d Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 8 Aug 2022 15:14:30 -0400 Subject: [PATCH 1/3] updates --- CHANGELOG.md | 1 + x/auth/ante/fee.go | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cad0d2cfd9e5..79b693d56f89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (events) [#12850](https://github.com/cosmos/cosmos-sdk/pull/12850) Add a new `fee_payer` attribute to the `tx` event that is emitted from the `DeductFeeDecorator` AnteHandler decorator. * (x/bank) [#12706](https://github.com/cosmos/cosmos-sdk/pull/12706) Added the `chain-id` flag to the `AddTxFlagsToCmd` API. There is no longer a need to explicitly register this flag on commands whens `AddTxFlagsToCmd` is already called. * [#12791](https://github.com/cosmos/cosmos-sdk/pull/12791) Bump the math library used in the sdk and replace old usages of sdk.* * (x/params) [#12615](https://github.com/cosmos/cosmos-sdk/pull/12615) Add `GetParamSetIfExists` function to params `Subspace` to prevent panics on breaking changes. diff --git a/x/auth/ante/fee.go b/x/auth/ante/fee.go index 8ebac703b16f..4ab9dda9ee1a 100644 --- a/x/auth/ante/fee.go +++ b/x/auth/ante/fee.go @@ -110,8 +110,11 @@ func (dfd DeductFeeDecorator) checkDeductFee(ctx sdk.Context, sdkTx sdk.Tx, fee } events := sdk.Events{ - sdk.NewEvent(sdk.EventTypeTx, sdk.NewAttribute(sdk.AttributeKeyFee, fee.String())), - sdk.NewEvent(sdk.EventTypeTx, sdk.NewAttribute(sdk.AttributeKeyFeePayer, deductFeesFrom.String())), + sdk.NewEvent( + sdk.EventTypeTx, + sdk.NewAttribute(sdk.AttributeKeyFee, fee.String()), + sdk.NewAttribute(sdk.AttributeKeyFeePayer, deductFeesFrom.String()), + ), } ctx.EventManager().EmitEvents(events) From 0ecf2d2df644b0fc2982dd839e2eff24a2d59e4d Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 8 Aug 2022 15:44:19 -0400 Subject: [PATCH 2/3] updates --- x/auth/tx/service_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/auth/tx/service_test.go b/x/auth/tx/service_test.go index b6ac4d42ed61..f609d87f74ab 100644 --- a/x/auth/tx/service_test.go +++ b/x/auth/tx/service_test.go @@ -225,7 +225,7 @@ func (s IntegrationTestSuite) TestSimulateTx_GRPC() { // - tx.* events: tx.fee, tx.acc_seq, tx.signature // - Sending Amount to recipient: coin_spent, coin_received, transfer and message.sender= // - Msg events: message.module=bank and message.action=/cosmos.bank.v1beta1.MsgSend - s.Require().Equal(len(res.GetResult().GetEvents()), 14) // 1 coin recv 1 coin spent, 1 transfer, 3 messages. + s.Require().Equal(len(res.GetResult().GetEvents()), 13) // 1 coin recv 1 coin spent, 1 transfer, 3 messages. s.Require().True(res.GetGasInfo().GetGasUsed() > 0) // Gas used sometimes change, just check it's not empty. } }) @@ -267,7 +267,7 @@ func (s IntegrationTestSuite) TestSimulateTx_GRPCGateway() { s.Require().NoError(err) // Check the result and gas used are correct. s.Require().Len(result.GetResult().MsgResponses, 1) - s.Require().Equal(len(result.GetResult().GetEvents()), 14) // See TestSimulateTx_GRPC for the 13 events. + s.Require().Equal(len(result.GetResult().GetEvents()), 13) // See TestSimulateTx_GRPC for the 13 events. s.Require().True(result.GetGasInfo().GetGasUsed() > 0) // Gas used sometimes change, jus } }) From 46d57b69c683c4a97204e52534d2d4801dd0ca6c Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 8 Aug 2022 15:45:12 -0400 Subject: [PATCH 3/3] updates --- .github/workflows/proto-docker.yml | 21 ++++++++++++++------- CHANGELOG.md | 1 + contrib/devtools/Dockerfile | 3 ++- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/proto-docker.yml b/.github/workflows/proto-docker.yml index dbab7a21cc05..fb4af6ae130c 100644 --- a/.github/workflows/proto-docker.yml +++ b/.github/workflows/proto-docker.yml @@ -4,7 +4,10 @@ on: branches: - main paths: - - "contrib/devtools/dockerfile" + - "contrib/devtools/Dockerfile" + pull_request: + paths: + - "contrib/devtools/Dockerfile" permissions: contents: read @@ -31,16 +34,20 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Login to DockerHub - uses: docker/login-action@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + if: ${{ github.event_name != 'pull_request' }} with: - username: ${{ secrets.DOCKERHUBTM_USERNAME }} - password: ${{ secrets.DOCKERHUBTM_TOKEN }} + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - - name: Publish to Docker Hub + - name: Publish to GHCR uses: docker/build-push-action@v3 with: context: ./contrib/devtools platforms: linux/amd64,linux/arm64 - push: true + push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.prep.outputs.tags }} + name: ghcr.io/cosmos/proto-builder diff --git a/CHANGELOG.md b/CHANGELOG.md index 79b693d56f89..d6dc151f972e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * (events) [#12850](https://github.com/cosmos/cosmos-sdk/pull/12850) Add a new `fee_payer` attribute to the `tx` event that is emitted from the `DeductFeeDecorator` AnteHandler decorator. +* (ci) [#12854](https://github.com/cosmos/cosmos-sdk/pull/12854) Use ghcr.io to host the proto builder image. Update proto builder image to go 1.19 * (x/bank) [#12706](https://github.com/cosmos/cosmos-sdk/pull/12706) Added the `chain-id` flag to the `AddTxFlagsToCmd` API. There is no longer a need to explicitly register this flag on commands whens `AddTxFlagsToCmd` is already called. * [#12791](https://github.com/cosmos/cosmos-sdk/pull/12791) Bump the math library used in the sdk and replace old usages of sdk.* * (x/params) [#12615](https://github.com/cosmos/cosmos-sdk/pull/12615) Add `GetParamSetIfExists` function to params `Subspace` to prevent panics on breaking changes. diff --git a/contrib/devtools/Dockerfile b/contrib/devtools/Dockerfile index 05bed5ac81bf..d5f4469dc435 100644 --- a/contrib/devtools/Dockerfile +++ b/contrib/devtools/Dockerfile @@ -4,7 +4,8 @@ FROM bufbuild/buf:1.1.0 as BUILDER -FROM golang:1.18-alpine +FROM golang:1.19-alpine + RUN apk add --no-cache \ nodejs \