Skip to content

Commit 98de856

Browse files
committed
Merge branch 'master' into bez/5444-auth-proto-enc
2 parents fd1758f + 05c21a5 commit 98de856

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1435
-1601
lines changed

.codecov.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ ignore:
4646
- "docs"
4747
- "*.md"
4848
- "*.rst"
49-
- "*.pb.go"
49+
- "**/*.pb.go"
5050
- "x/**/test_common.go"
5151
- "scripts/"
5252
- "contrib"

CHANGELOG.md

+25-12
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ Ref: https://keepachangelog.com/en/1.0.0/
4141

4242
* (modules) [\#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) The `/bank/balances/{address}` endpoint now returns all account
4343
balances or a single balance by denom when the `denom` query parameter is present.
44+
* (client) [\#5640](https://github.com/cosmos/cosmos-sdk/pull/5640) The rest server endpoint `/swagger-ui/` is replaced by
45+
´/´.
4446

4547
### API Breaking Changes
4648

49+
* (x/params) [\#5619](https://github.com/cosmos/cosmos-sdk/pull/5619) The `x/params` keeper now accepts a `codec.Marshaller` instead of
50+
a reference to an amino codec. Amino is still used for JSON serialization.
4751
* (types) [\#5579](https://github.com/cosmos/cosmos-sdk/pull/5579) The `keepRecent` field has been removed from the `PruningOptions` type.
4852
The `PruningOptions` type now only includes fields `KeepEvery` and `SnapshotEvery`, where `KeepEvery`
4953
determines which committed heights are flushed to disk and `SnapshotEvery` determines which of these
@@ -56,14 +60,7 @@ and provided directly the IAVL store.
5660

5761
### Bug Fixes
5862

59-
* (x/gov) [\#5622](https://github.com/cosmos/cosmos-sdk/pull/5622) Track any events emitted from a proposal's handler upon successful execution.
60-
* (types) [\#5579](https://github.com/cosmos/cosmos-sdk/pull/5579) The IAVL `Store#Commit` method has been refactored to
61-
delete a flushed version if it is not a snapshot version. The root multi-store now keeps track of `commitInfo` instead
62-
of `types.CommitID`. During `Commit` of the root multi-store, `lastCommitInfo` is updated from the saved state
63-
and is only flushed to disk if it is a snapshot version. During `Query` of the root multi-store, if the request height
64-
is the latest height, we'll use the store's `lastCommitInfo`. Otherwise, we fetch `commitInfo` from disk.
65-
* (x/bank) [\#5531](https://github.com/cosmos/cosmos-sdk/issues/5531) Added missing amount event to MsgMultiSend, emitted for each output.
66-
* (client) [\#5618](https://github.com/cosmos/cosmos-sdk/pull/5618) Fix crash on the client when the verifier is not set.
63+
* (client) [\#5618](https://github.com/cosmos/cosmos-sdk/pull/5618) Fix crash on the client when the verifier is not set.
6764
* (x/distribution) [\#5620](https://github.com/cosmos/cosmos-sdk/pull/5620) Fix nil pointer deref in distribution tax/rewward validation helpers.
6865
* (genesis) [\#5086](https://github.com/cosmos/cosmos-sdk/issues/5086) Ensure `gentxs` are always an empty array instead of `nil`
6966

@@ -103,9 +100,6 @@ serialization instead of Amino.
103100

104101
### Improvements
105102

106-
* (modules) [\#5597](https://github.com/cosmos/cosmos-sdk/pull/5597) Add `amount` event attribute to the `complete_unbonding`
107-
and `complete_redelegation` events that reflect the total balances of the completed unbondings and redelegations
108-
respectively.
109103
* (types) [\#5581](https://github.com/cosmos/cosmos-sdk/pull/5581) Add convenience functions {,Must}Bech32ifyAddressBytes.
110104
* (staking) [\#5584](https://github.com/cosmos/cosmos-sdk/pull/5584) Add util function `ToTmValidator` that converts a `staking.Validator` type to `*tmtypes.Validator`.
111105
* (client) [\#5585](https://github.com/cosmos/cosmos-sdk/pull/5585) IBC additions:
@@ -115,6 +109,24 @@ respectively.
115109
* `Coin` denomination max lenght has been increased to 32.
116110
* Added `CapabilityKey` alias for `StoreKey` to match IBC spec.
117111

112+
## [v0.38.1] - 2020-02-11
113+
114+
### Improvements
115+
116+
* (modules) [\#5597](https://github.com/cosmos/cosmos-sdk/pull/5597) Add `amount` event attribute to the `complete_unbonding`
117+
and `complete_redelegation` events that reflect the total balances of the completed unbondings and redelegations
118+
respectively.
119+
120+
### Bug Fixes
121+
122+
* (types) [\#5579](https://github.com/cosmos/cosmos-sdk/pull/5579) The IAVL `Store#Commit` method has been refactored to
123+
delete a flushed version if it is not a snapshot version. The root multi-store now keeps track of `commitInfo` instead
124+
of `types.CommitID`. During `Commit` of the root multi-store, `lastCommitInfo` is updated from the saved state
125+
and is only flushed to disk if it is a snapshot version. During `Query` of the root multi-store, if the request height
126+
is the latest height, we'll use the store's `lastCommitInfo`. Otherwise, we fetch `commitInfo` from disk.
127+
* (x/bank) [\#5531](https://github.com/cosmos/cosmos-sdk/issues/5531) Added missing amount event to MsgMultiSend, emitted for each output.
128+
* (x/gov) [\#5622](https://github.com/cosmos/cosmos-sdk/pull/5622) Track any events emitted from a proposal's handler upon successful execution.
129+
118130
## [v0.38.0] - 2020-01-23
119131

120132
### State Machine Breaking
@@ -2953,7 +2965,8 @@ BUG FIXES:
29532965

29542966
<!-- Release links -->
29552967

2956-
[Unreleased]: https://github.com/cosmos/cosmos-sdk/compare/v0.38.0...HEAD
2968+
[Unreleased]: https://github.com/cosmos/cosmos-sdk/compare/v0.38.1...HEAD
2969+
[v0.38.1]: https://github.com/cosmos/cosmos-sdk/releases/tag/v0.38.1
29572970
[v0.38.0]: https://github.com/cosmos/cosmos-sdk/releases/tag/v0.38.0
29582971
[v0.37.7]: https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.7
29592972
[v0.37.6]: https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.6

client/lcd/root.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@ func (rs *RestServer) registerSwaggerUI() {
105105
panic(err)
106106
}
107107
staticServer := http.FileServer(statikFS)
108-
rs.Mux.PathPrefix("/swagger-ui/").Handler(http.StripPrefix("/swagger-ui/", staticServer))
108+
rs.Mux.PathPrefix("/").Handler(staticServer)
109109
}

go.mod

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/gogo/protobuf v1.3.1
1111
github.com/golang/mock v1.3.1-0.20190508161146-9fa652df1129
1212
github.com/golang/protobuf v1.3.3
13-
github.com/gorilla/mux v1.7.3
13+
github.com/gorilla/mux v1.7.4
1414
github.com/hashicorp/golang-lru v0.5.4
1515
github.com/mattn/go-isatty v0.0.12
1616
github.com/pelletier/go-toml v1.6.0
@@ -27,13 +27,11 @@ require (
2727
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15
2828
github.com/tendermint/go-amino v0.15.1
2929
github.com/tendermint/iavl v0.13.0
30-
github.com/tendermint/tendermint v0.33.0
30+
github.com/tendermint/tendermint v0.33.1
3131
github.com/tendermint/tm-db v0.4.0
3232
gopkg.in/yaml.v2 v2.2.8
3333
)
3434

3535
replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.2-alpha.regen.1
3636

37-
replace github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4
38-
3937
go 1.13

go.sum

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
2-
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs=
3-
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4=
42
github.com/99designs/keyring v1.1.4 h1:x0g0zQ9bQKgNsLo0XSXAy1H8Q1RG/td+5OXJt+Ci8b8=
53
github.com/99designs/keyring v1.1.4/go.mod h1:657DQuMrBZRtuL/voxVyiyb6zpMehlm5vLB9Qwrv904=
64
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
@@ -106,8 +104,8 @@ github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
106104
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
107105
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
108106
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
109-
github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=
110-
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
107+
github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc=
108+
github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
111109
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
112110
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
113111
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
@@ -136,6 +134,8 @@ github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlT
136134
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
137135
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
138136
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
137+
github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM=
138+
github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc=
139139
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
140140
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
141141
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
@@ -252,8 +252,9 @@ github.com/tendermint/go-amino v0.15.1 h1:D2uk35eT4iTsvJd9jWIetzthE5C0/k2QmMFkCN
252252
github.com/tendermint/go-amino v0.15.1/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
253253
github.com/tendermint/iavl v0.13.0 h1:r2sINvNFlJsLlLhGoqlqPlREWYkuK26BvMfkBt+XQnA=
254254
github.com/tendermint/iavl v0.13.0/go.mod h1:7nSUPdrsHEZ2nNZa+9gaIrcJciWd1jCQZXtcyARU82k=
255-
github.com/tendermint/tendermint v0.33.0 h1:TW1g9sQs3YSqKM8o1+opL3/VmBy4Ke/VKV9MxYpqNbI=
256255
github.com/tendermint/tendermint v0.33.0/go.mod h1:s5UoymnPIY+GcA3mMte4P9gpMP8vS7UH7HBXikT1pHI=
256+
github.com/tendermint/tendermint v0.33.1 h1:8f68LUBz8yhISZvaLFP4siXXrLWsWeoYfelbdNtmvm4=
257+
github.com/tendermint/tendermint v0.33.1/go.mod h1:fBOKyrlXOETqQ+heL8x/TZgSdmItON54csyabvktBp0=
257258
github.com/tendermint/tm-db v0.4.0 h1:iPbCcLbf4nwDFhS39Zo1lpdS1X/cT9CkTlUx17FHQgA=
258259
github.com/tendermint/tm-db v0.4.0/go.mod h1:+Cwhgowrf7NBGXmsqFMbwEtbo80XmyrlY5Jsk95JubQ=
259260
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
@@ -338,8 +339,9 @@ google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvx
338339
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
339340
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
340341
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
341-
google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg=
342342
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
343+
google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk=
344+
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
343345
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
344346
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
345347
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=

simapp/app.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func NewSimApp(
149149
}
150150

151151
// init params keeper and subspaces
152-
app.ParamsKeeper = params.NewKeeper(app.cdc, keys[params.StoreKey], tkeys[params.TStoreKey])
152+
app.ParamsKeeper = params.NewKeeper(appCodec.Params, keys[params.StoreKey], tkeys[params.TStoreKey])
153153
app.subspaces[auth.ModuleName] = app.ParamsKeeper.Subspace(auth.DefaultParamspace)
154154
app.subspaces[bank.ModuleName] = app.ParamsKeeper.Subspace(bank.DefaultParamspace)
155155
app.subspaces[staking.ModuleName] = app.ParamsKeeper.Subspace(staking.DefaultParamspace)

simapp/test_helpers.go

+11-6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
sdk "github.com/cosmos/cosmos-sdk/types"
1717
"github.com/cosmos/cosmos-sdk/x/auth"
1818
authexported "github.com/cosmos/cosmos-sdk/x/auth/exported"
19+
"github.com/cosmos/cosmos-sdk/x/bank"
1920
"github.com/cosmos/cosmos-sdk/x/supply"
2021
)
2122

@@ -43,25 +44,26 @@ func Setup(isCheckTx bool) *SimApp {
4344
return app
4445
}
4546

46-
// SetupWithGenesisAccounts initializes a new SimApp with the passed in
47-
// genesis accounts.
48-
func SetupWithGenesisAccounts(genAccs []authexported.GenesisAccount) *SimApp {
47+
// SetupWithGenesisAccounts initializes a new SimApp with the provided genesis
48+
// accounts and possible balances.
49+
func SetupWithGenesisAccounts(genAccs []authexported.GenesisAccount, balances ...bank.Balance) *SimApp {
4950
db := dbm.NewMemDB()
5051
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, 0)
5152

5253
// initialize the chain with the passed in genesis accounts
5354
genesisState := NewDefaultGenesisState()
5455

5556
authGenesis := auth.NewGenesisState(auth.DefaultParams(), genAccs)
56-
genesisStateBz := app.Codec().MustMarshalJSON(authGenesis)
57-
genesisState[auth.ModuleName] = genesisStateBz
57+
genesisState[auth.ModuleName] = app.Codec().MustMarshalJSON(authGenesis)
58+
59+
bankGenesis := bank.NewGenesisState(bank.DefaultGenesisState().SendEnabled, balances)
60+
genesisState[bank.ModuleName] = app.Codec().MustMarshalJSON(bankGenesis)
5861

5962
stateBytes, err := codec.MarshalJSONIndent(app.Codec(), genesisState)
6063
if err != nil {
6164
panic(err)
6265
}
6366

64-
// Initialize the chain
6567
app.InitChain(
6668
abci.RequestInitChain{
6769
Validators: []abci.ValidatorUpdate{},
@@ -91,6 +93,9 @@ func AddTestAddrs(app *SimApp, ctx sdk.Context, accNum int, accAmt sdk.Int) []sd
9193

9294
// fill all the addresses with some coins, set the loose pool tokens simultaneously
9395
for _, addr := range testAddrs {
96+
acc := app.AccountKeeper.NewAccountWithAddress(ctx, addr)
97+
app.AccountKeeper.SetAccount(ctx, acc)
98+
9499
_, err := app.BankKeeper.AddCoins(ctx, addr, initCoins)
95100
if err != nil {
96101
panic(err)

x/auth/client/cli/query.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ $ %s query txs --%s 'message.sender=cosmos1...&message.action=withdraw_delegator
118118
limit := viper.GetInt(flags.FlagLimit)
119119

120120
cliCtx := context.NewCLIContext().WithCodec(cdc)
121-
txs, err := authclient.QueryTxsByEvents(cliCtx, tmEvents, page, limit)
121+
txs, err := authclient.QueryTxsByEvents(cliCtx, tmEvents, page, limit, "")
122122
if err != nil {
123123
return err
124124
}

x/auth/client/query.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ import (
1919
// "{eventAttribute}.{attributeKey} = '{attributeValue}'". Each event is
2020
// concatenated with an 'AND' operand. It returns a slice of Info object
2121
// containing txs and metadata. An error is returned if the query fails.
22-
func QueryTxsByEvents(cliCtx context.CLIContext, events []string, page, limit int) (*sdk.SearchTxsResult, error) {
22+
// If an empty string is provided it will order txs by asc
23+
func QueryTxsByEvents(cliCtx context.CLIContext, events []string, page, limit int, orderBy string) (*sdk.SearchTxsResult, error) {
2324
if len(events) == 0 {
2425
return nil, errors.New("must declare at least one event to search")
2526
}
@@ -42,7 +43,7 @@ func QueryTxsByEvents(cliCtx context.CLIContext, events []string, page, limit in
4243

4344
prove := !cliCtx.TrustNode
4445

45-
resTxs, err := node.TxSearch(query, prove, page, limit)
46+
resTxs, err := node.TxSearch(query, prove, page, limit, orderBy)
4647
if err != nil {
4748
return nil, err
4849
}

x/auth/client/rest/query.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func QueryTxsRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
9999
return
100100
}
101101

102-
searchResult, err := client.QueryTxsByEvents(cliCtx, events, page, limit)
102+
searchResult, err := client.QueryTxsByEvents(cliCtx, events, page, limit, "")
103103
if err != nil {
104104
rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
105105
return

x/distribution/keeper/test_common.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func CreateTestInputAdvanced(
126126
blacklistedAddrs[distrAcc.GetAddress().String()] = true
127127

128128
cdc := MakeTestCodec()
129-
pk := params.NewKeeper(cdc, keyParams, tkeyParams)
129+
pk := params.NewKeeper(params.ModuleCdc, keyParams, tkeyParams)
130130

131131
ctx := sdk.NewContext(ms, abci.Header{ChainID: "foochainid"}, isCheckTx, log.NewNopLogger())
132132
accountKeeper := auth.NewAccountKeeper(auth.ModuleCdc, keyAcc, pk.Subspace(auth.DefaultParamspace), auth.ProtoBaseAccount)

0 commit comments

Comments
 (0)