Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Move to x/tx package #14634

Merged
merged 9 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ updates:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/tx"
directory: "/x/tx"
schedule:
interval: weekly
labels:
Expand Down
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
- x/consensus/**/*
"C:x/circuit":
- x/circuit/**/*
"C:x/tx":
- x/tx/**/*
"C:collections":
- collections/**/*
"C:Cosmovisor":
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -559,26 +559,26 @@ jobs:
# NOTE: The following jobs are used to test the Cosmos SDK Go submodules present under x/{module}.
# They run when there is a diff in their respective directories.

test-tx:
test-x-tx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.4
cache: true
cache-dependency-path: tx/go.sum
cache-dependency-path: x/tx/go.sum
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
tx/**/*.go
tx/go.mod
tx/go.sum
x/tx/**/*.go
x/tx/go.mod
x/tx/go.sum
- name: tests
if: env.GIT_DIFF
run: |
cd tx
cd x/tx
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
- name: sonarcloud
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }}
Expand All @@ -587,7 +587,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: tx/
projectBaseDir: x/tx/

test-x-nft:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### API Breaking Changes

* (tx) [#14634](https://github.com/cosmos/cosmos-sdk/pull/14634) Move the `tx` go module to `x/tx`.
* (snapshots) [#14597](https://github.com/cosmos/cosmos-sdk/pull/14597) Move `snapshots` to `store/snapshots`, rename and bump proto package to v1.
* (crypto/keyring) [#14151](https://github.com/cosmos/cosmos-sdk/pull/14151) Move keys presentation from `crypto/keyring` to `client/keys`
* (modules) [#13850](https://github.com/cosmos/cosmos-sdk/pull/13850) and [#14046](https://github.com/cosmos/cosmos-sdk/pull/14046) Remove gogoproto stringer annotations. This removes the custom `String()` methods on all types that were using the annotations.
Expand Down
7 changes: 7 additions & 0 deletions x/tx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# CHANGELOG

## Unreleased

### Features

### Improvements
2 changes: 1 addition & 1 deletion tx/go.mod → x/tx/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module cosmossdk.io/tx
module cosmossdk.io/x/tx
amaury1093 marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

@julienrbrt julienrbrt Jan 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A PR adding a new vanity url must be created here: https://github.com/cosmos/vanity.
We should possibly bundle the addition of x/nft and x/circuit there too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


go 1.19

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sonar.projectKey=cosmos-sdk-tx
sonar.organization=cosmos

sonar.projectName=Cosmos SDK - Tx
sonar.projectName=Cosmos SDK - x/tx
sonar.project.monorepo.enabled=true

sonar.sources=.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tx/textual/any_test.go → x/tx/textual/any_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"testing"

"cosmossdk.io/tx/textual"
"cosmossdk.io/x/tx/textual"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/require"

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tx/textual/bytes_test.go → x/tx/textual/bytes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"testing"

"cosmossdk.io/tx/textual"
"cosmossdk.io/x/tx/textual"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/reflect/protoreflect"
)
Expand Down
2 changes: 1 addition & 1 deletion tx/textual/coin_test.go → x/tx/textual/coin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1"
basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1"
"cosmossdk.io/tx/textual"
"cosmossdk.io/x/tx/textual"
)

// mockCoinMetadataKey is used in the mock coin metadata querier.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tx/textual/coins_test.go → x/tx/textual/coins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1"
basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1"
"cosmossdk.io/math"
"cosmossdk.io/tx/textual"
"cosmossdk.io/x/tx/textual"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/reflect/protoreflect"
)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tx/textual/dec_test.go → x/tx/textual/dec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"testing"

"cosmossdk.io/tx/textual"
"cosmossdk.io/x/tx/textual"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/reflect/protoreflect"
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"testing"

"cosmossdk.io/tx/textual"
"cosmossdk.io/x/tx/textual"
"github.com/stretchr/testify/require"

"google.golang.org/protobuf/proto"
Expand Down
4 changes: 2 additions & 2 deletions tx/textual/e2e_test.go → x/tx/textual/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
_ "cosmossdk.io/api/cosmos/crypto/multisig"
_ "cosmossdk.io/api/cosmos/crypto/secp256k1"
_ "cosmossdk.io/api/cosmos/gov/v1"
"cosmossdk.io/tx/textual"
"cosmossdk.io/tx/textual/internal/textualpb"
"cosmossdk.io/x/tx/textual"
"cosmossdk.io/x/tx/textual/internal/textualpb"
)

type e2eJsonTest struct {
Expand Down
2 changes: 1 addition & 1 deletion tx/textual/encode.go → x/tx/textual/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package textual
import (
"io"

"cosmossdk.io/tx/textual/internal/cbor"
"cosmossdk.io/x/tx/textual/internal/cbor"
)

var (
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tx/textual/enum_test.go → x/tx/textual/enum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strings"
"testing"

"cosmossdk.io/tx/textual"
"cosmossdk.io/tx/textual/internal/testpb"
"cosmossdk.io/x/tx/textual"
"cosmossdk.io/x/tx/textual/internal/testpb"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/encoding/protojson"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tx/textual/int_test.go → x/tx/textual/int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"google.golang.org/protobuf/reflect/protoreflect"

"cosmossdk.io/math"
"cosmossdk.io/tx/textual"
"cosmossdk.io/x/tx/textual"
)

func TestIntJsonTestcases(t *testing.T) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"testing"

"cosmossdk.io/tx/textual/internal/cbor"
"cosmossdk.io/x/tx/textual/internal/cbor"
"github.com/stretchr/testify/require"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "google/protobuf/descriptor.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";

option go_package = "cosmossdk.io/tx/textual/internal/testpb";
option go_package = "cosmossdk.io/x/tx/textual/internal/testpb";

// A is used for testing value renderers.
message A {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: v1
managed:
enabled: true
go_package_prefix:
default: cosmossdk.io/tx/textual/internal/testpb
default: cosmossdk.io/x/tx/textual/internal/testpb
except:
- buf.build/googleapis/googleapis
- buf.build/cosmos/gogo-proto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: v1
managed:
enabled: true
go_package_prefix:
default: cosmossdk.io/tx/textual/internal/textualpb
default: cosmossdk.io/x/tx/textual/internal/textualpb
except:
- buf.build/googleapis/googleapis
- buf.build/cosmos/gogo-proto
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tx/textual/message_test.go → x/tx/textual/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/stretchr/testify/require"

bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1"
"cosmossdk.io/tx/textual"
"cosmossdk.io/tx/textual/internal/testpb"
"cosmossdk.io/x/tx/textual"
"cosmossdk.io/x/tx/textual/internal/testpb"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/stretchr/testify/require"

"cosmossdk.io/tx/textual"
"cosmossdk.io/tx/textual/internal/testpb"
"cosmossdk.io/x/tx/textual"
"cosmossdk.io/x/tx/textual/internal/testpb"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"testing"

"cosmossdk.io/tx/textual"
"cosmossdk.io/x/tx/textual"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/reflect/protoreflect"
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"
"time"

"cosmossdk.io/tx/textual"
"cosmossdk.io/x/tx/textual"
"github.com/stretchr/testify/require"

"google.golang.org/protobuf/proto"
Expand Down
2 changes: 1 addition & 1 deletion tx/textual/tx.go → x/tx/textual/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
msg "cosmossdk.io/api/cosmos/msg/v1"
signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1"
txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1"
"cosmossdk.io/tx/textual/internal/textualpb"
"cosmossdk.io/x/tx/textual/internal/textualpb"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions tx/textual/tx_test.go → x/tx/textual/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
_ "cosmossdk.io/api/cosmos/crypto/secp256k1"
_ "cosmossdk.io/api/cosmos/gov/v1"
txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1"
"cosmossdk.io/tx/signing"
"cosmossdk.io/tx/textual"
"cosmossdk.io/tx/textual/internal/textualpb"
"cosmossdk.io/x/tx/signing"
"cosmossdk.io/x/tx/textual"
"cosmossdk.io/x/tx/textual/internal/textualpb"
)

// txJsonTestTx represents the type that in the JSON test
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1"
basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1"
"cosmossdk.io/tx/signing"
"cosmossdk.io/tx/textual/internal/textualpb"
"cosmossdk.io/x/tx/signing"
"cosmossdk.io/x/tx/textual/internal/textualpb"
cosmos_proto "github.com/cosmos/cosmos-proto"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/reflect/protoreflect"

"cosmossdk.io/tx/textual"
"cosmossdk.io/tx/textual/internal/testpb"
"cosmossdk.io/x/tx/textual"
"cosmossdk.io/x/tx/textual/internal/testpb"
)

func TestDispatcher(t *testing.T) {
Expand Down