Skip to content

Commit

Permalink
refactor: revert auth extraction (#21507)
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Sep 3, 2024
1 parent 8431dbd commit 70488a8
Show file tree
Hide file tree
Showing 305 changed files with 784 additions and 1,794 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1352,37 +1352,6 @@ jobs:
with:
projectBaseDir: x/staking/

test-x-auth:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
cache: true
cache-dependency-path: x/auth/go.sum
- uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
x/auth/**/*.go
x/auth/go.mod
x/auth/go.sum
- name: tests
if: env.GIT_DIFF
run: |
cd x/auth
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./...
- name: sonarcloud
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: x/auth/

test-x-authz:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
* (x/authz) [#18265](https://github.com/cosmos/cosmos-sdk/pull/18265) Authz module was moved to its own go.mod `cosmossdk.io/x/authz`
* (x/mint) [#18283](https://github.com/cosmos/cosmos-sdk/pull/18283) Mint module was moved to its own go.mod `cosmossdk.io/x/mint`
* (server) [#18303](https://github.com/cosmos/cosmos-sdk/pull/18303) `x/genutil` now handles the application export. `server.AddCommands` does not take an `AppExporter` but instead `genutilcli.Commands` does.
* (x/auth) [#18351](https://github.com/cosmos/cosmos-sdk/pull/18351) Auth module was moved to its own go.mod `cosmossdk.io/x/auth`
* (types) [#18372](https://github.com/cosmos/cosmos-sdk/pull/18372) Removed global configuration for coin type and purpose. Setters and getters should be removed and access directly to defined types.
* (types) [#18607](https://github.com/cosmos/cosmos-sdk/pull/18607) Removed address verifier from global config, moved verifier function to bech32 codec.
* (types) [#18695](https://github.com/cosmos/cosmos-sdk/pull/18695) Removed global configuration for txEncoder.
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ Module Dependencies are the modules that an application may depend on and which
| Cosmos SDK | 0.50.z | 0.52.z |
| --------------------------- | ------ | ------ |
| cosmossdk.io/x/auth | X | 0.2.z |
| cosmossdk.io/x/accounts | N/A | 0.2.z |
| cosmossdk.io/x/bank | X | 0.2.z |
| cosmossdk.io/x/circuit | 0.1.z | 0.2.z |
Expand Down
2 changes: 1 addition & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ For modules that have migrated, verify you are checking against `collections.Err
Accounts's AccountNumber will be used as a global account number tracking replacing Auth legacy AccountNumber. Must set accounts's AccountNumber with auth's AccountNumber value in upgrade handler. This is done through auth keeper MigrateAccountNumber function.

```go
import authkeeper "cosmossdk.io/x/auth/keeper"
import authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
...
err := authkeeper.MigrateAccountNumberUnsafe(ctx, &app.AuthKeeper)
if err != nil {
Expand Down
7 changes: 4 additions & 3 deletions api/cosmos/auth/module/v1/module.pulsar.go

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

9 changes: 5 additions & 4 deletions api/cosmos/tx/config/v1/config.pulsar.go

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

2 changes: 1 addition & 1 deletion baseapp/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"cosmossdk.io/store/snapshots"
snapshottypes "cosmossdk.io/store/snapshots/types"
storetypes "cosmossdk.io/store/types"
"cosmossdk.io/x/auth/signing"

"github.com/cosmos/cosmos-sdk/baseapp"
baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil"
Expand All @@ -46,6 +45,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/mempool"
"github.com/cosmos/cosmos-sdk/x/auth/signing"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion baseapp/abci_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"cosmossdk.io/core/comet"
"cosmossdk.io/core/header"
"cosmossdk.io/log"
authtx "cosmossdk.io/x/auth/tx"

"github.com/cosmos/cosmos-sdk/baseapp"
baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil"
Expand All @@ -34,6 +33,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/mempool"
signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion baseapp/baseapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"cosmossdk.io/store/snapshots"
snapshottypes "cosmossdk.io/store/snapshots/types"
storetypes "cosmossdk.io/store/types"
authtx "cosmossdk.io/x/auth/tx"

"github.com/cosmos/cosmos-sdk/baseapp"
baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil"
Expand All @@ -33,6 +32,7 @@ import (
"github.com/cosmos/cosmos-sdk/testutil"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions baseapp/msg_service_router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import (

"cosmossdk.io/depinject"
"cosmossdk.io/log"
authsigning "cosmossdk.io/x/auth/signing"
authtx "cosmossdk.io/x/auth/tx"

"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
)

func TestRegisterMsgService(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions baseapp/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ import (
"cosmossdk.io/depinject/appconfig"
errorsmod "cosmossdk.io/errors"
storetypes "cosmossdk.io/store/types"
_ "cosmossdk.io/x/auth"
"cosmossdk.io/x/auth/signing"
_ "cosmossdk.io/x/auth/tx/config"

"github.com/cosmos/cosmos-sdk/baseapp"
baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil"
Expand All @@ -39,6 +36,9 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/mempool"
signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
_ "github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/signing"
_ "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
)

var ParamStoreKey = []byte("paramstore")
Expand Down
3 changes: 1 addition & 2 deletions client/tx/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ import (
gogogrpc "github.com/cosmos/gogoproto/grpc"
"github.com/spf13/pflag"

authsigning "cosmossdk.io/x/auth/signing"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/input"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/tx"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
)

// GenerateOrBroadcastTxCLI will either generate and print an unsigned transaction
Expand Down
7 changes: 3 additions & 4 deletions client/tx/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import (
"github.com/stretchr/testify/require"
"google.golang.org/grpc"

"cosmossdk.io/x/auth/ante"
"cosmossdk.io/x/auth/signing"
authtx "cosmossdk.io/x/auth/tx"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
Expand All @@ -28,6 +24,9 @@ import (
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"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/signing"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
)

var ac = testutil.CodecOptions{}.GetAddressCodec()
Expand Down
2 changes: 1 addition & 1 deletion client/tx_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package client
import (
"time"

"cosmossdk.io/x/auth/signing"
txsigning "cosmossdk.io/x/tx/signing"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/tx"
signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/auth/signing"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion client/v2/autocli/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (

// the following will be extracted to a separate module
// https://github.com/cosmos/cosmos-sdk/issues/14403
authtypes "cosmossdk.io/x/auth/types"
govcli "cosmossdk.io/x/gov/client/cli"
govtypes "cosmossdk.io/x/gov/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

"github.com/cosmos/cosmos-sdk/client"
clienttx "github.com/cosmos/cosmos-sdk/client/tx"
Expand Down
2 changes: 0 additions & 2 deletions client/v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ require (
cosmossdk.io/log v1.4.1 // indirect
cosmossdk.io/math v1.3.0
cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect
cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000
cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect
cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
Expand Down Expand Up @@ -185,7 +184,6 @@ replace (
cosmossdk.io/core => ./../../core
cosmossdk.io/core/testing => ../../core/testing
cosmossdk.io/store => ./../../store
cosmossdk.io/x/auth => ./../../x/auth
cosmossdk.io/x/bank => ./../../x/bank
cosmossdk.io/x/consensus => ./../../x/consensus
cosmossdk.io/x/distribution => ./../../x/distribution
Expand Down
12 changes: 6 additions & 6 deletions collections/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ import (
storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "cosmossdk.io/x/auth/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
)

var AccountsPrefix = collections.NewPrefix(0)
Expand Down Expand Up @@ -257,7 +257,7 @@ import (
"fmt"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "cosmossdk.io/x/auth/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
)

var AccountsPrefix = collections.NewPrefix(0)
Expand Down Expand Up @@ -508,7 +508,7 @@ import (
storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "cosmossdk.io/x/auth/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
)

var AccountsPrefix = collections.NewPrefix(0)
Expand Down Expand Up @@ -930,7 +930,7 @@ import (
storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "cosmossdk.io/x/auth/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
)

var AccountsNumberIndexPrefix = collections.NewPrefix(1)
Expand Down Expand Up @@ -989,7 +989,7 @@ import (
storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "cosmossdk.io/x/auth/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
)

var AccountsNumberIndexPrefix = collections.NewPrefix(1)
Expand Down Expand Up @@ -1097,7 +1097,7 @@ import (
storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "cosmossdk.io/x/auth/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
)

var AccountsPrefix = collections.NewPrefix(0)
Expand Down
3 changes: 1 addition & 2 deletions collections/collections.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import (
"io"
"math"

"cosmossdk.io/schema"

"cosmossdk.io/collections/codec"
"cosmossdk.io/schema"
)

var (
Expand Down
4 changes: 1 addition & 3 deletions collections/indexing.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ import (
"fmt"
"strings"

"cosmossdk.io/schema"
"github.com/tidwall/btree"

"cosmossdk.io/collections/codec"
"cosmossdk.io/schema"
)

// IndexingOptions are indexing options for the collections schema.
type IndexingOptions struct {

// RetainDeletionsFor is the list of collections to retain deletions for.
RetainDeletionsFor []string
}
Expand Down Expand Up @@ -98,7 +97,6 @@ func (c collectionSchemaCodec) decodeKVPair(update schema.KVPairUpdate) ([]schem
return []schema.ObjectUpdate{
{TypeName: c.coll.GetName()},
}, err

}

if update.Remove {
Expand Down
2 changes: 1 addition & 1 deletion crypto/keyring/autocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package keyring

import (
signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1"
authsigning "cosmossdk.io/x/auth/signing"

cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
)

// autoCLIKeyring represents the keyring interface used by the AutoCLI.
Expand Down
2 changes: 1 addition & 1 deletion crypto/keys/multisig/multisig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"cosmossdk.io/core/address"
"cosmossdk.io/depinject"
"cosmossdk.io/log"
"cosmossdk.io/x/auth/migrations/legacytx"

"github.com/cosmos/cosmos-sdk/codec"
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
Expand All @@ -23,6 +22,7 @@ import (
_ "github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/testutil/configurator"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
)

func TestNewMultiSig(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion depinject/appconfig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import "cosmos/app/v1alpha1/module.proto";
message Module {
option (cosmos.app.v1alpha1.module) = {
go_import: "cosmossdk.io/x/auth"
go_import: "github.com/cosmos/cosmos-sdk/x/auth"
};
string bech32_prefix = 1;
repeated ModuleAccountPermission module_account_permissions = 2;
Expand Down
Loading

0 comments on commit 70488a8

Please sign in to comment.