Skip to content

Commit

Permalink
Merge branch 'main' into kocubinski/rf-address-codec
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Mar 14, 2024
2 parents 82bd39b + 36981e6 commit 0782026
Show file tree
Hide file tree
Showing 30 changed files with 26,781 additions and 131 deletions.
761 changes: 761 additions & 0 deletions api/cosmos/accounts/defaults/lockup/lockup.pulsar.go

Large diffs are not rendered by default.

2,903 changes: 2,903 additions & 0 deletions api/cosmos/accounts/defaults/lockup/query.pulsar.go

Large diffs are not rendered by default.

6,174 changes: 6,174 additions & 0 deletions api/cosmos/accounts/defaults/lockup/tx.pulsar.go

Large diffs are not rendered by default.

752 changes: 752 additions & 0 deletions api/cosmos/lockup/lockup.pulsar.go

Large diffs are not rendered by default.

2,891 changes: 2,891 additions & 0 deletions api/cosmos/lockup/query.pulsar.go

Large diffs are not rendered by default.

6,162 changes: 6,162 additions & 0 deletions api/cosmos/lockup/tx.pulsar.go

Large diffs are not rendered by default.

36 changes: 33 additions & 3 deletions client/v2/autocli/msg_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package autocli

import (
"bytes"
"context"
"encoding/json"
"fmt"
"os"
"path/filepath"
"testing"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -53,7 +57,7 @@ func TestMsg(t *testing.T) {
"--output", "json",
)
assert.NilError(t, err)
golden.Assert(t, out.String(), "msg-output.golden")
assertNormalizedJSONEqual(t, out.Bytes(), goldenLoad(t, "msg-output.golden"))

out, err = runCmd(fixture, buildCustomModuleMsgCommand(&autocliv1.ServiceCommandDescriptor{
Service: bankv1beta1.Msg_ServiceDesc.ServiceName,
Expand All @@ -74,7 +78,7 @@ func TestMsg(t *testing.T) {
"--output", "json",
)
assert.NilError(t, err)
golden.Assert(t, out.String(), "msg-output.golden")
assertNormalizedJSONEqual(t, out.Bytes(), goldenLoad(t, "msg-output.golden"))

out, err = runCmd(fixture, buildCustomModuleMsgCommand(&autocliv1.ServiceCommandDescriptor{
Service: bankv1beta1.Msg_ServiceDesc.ServiceName,
Expand All @@ -97,7 +101,33 @@ func TestMsg(t *testing.T) {
"--output", "json",
)
assert.NilError(t, err)
golden.Assert(t, out.String(), "msg-output.golden")
assertNormalizedJSONEqual(t, out.Bytes(), goldenLoad(t, "msg-output.golden"))
}

func goldenLoad(t *testing.T, filename string) []byte {
t.Helper()
content, err := os.ReadFile(filepath.Join("testdata", filename))
assert.NilError(t, err)
return content
}

func assertNormalizedJSONEqual(t *testing.T, expected, actual []byte) {
t.Helper()
normalizedExpected, err := normalizeJSON(expected)
assert.NilError(t, err)
normalizedActual, err := normalizeJSON(actual)
assert.NilError(t, err)
assert.Equal(t, string(normalizedExpected), string(normalizedActual))
}

// normalizeJSON normalizes the JSON content by removing unnecessary white spaces and newlines.
func normalizeJSON(content []byte) ([]byte, error) {
var buf bytes.Buffer
err := json.Compact(&buf, content)
if err != nil {
return nil, err
}
return buf.Bytes(), nil
}

func TestMsgOptionsError(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions go.work.example
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ use (
./x/staking
./x/tx
./x/upgrade
./x/accounts/defaults/lockup
)
6 changes: 6 additions & 0 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"cosmossdk.io/x/accounts"
"cosmossdk.io/x/accounts/accountstd"
baseaccount "cosmossdk.io/x/accounts/defaults/base"
lockup "cosmossdk.io/x/accounts/lockup"
"cosmossdk.io/x/accounts/testing/account_abstraction"
"cosmossdk.io/x/accounts/testing/counter"
"cosmossdk.io/x/auth"
Expand Down Expand Up @@ -290,6 +291,11 @@ func NewSimApp(
// TESTING: do not add
accountstd.AddAccount("counter", counter.NewAccount),
accountstd.AddAccount("aa_minimal", account_abstraction.NewMinimalAbstractedAccount),
// Lockup account
accountstd.AddAccount(lockup.CONTINUOUS_LOCKING_ACCOUNT, lockup.NewContinuousLockingAccount),
accountstd.AddAccount(lockup.PERIODIC_LOCKING_ACCOUNT, lockup.NewPeriodicLockingAccount),
accountstd.AddAccount(lockup.DELAYED_LOCKING_ACCOUNT, lockup.NewDelayedLockingAccount),
accountstd.AddAccount(lockup.PERMANENT_LOCKING_ACCOUNT, lockup.NewPermanentLockingAccount),
// PRODUCTION: add
baseaccount.NewAccount("base", txConfig.SignModeHandler()),
)
Expand Down
37 changes: 20 additions & 17 deletions simapp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,23 @@ require (
google.golang.org/protobuf v1.33.0
)

require cosmossdk.io/x/accounts v0.0.0-20240104091155-b729e981f130
require cosmossdk.io/x/accounts v0.0.0-20240226161501-23359a0b6d91

require (
cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000
cosmossdk.io/x/accounts/lockup v0.0.0-00010101000000-000000000000
cosmossdk.io/x/auth v0.0.0-20240226161501-23359a0b6d91
cosmossdk.io/x/authz v0.0.0-00010101000000-000000000000
cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000
cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91
cosmossdk.io/x/distribution v0.0.0-20240227221813-a248d05f70f4
cosmossdk.io/x/gov v0.0.0-20231113122742-912390d5fc4a
cosmossdk.io/x/group v0.0.0-00010101000000-000000000000
cosmossdk.io/x/mint v0.0.0-00010101000000-000000000000
cosmossdk.io/x/slashing v0.0.0-00010101000000-000000000000
cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000
cosmossdk.io/x/staking v0.0.0-20240226161501-23359a0b6d91
)

require (
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20230509103710-5e5b9fdd0180.1 // indirect
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20240130113600-88ef6483f90f.1 // indirect
buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 // indirect
cloud.google.com/go v0.112.0 // indirect
cloud.google.com/go/compute v1.24.0 // indirect
Expand All @@ -69,7 +70,7 @@ require (
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
Expand All @@ -79,7 +80,7 @@ require (
github.com/cockroachdb/pebble v1.1.0 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft-db v0.9.1 // indirect
github.com/cometbft/cometbft-db v0.11.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
Expand All @@ -89,7 +90,7 @@ require (
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
github.com/creachadair/atomicfile v0.3.3 // indirect
github.com/creachadair/tomledit v0.0.25 // indirect
github.com/danieljoos/wincred v1.2.0 // indirect
github.com/danieljoos/wincred v1.2.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
Expand All @@ -99,7 +100,7 @@ require (
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
github.com/emicklei/dot v1.6.1 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
Expand All @@ -124,16 +125,16 @@ require (
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/handlers v1.5.2 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.7.3 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-hclog v1.6.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-metrics v0.5.3 // indirect
github.com/hashicorp/go-plugin v1.5.2 // indirect
github.com/hashicorp/go-plugin v1.6.0 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
Expand Down Expand Up @@ -178,7 +179,7 @@ require (
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rs/cors v1.8.3 // indirect
github.com/rs/cors v1.10.1 // indirect
github.com/rs/zerolog v1.32.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
Expand All @@ -194,7 +195,7 @@ require (
github.com/zondax/ledger-go v0.14.3 // indirect
gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b // indirect
gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
go.etcd.io/bbolt v1.3.9 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect
Expand All @@ -215,14 +216,14 @@ require (
golang.org/x/tools v0.18.0 // indirect
google.golang.org/api v0.162.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect
google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect
google.golang.org/grpc v1.62.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.1 // indirect
nhooyr.io/websocket v1.8.6 // indirect
nhooyr.io/websocket v1.8.10 // indirect
pgregory.net/rapid v1.1.0 // indirect
rsc.io/qr v0.2.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
Expand All @@ -238,10 +239,12 @@ require (
replace (
cosmossdk.io/api => ../api
cosmossdk.io/client/v2 => ../client/v2
cosmossdk.io/collections => ../collections
cosmossdk.io/core => ../core
cosmossdk.io/depinject => ../depinject
cosmossdk.io/tools/confix => ../tools/confix
cosmossdk.io/x/accounts => ../x/accounts
cosmossdk.io/x/accounts/lockup => ../x/accounts/defaults/lockup
cosmossdk.io/x/auth => ../x/auth
cosmossdk.io/x/authz => ../x/authz
cosmossdk.io/x/bank => ../x/bank
Expand Down
Loading

0 comments on commit 0782026

Please sign in to comment.