Skip to content

Commit

Permalink
Merge branch 'master' into robert/errors-wrap
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessio Treglia committed Mar 15, 2021
2 parents 6a3e69e + 553aac5 commit 282a0f0
Show file tree
Hide file tree
Showing 75 changed files with 2,238 additions and 1,939 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,28 @@ name: Protobuf
# This workflow is only run when a .proto file has been changed
on:
pull_request:
paths:
- "**.proto"

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@master
- uses: technote-space/get-diff-action@v4
with:
PATTERNS: |
**/**.proto
- name: lint
run: make proto-lint
if: env.GIT_DIFF
breakage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: technote-space/get-diff-action@v4
with:
PATTERNS: |
**/**.proto
- name: check-breakage
run: make proto-check-breaking
if: env.GIT_DIFF
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ Ref: https://keepachangelog.com/en/1.0.0/

* [\#8559](https://github.com/cosmos/cosmos-sdk/pull/8559) Added Protobuf compatible secp256r1 ECDSA signatures.
* [\#8786](https://github.com/cosmos/cosmos-sdk/pull/8786) Enabled secp256r1 in x/auth.

* (rosetta) [\#8729](https://github.com/cosmos/cosmos-sdk/pull/8729) Data API fully supports balance tracking. Construction API can now construct any message supported by the application.

### Client Breaking Changes

* [\#8363](https://github.com/cosmos/cosmos-sdk/pull/8363) Addresses no longer have a fixed 20-byte length. From the SDK modules' point of view, any 1-255 bytes-long byte array is a valid address.
* [\#8346](https://github.com/cosmos/cosmos-sdk/pull/8346) All CLI `tx` commands generate ServiceMsgs by default. Graceful Amino support has been added to ServiceMsgs to support signing legacy Msgs.
* (crypto/ed25519) [\#8690] Adopt zip1215 ed2559 verification rules.
* [\#8849](https://github.com/cosmos/cosmos-sdk/pull/8849) Upgrade module no longer supports time based upgrades.


### API Breaking Changes
Expand All @@ -66,8 +67,6 @@ Ref: https://keepachangelog.com/en/1.0.0/
### State Machine Breaking

* (x/{bank,distrib,gov,slashing,staking}) [\#8363](https://github.com/cosmos/cosmos-sdk/issues/8363) Store keys have been modified to allow for variable-length addresses.
* (x/ibc) [\#8266](https://github.com/cosmos/cosmos-sdk/issues/8266) Add amino JSON for IBC messages in order to support Ledger text signing.
* (x/ibc) [\#8405](https://github.com/cosmos/cosmos-sdk/pull/8405) Refactor IBC client update governance proposals to use a substitute client to update a frozen or expired client.
* (x/evidence) [\#8502](https://github.com/cosmos/cosmos-sdk/pull/8502) `HandleEquivocationEvidence` persists the evidence to state.
* (x/gov) [\#7733](https://github.com/cosmos/cosmos-sdk/pull/7733) ADR 037 Implementation: Governance Split Votes
* (x/bank) [\#8656](https://github.com/cosmos/cosmos-sdk/pull/8656) balance and supply are now correctly tracked via `coin_spent`, `coin_received`, `coinbase` and `burn` events.
Expand All @@ -78,15 +77,16 @@ Ref: https://keepachangelog.com/en/1.0.0/

* (x/bank) [\#8614](https://github.com/cosmos/cosmos-sdk/issues/8614) Add `Name` and `Symbol` fields to denom metadata
* (x/auth) [\#8522](https://github.com/cosmos/cosmos-sdk/pull/8522) Allow to query all stored accounts
* (x/ibc) [\#7949](https://github.com/cosmos/cosmos-sdk/issues/7949) Standardized channel `Acknowledgement` moved to its own file. Codec registration redundancy removed.
* (crypto/types) [\#8600](https://github.com/cosmos/cosmos-sdk/pull/8600) `CompactBitArray`: optimize the `NumTrueBitsBefore` method and add an `Equal` method.
* (grpc) [\#8815](https://github.com/cosmos/cosmos-sdk/pull/8815) Add orderBy parameter to `TxsByEvents` endpoint.

### Bug Fixes

* (keyring) [#\8635](https://github.com/cosmos/cosmos-sdk/issues/8635) Remove hardcoded default passphrase value on `NewMnemonic`
* (x/bank) [\#8434](https://github.com/cosmos/cosmos-sdk/pull/8434) Fix legacy REST API `GET /bank/total` and `GET /bank/total/{denom}` in swagger
* (x/slashing) [\#8427](https://github.com/cosmos/cosmos-sdk/pull/8427) Fix query signing infos command
* (server) [\#8399](https://github.com/cosmos/cosmos-sdk/pull/8399) fix gRPC-web flag default value
* (crypto) [\#8841](https://github.com/cosmos/cosmos-sdk/pull/8841) Fix legacy multisig amino marshaling, allowing migrations to work between v0.39 and v0.40+.

## [v0.42.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.0) - 2021-03-08

Expand Down
2 changes: 2 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ lint:
breaking:
use:
- FILE
except:
- FIELD_NO_DELETE
ignore:
- tendermint
- gogoproto
Expand Down
2 changes: 1 addition & 1 deletion client/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func AddTxFlagsToCmd(cmd *cobra.Command) {
cmd.Flags().Bool(FlagGenerateOnly, false, "Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible)")
cmd.Flags().Bool(FlagOffline, false, "Offline mode (does not allow any online functionality")
cmd.Flags().BoolP(FlagSkipConfirmation, "y", false, "Skip tx broadcasting prompt confirmation")
cmd.Flags().String(FlagKeyringBackend, DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)")
cmd.Flags().String(FlagKeyringBackend, DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test|memory)")
cmd.Flags().String(FlagSignMode, "", "Choose sign mode (direct|amino-json), this is an advanced feature")
cmd.Flags().Uint64(FlagTimeoutHeight, 0, "Set a block timeout height to prevent the tx from being committed past a certain height")
cmd.Flags().String(FlagFeeAccount, "", "Fee account pays fees for the transaction instead of deducting from the signer")
Expand Down
25 changes: 25 additions & 0 deletions codec/types/any.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package types

import (
fmt "fmt"

"github.com/gogo/protobuf/proto"

sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
Expand Down Expand Up @@ -116,3 +118,26 @@ func (any *Any) pack(x proto.Message) error {
func (any *Any) GetCachedValue() interface{} {
return any.cachedValue
}

// GoString returns a string representing valid go code to reproduce the current state of
// the struct.
func (any *Any) GoString() string {
if any == nil {
return "nil"
}
extra := ""
if any.XXX_unrecognized != nil {
extra = fmt.Sprintf(",\n XXX_unrecognized: %#v,\n", any.XXX_unrecognized)
}
return fmt.Sprintf("&Any{TypeUrl: %#v,\n Value: %#v%s\n}",
any.TypeUrl, any.Value, extra)
}

// String implements the stringer interface
func (any *Any) String() string {
if any == nil {
return "nil"
}
return fmt.Sprintf("&Any{TypeUrl:%v,Value:%v,XXX_unrecognized:%v}",
any.TypeUrl, any.Value, any.XXX_unrecognized)
}
67 changes: 12 additions & 55 deletions codec/types/any.pb.go

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

12 changes: 12 additions & 0 deletions codec/types/any_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,15 @@ func TestAnyPackUnpack(t *testing.T) {
require.NoError(t, err)
require.Equal(t, spot, animal)
}

func TestString(t *testing.T) {
require := require.New(t)
spot := &Dog{Name: "Spot"}
any, err := NewAnyWithValue(spot)
require.NoError(err)

require.Equal("&Any{TypeUrl:/tests/dog,Value:[10 4 83 112 111 116],XXX_unrecognized:[]}", any.String())
require.Equal(`&Any{TypeUrl: "/tests/dog",
Value: []byte{0xa, 0x4, 0x53, 0x70, 0x6f, 0x74}
}`, any.GoString())
}
2 changes: 1 addition & 1 deletion contrib/rosetta/configuration/bootstrap.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"account_identifier": {
"address":"cosmos158nkd0l9tyemv2crp579rmj8dg37qty8lzff88"
"address":"cosmos1ujtnemf6jmfm995j000qdry064n5lq854gfe3j"
},
"currency":{
"symbol":"stake",
Expand Down
2 changes: 1 addition & 1 deletion contrib/rosetta/configuration/data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ sleep 10

# send transaction to deterministic address
echo sending transaction with addr $addr
simd tx bank send "$addr" cosmos1wjmt63j4fv9nqda92nsrp2jp2vsukcke4va3pt 100stake --yes --keyring-backend=test --broadcast-mode=block --chain-id=testing
simd tx bank send "$addr" cosmos19g9cm8ymzchq2qkcdv3zgqtwayj9asv3hjv5u5 100stake --yes --keyring-backend=test --broadcast-mode=block --chain-id=testing

sleep 10

Expand Down
2 changes: 1 addition & 1 deletion contrib/rosetta/configuration/rosetta.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"constructor_dsl_file": "transfer.ros",
"end_conditions": {
"create_account": 1,
"transfer": 3
"transfer": 1
}
},
"data": {
Expand Down
12 changes: 0 additions & 12 deletions contrib/rosetta/configuration/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@

set -e

addr="abcd"

send_tx() {
echo '12345678' | simd tx bank send $addr "$1" "$2"
}

detect_account() {
line=$1
}

wait_for_rosetta() {
timeout 30 sh -c 'until nc -z $0 $1; do sleep 1; done' rosetta 8080
}
Expand All @@ -25,5 +15,3 @@ rosetta-cli check:data --configuration-file ./config/rosetta.json
echo "checking construction API"
rosetta-cli check:construction --configuration-file ./config/rosetta.json

echo "checking staking API"
rosetta-cli check:construction --configuration-file ./config/staking.json
30 changes: 0 additions & 30 deletions contrib/rosetta/configuration/staking.json

This file was deleted.

Loading

0 comments on commit 282a0f0

Please sign in to comment.