Skip to content

Commit

Permalink
Merge branch 'main' into julien/nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Nov 26, 2024
2 parents 826779d + 14d98d2 commit 3313e2b
Show file tree
Hide file tree
Showing 199 changed files with 9,237 additions and 4,078 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/dependabot-update-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Generate Token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1
id: app-token
with:
app-id: "${{ secrets.APP_ID }}"
private-key: "${{ secrets.APP_PRIVATE_KEY }}"
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: "${{ steps.app-token.outputs.token }}"
- uses: actions/setup-go@v5
with:
go-version: "1.23"
Expand Down
26 changes: 13 additions & 13 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
queue_rules:
- name: default
conditions:
- "#approved-reviews-by>1"

pull_request_rules:
- name: automerge to main with label automerge and branch protection passing
conditions:
queue_conditions:
- "#approved-reviews-by>1"
- base=main
- label=A:automerge
actions:
queue:
name: default
method: squash
commit_message_template: |
{{ title }} (#{{ number }})
{{ body }}
merge_conditions:
- "#approved-reviews-by>1"
commit_message_template: |
{{ title }} (#{{ number }})
{{ body }}
merge_method: squash

pull_request_rules:
- name: backport patches to v0.52.x branch
conditions:
- base=main
Expand Down Expand Up @@ -56,3 +52,7 @@ pull_request_rules:
backport:
branches:
- release/v0.45.x
- name: automerge to main with label automerge and branch protection passing
conditions: []
actions:
queue:
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i

### Improvements

* (testutil/integration) [#22616](https://github.com/cosmos/cosmos-sdk/pull/22616) Remove double context in integration tests v1.
* Use integrationApp.Context() instead of creating a context prior.

### Bug Fixes

* (sims) [#21906](https://github.com/cosmos/cosmos-sdk/pull/21906) Skip sims test when running dry on validators
Expand Down
175 changes: 88 additions & 87 deletions api/cosmos/bank/v1beta1/query.pulsar.go

Large diffs are not rendered by default.

76 changes: 38 additions & 38 deletions api/cosmos/bank/v1beta1/query_grpc.pb.go

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

2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module cosmossdk.io/api
go 1.23

require (
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20240701160653-fedbb9acfd2f.1
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20241120201313-68e42a58b301.1
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/gogoproto v1.7.0
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1
Expand Down
4 changes: 2 additions & 2 deletions api/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20240701160653-fedbb9acfd2f.1 h1:V3ILbKtI97qU35SYV+5ZuiLfFCNl3mrD0d7DmnRS5hU=
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20240701160653-fedbb9acfd2f.1/go.mod h1:wqOtclGXqh+7m/L6fn0SatBJ+m9E5muF/41a3LgIPVI=
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20241120201313-68e42a58b301.1 h1:kAu+bRyXqQWarx/4mAdKFYW6bgvjGKhzvIXJvMHivC4=
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20241120201313-68e42a58b301.1/go.mod h1:wqOtclGXqh+7m/L6fn0SatBJ+m9E5muF/41a3LgIPVI=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.2-20240130113600-88ef6483f90f.1 h1:FYhA+EOS18QBdffLVpisUjBGsCtUljMx4bFOsZT81ZM=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.2-20240130113600-88ef6483f90f.1/go.mod h1:17Ax38yd8pg56din4ecwSDBRCSX0qLcif5Cdf8ayto4=
github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA=
Expand Down
49 changes: 49 additions & 0 deletions client/tx_config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package client

import (
"errors"
"time"

"cosmossdk.io/core/transaction"
txsigning "cosmossdk.io/x/tx/signing"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand Down Expand Up @@ -47,11 +49,17 @@ type (
SetSignatures(signatures ...signingtypes.SignatureV2) error
SetMemo(memo string)
SetFeeAmount(amount sdk.Coins)
// SetFeePayer sets the address of who will pay the fees for this transaction.
// Note: The fee payer must sign the transaction in addition to any other required signers.
SetFeePayer(feePayer sdk.AccAddress)
SetGasLimit(limit uint64)
SetTimeoutHeight(height uint64)
SetTimeoutTimestamp(timestamp time.Time)
SetUnordered(v bool)
// SetFeeGranter sets the address of the fee granter for this transaction.
// A fee granter is an account that has given permission (via the feegrant module)
// to pay fees on behalf of another account. Unlike the fee payer, the fee granter
// does not need to sign the transaction.
SetFeeGranter(feeGranter sdk.AccAddress)
AddAuxSignerData(tx.AuxSignerData) error
}
Expand All @@ -62,3 +70,44 @@ type (
SetExtensionOptions(extOpts ...*codectypes.Any)
}
)

var _ transaction.Codec[transaction.Tx] = &DefaultTxDecoder[transaction.Tx]{}

// DefaultTxDecoder is a generic transaction decoder that implements the transaction.Codec interface.
type DefaultTxDecoder[T transaction.Tx] struct {
TxConfig TxConfig
}

// Decode decodes a binary transaction into type T using the TxConfig's TxDecoder.
func (t *DefaultTxDecoder[T]) Decode(bz []byte) (T, error) {
var out T
tx, err := t.TxConfig.TxDecoder()(bz)
if err != nil {
return out, err
}

var ok bool
out, ok = tx.(T)
if !ok {
return out, errors.New("unexpected Tx type")
}

return out, nil
}

// DecodeJSON decodes a JSON transaction into type T using the TxConfig's TxJSONDecoder.
func (t *DefaultTxDecoder[T]) DecodeJSON(bz []byte) (T, error) {
var out T
tx, err := t.TxConfig.TxJSONDecoder()(bz)
if err != nil {
return out, err
}

var ok bool
out, ok = tx.(T)
if !ok {
return out, errors.New("unexpected Tx type")
}

return out, nil
}
1 change: 1 addition & 0 deletions client/v2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Bug Fixes

* [#21853](https://github.com/cosmos/cosmos-sdk/pull/21853) Fix `*big.Int` unmarshalling in txs.
* [#22576](https://github.com/cosmos/cosmos-sdk/pull/22576) Fix duplicate command addition in `autocli` when custom enhanced command has a different name than module name

## [v2.0.0-beta.5] - 2024-09-18

Expand Down
11 changes: 10 additions & 1 deletion client/v2/autocli/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,16 @@ func (b *Builder) enhanceCommandCommon(

// if we have a custom command use that instead of generating one
if custom, ok := customCmds[moduleName]; ok {
if hasModuleOptions { // check if we need to enhance the existing command
// Custom may not be called the same as its module, so we need to have a separate check here
if subCmd := findSubCommand(cmd, custom.Name()); subCmd != nil {
if hasModuleOptions { // check if we need to enhance the existing command
if err := enhanceCustomCmd(b, subCmd, cmdType, modOpts); err != nil {
return err
}
}
continue
}
if hasModuleOptions { // check if we need to enhance the new command
if err := enhanceCustomCmd(b, custom, cmdType, modOpts); err != nil {
return err
}
Expand Down
Loading

0 comments on commit 3313e2b

Please sign in to comment.