refactor: Move to x/tx package (#14634)

This commit is contained in:
Amaury 2023-01-17 11:00:31 +01:00 committed by GitHub
parent 7b8ab8ec77
commit afdbc51e47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
72 changed files with 50 additions and 40 deletions

View File

@ -94,7 +94,7 @@ updates:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/tx"
directory: "/x/tx"
schedule:
interval: weekly
labels:

2
.github/labeler.yml vendored
View File

@ -39,6 +39,8 @@
- x/consensus/**/*
"C:x/circuit":
- x/circuit/**/*
"C:x/tx":
- x/tx/**/*
"C:collections":
- collections/**/*
"C:Cosmovisor":

View File

@ -559,7 +559,7 @@ 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
@ -567,18 +567,18 @@ jobs:
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 }}
@ -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

View File

@ -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.

7
x/tx/CHANGELOG.md Normal file
View File

@ -0,0 +1,7 @@
# CHANGELOG
## Unreleased
### Features
### Improvements

View File

@ -1,4 +1,4 @@
module cosmossdk.io/tx
module cosmossdk.io/x/tx
go 1.19

View File

@ -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=.

View File

@ -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"

View File

@ -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"
)

View File

@ -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.

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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"

View File

@ -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 {

View File

@ -3,7 +3,7 @@ package textual
import (
"io"
"cosmossdk.io/tx/textual/internal/cbor"
"cosmossdk.io/x/tx/textual/internal/cbor"
)
var (

View File

@ -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"

View File

@ -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) {

View File

@ -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"
)

View File

@ -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 {

View File

@ -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

View File

@ -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

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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"

View File

@ -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 (

View File

@ -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

View File

@ -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"
)

View File

@ -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) {