Skip to content

Commit

Permalink
Merge branch 'main' into marko/staking_cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored May 7, 2024
2 parents b6d23d9 + 0175670 commit 7784a8d
Show file tree
Hide file tree
Showing 36 changed files with 3,798 additions and 2,912 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ test-all: test-unit test-e2e test-integration test-ledger-mock test-race

.PHONY: test-system
test-system: build
mkdir -p ./systemtests/binaries/
cp $(BUILDDIR)/simd ./systemtests/binaries/
$(MAKE) -C systemtests test
mkdir -p ./tests/systemtests/binaries/
cp $(BUILDDIR)/simd ./tests/systemtests/binaries/
$(MAKE) -C tests/systemtests test


TEST_PACKAGES=./...
Expand Down
6,422 changes: 3,626 additions & 2,796 deletions api/cosmos/accounts/defaults/multisig/v1/multisig.pulsar.go

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions api/cosmos/consensus/module/v1/module.pulsar.go

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

39 changes: 20 additions & 19 deletions api/cosmos/counter/module/v1/module.pulsar.go

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

4 changes: 2 additions & 2 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ require (
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.33.0-20240130113600-88ef6483f90f.1 // indirect
github.com/google/go-cmp v0.6.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
Expand Down
8 changes: 4 additions & 4 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
1 change: 0 additions & 1 deletion buf.work.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ directories:
- x/bank/proto
- x/circuit/proto
- x/consensus/proto
- x/counter/proto
- x/crisis/proto
- x/distribution/proto
- x/evidence/proto
Expand Down
2 changes: 1 addition & 1 deletion client/fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"google.golang.org/grpc/metadata"

"github.com/cosmos/cosmos-sdk/testutil/testdata"
"github.com/cosmos/cosmos-sdk/x/counter/types"
"github.com/cosmos/cosmos-sdk/testutil/x/counter/types"
)

type fuzzSuite struct {
Expand Down
6 changes: 3 additions & 3 deletions client/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/testutil/integration"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
"github.com/cosmos/cosmos-sdk/testutil/x/counter"
counterkeeper "github.com/cosmos/cosmos-sdk/testutil/x/counter/keeper"
countertypes "github.com/cosmos/cosmos-sdk/testutil/x/counter/types"
sdk "github.com/cosmos/cosmos-sdk/types"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/cosmos/cosmos-sdk/x/counter"
counterkeeper "github.com/cosmos/cosmos-sdk/x/counter/keeper"
countertypes "github.com/cosmos/cosmos-sdk/x/counter/types"
)

type IntegrationTestSuite struct {
Expand Down
4 changes: 2 additions & 2 deletions client/tx/aux_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
"github.com/cosmos/cosmos-sdk/testutil/x/counter"
countertypes "github.com/cosmos/cosmos-sdk/testutil/x/counter/types"
sdk "github.com/cosmos/cosmos-sdk/types"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
typestx "github.com/cosmos/cosmos-sdk/types/tx"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/counter"
countertypes "github.com/cosmos/cosmos-sdk/x/counter/types"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion client/tx/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/keyring"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
countertypes "github.com/cosmos/cosmos-sdk/testutil/x/counter/types"
sdk "github.com/cosmos/cosmos-sdk/types"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
countertypes "github.com/cosmos/cosmos-sdk/x/counter/types"
)

func newTestTxConfig() (client.TxConfig, codec.Codec) {
Expand Down
2 changes: 1 addition & 1 deletion codec/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
countertypes "github.com/cosmos/cosmos-sdk/testutil/x/counter/types"
sdk "github.com/cosmos/cosmos-sdk/types"
countertypes "github.com/cosmos/cosmos-sdk/x/counter/types"
)

type msgCounterWrapper struct {
Expand Down
2 changes: 1 addition & 1 deletion codec/proto_codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
countertypes "github.com/cosmos/cosmos-sdk/testutil/x/counter/types"
sdk "github.com/cosmos/cosmos-sdk/types"
countertypes "github.com/cosmos/cosmos-sdk/x/counter/types"
)

func createTestInterfaceRegistry() types.InterfaceRegistry {
Expand Down
4 changes: 2 additions & 2 deletions runtime/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/testutil"
counterkeeper "github.com/cosmos/cosmos-sdk/x/counter/keeper"
countertypes "github.com/cosmos/cosmos-sdk/x/counter/types"
counterkeeper "github.com/cosmos/cosmos-sdk/testutil/x/counter/keeper"
countertypes "github.com/cosmos/cosmos-sdk/testutil/x/counter/types"
)

func TestRouterService(t *testing.T) {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion x/counter/depinject.go → testutil/x/counter/depinject.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"cosmossdk.io/depinject"
"cosmossdk.io/depinject/appconfig"

"github.com/cosmos/cosmos-sdk/x/counter/keeper"
"github.com/cosmos/cosmos-sdk/testutil/x/counter/keeper"
)

var _ depinject.OnePerModuleType = AppModule{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/event"

"github.com/cosmos/cosmos-sdk/x/counter/types"
"github.com/cosmos/cosmos-sdk/testutil/x/counter/types"
)

var StoreKey = "Counter"
Expand Down
4 changes: 2 additions & 2 deletions x/counter/module.go → testutil/x/counter/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/registry"

"github.com/cosmos/cosmos-sdk/testutil/x/counter/keeper"
"github.com/cosmos/cosmos-sdk/testutil/x/counter/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/counter/keeper"
"github.com/cosmos/cosmos-sdk/x/counter/types"
)

var (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "cosmos/app/v1alpha1/module.proto";
// Module is the config object of the counter module.
message Module {
option (cosmos.app.v1alpha1.module) = {
go_import: "github.com/cosmos/cosmos-sdk/x/counter"
go_import: "github.com/cosmos/cosmos-sdk/testutil/x/counter"
};

// authority defines the custom module authority. If not set, defaults to the governance module.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
syntax = "proto3";
package cosmos.counter.v1;

option go_package = "github.com/cosmos/cosmos-sdk/x/counter/types";
option go_package = "github.com/cosmos/cosmos-sdk/testutil/x/counter/types";

// Query defines the gRPC querier service.
service Query {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/counter/types";
option go_package = "github.com/cosmos/cosmos-sdk/testutil/x/counter/types";

// Msg defines the counter Msg service.
service Msg {
Expand Down
File renamed without changes.
File renamed without changes.

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

13 changes: 7 additions & 6 deletions x/counter/types/tx.pb.go → testutil/x/counter/types/tx.pb.go

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

47 changes: 47 additions & 0 deletions types/dec_coin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1166,3 +1166,50 @@ func (s *decCoinTestSuite) TestDecCoin_ParseDecCoin() {
})
}
}

func (s *decCoinTestSuite) TestDecCoin_ParseDecAmount() {
testCases := map[string]struct {
input string
expectedAmount string
expectedDenom string
expectedErr bool
}{
"Parse empty string": {"", "", "", false},
"Parse string which start with character different from digit, space, and letter": {"✨🌟⭐", "", "", true},
"Parse string started with letter": {"h10", "", "h10", false},
"Parse string started with dot": {".atom", ".", "atom", false},

"Parse string that contain only numbers": {"10", "10", "", false},
"Use number for denom": {"10 11", "", "", true},
"Use invalid character '&' for denom ": {"10f&", "", "", true},
"Use space between amount and denom": {"10 atom", "10", "atom", false},
"Use two space between amount and denom": {"10 atom", "10", "atom", false},

"Denom start with digit": {"1 1atom", "", "", true},
"Denom start with '/'": {"1 /atom", "", "", true},
"Denom start with ':'": {"1 :atom", "", "", true},
"Denom start with '.'": {"1 .atom", "", "", true},
"Denom start with '_'": {"1 _atom", "", "", true},
"Denom start with '-'": {"1 -atom", "", "", true},

"Denom contains '/'": {"1 at/om", "1", "at/om", false},
"Denom contains ':'": {"2atom:", "2", "atom:", false},
"Denom contains '.'": {"3ato.m", "3", "ato.m", false},
"Denom contains '_'": {"4 a_tom", "4", "a_tom", false},
"Denom contains '-'": {"5 at-om", "5", "at-om", false},
"Denom contains space": {"5 at om", "", "", true},
}

for name, tc := range testCases {
s.T().Run(name, func(t *testing.T) {
actualAmount, actualDenom, err := sdk.ParseDecAmount(tc.input)
if tc.expectedErr {
s.Require().Error(err, "expected error for test case %s, input: %v", name, tc.input)
} else {
s.Require().NoError(err, "unexpected error for test case %s, input: %v", name, tc.input)
s.Require().Equal(tc.expectedAmount, actualAmount)
s.Require().Equal(tc.expectedDenom, actualDenom)
}
})
}
}
2 changes: 1 addition & 1 deletion types/mempool/mempool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import (

codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/testutil/x/counter"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/mempool"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
txsigning "github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/counter"
)

// testPubKey is a dummy implementation of PubKey used for testing.
Expand Down
Loading

0 comments on commit 7784a8d

Please sign in to comment.