Skip to content

Commit

Permalink
Merge branch 'main' into hieu/systemtest/gov
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuvubk authored Sep 30, 2024
2 parents f917fb8 + 7ce403f commit e96f2b4
Show file tree
Hide file tree
Showing 212 changed files with 1,682 additions and 1,369 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/auto-assign-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Auto Assign Reviewers

on:
pull_request:
types: [opened, edited, review_requested]

jobs:
assign-reviewers:
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Assign reviewers as assignees
uses: actions/github-script@v7
with:
github-token: ${{ secrets.PRBOT_PAT }}
script: |
const { owner, repo } = context.repo;
async function getCurrentPR() {
if (context.payload.pull_request) {
return context.payload.pull_request;
}
const allPRs = await github.rest.pulls.list({
owner,
repo,
state: 'open',
});
return allPRs.data.find(pr => pr.head.sha === context.sha);
}
const pr = await getCurrentPR();
if (!pr) {
console.log('No matching PR found.');
return;
}
console.log(`Processing PR #${pr.number}`);
const reviewers = pr.requested_reviewers.map(reviewer => reviewer.login);
if (reviewers.length === 0) {
console.log('No reviewers found for this PR.');
return;
}
console.log(`Current reviewers: ${reviewers.join(', ')}`);
await github.rest.issues.addAssignees({
owner,
repo,
issue_number: pr.number,
assignees: reviewers,
});
console.log(`Assigned ${reviewers.join(', ')} as assignees to PR #${pr.number}`);
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-update-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ jobs:
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
default_author: user_info
message: "${{ github.event.pull_request.title }} for all modules"
52 changes: 52 additions & 0 deletions .github/workflows/pr-reminder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: PR Review Reminder

on:
schedule:
- cron: '0 9 * * 1-5' # Every weekday at 9:00 AM UTC

permissions:
pull-requests: read

jobs:
pr-review:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: List open pull requests using GitHub Script
uses: actions/github-script@v7
id: pr-list
with:
script: |
const { data: pullRequests } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
});
let table = '';
pullRequests.forEach(pr => {
const assignees = pr.assignees.length > 0 ? `Assignees: ${pr.assignees.map(assignee => assignee.login).join(', ')}` : 'No assignees';
table += pr.draft ? '' : `
Title: ${pr.title}
Link: <${pr.html_url}>
Assigness: ${assignees}
`;
});
return table;
- name: Send Slack Reminder
if: steps.pr-list.outputs.result != ''
uses: rtCamp/action-slack-notify@v2.3.0
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: pr-github
SLACK_USERNAME: PR-Reminder
MSG_MINIMAL: true
SLACK_ICON_EMOJI: ":think:"
SLACK_COLOR: good
SLACKIFY_MARKDOWN: true
SLACK_TITLE: Daily Pull Request Review Reminder
SLACK_MESSAGE: |
${{ steps.pr-list.outputs.result }}
5 changes: 2 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ jobs:
path: ./tests/e2e-profile.out

test-system:
needs: [tests, test-integration, test-e2e]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -177,7 +176,7 @@ jobs:
- name: system tests v1
if: env.GIT_DIFF
run: |
COSMOS_BUILD_OPTIONS=legacy make test-system
make test-system
- uses: actions/upload-artifact@v3
if: failure()
with:
Expand All @@ -187,7 +186,7 @@ jobs:
- name: system tests v2
if: env.GIT_DIFF
run: |
make test-system
COSMOS_BUILD_OPTIONS=v2 make test-system
- uses: actions/upload-artifact@v3
if: failure()
with:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
### Improvements

* (sims) [#21613](https://github.com/cosmos/cosmos-sdk/pull/21613) Add sims2 framework and factory methods for simpler message factories in modules
* (modules) [#21963](https://github.com/cosmos/cosmos-sdk/pull/21963) Duplicatable metrics are no more collected in modules. They were unecessary overhead.

### Bug Fixes

* (sims) [#21952](https://github.com/cosmos/cosmos-sdk/pull/21952) Use liveness matrix for validator sign status in sims
* (sims) [#21906](https://github.com/cosmos/cosmos-sdk/pull/21906) Skip sims test when running dry on validators
* (cli) [#21919](https://github.com/cosmos/cosmos-sdk/pull/21919) Query address-by-acc-num by account_id instead of id.

### API Breaking Changes

* (types/mempool) [#21744](https://github.com/cosmos/cosmos-sdk/pull/21744) Update types/mempool.Mempool interface to take decoded transactions. This avoid to decode the transaction twice.
Expand Down Expand Up @@ -136,6 +141,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
* (internal) [#21412](https://github.com/cosmos/cosmos-sdk/pull/21412) Using unsafe.String and unsafe.SliceData.
* (client) [#21436](https://github.com/cosmos/cosmos-sdk/pull/21436) Use `address.Codec` from client.Context in `tx.Sign`.
* (x/genutil) [#21249](https://github.com/cosmos/cosmos-sdk/pull/21249) Incremental JSON parsing for AppGenesis where possible.
* (testnet) [#21941](https://github.com/cosmos/cosmos-sdk/pull/21941) Regenerate addrbook.json for in place testnet.

### Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include scripts/build/build.mk

.DEFAULT_GOAL := help

#? go.sum: Run go mod tidy and ensure dependencies have not been modified
#? go.sum: Run go mod tidy and ensure dependencies have not been modified.
go.sum: go.mod
echo "Ensure dependencies have not been modified ..." >&2
go mod verify
Expand Down
2 changes: 1 addition & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ simd config migrate v0.50

If you were using `<appd> config [key]` or `<appd> config [key] [value]` to set and get values from the `client.toml`, replace it with `<appd> config get client [key]` and `<appd> config set client [key] [value]`. The extra verbosity is due to the extra functionalities added in config.

More information about [confix](https://docs.cosmos.network/main/tooling/confix) and how to add it in your application binary in the [documentation](https://docs.cosmos.network/main/tooling/confix).
More information about [confix](https://docs.cosmos.network/main/build/tooling/confix) and how to add it in your application binary in the [documentation](https://docs.cosmos.network/main/build/tooling/confix).

#### gRPC-Web

Expand Down
6 changes: 3 additions & 3 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ require (
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/gogoproto v1.7.0
google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117
google.golang.org/grpc v1.66.2
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142
google.golang.org/grpc v1.67.0
google.golang.org/protobuf v1.34.2
)

Expand All @@ -17,5 +17,5 @@ require (
golang.org/x/net v0.29.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.18.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61 // indirect
)
12 changes: 6 additions & 6 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 h1:+rdxYoE3E5htTEWIe15GlN6IfvbURM//Jt0mmkmm6ZU=
google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117/go.mod h1:OimBR/bc1wPO9iV4NC2bpyjy3VnAwZh5EBPQdtaE5oo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo=
google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8=
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61 h1:N9BgCIAUvn/M+p4NJccWPWb3BWh88+zyL0ll9HgbEeM=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
3 changes: 2 additions & 1 deletion baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ func (app *BaseApp) Query(_ context.Context, req *abci.QueryRequest) (resp *abci

telemetry.IncrCounter(1, "query", "count")
telemetry.IncrCounter(1, "query", req.Path)
defer telemetry.MeasureSince(telemetry.Now(), req.Path)
start := telemetry.Now()
defer telemetry.MeasureSince(start, req.Path)

if req.Path == QueryPathBroadcastTx {
return queryResult(errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "can't route a broadcast tx message"), app.trace), nil
Expand Down
1 change: 0 additions & 1 deletion buf.work.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ version: v1
directories:
- proto
- x/accounts/proto
- x/auth/proto
- x/authz/proto
- x/bank/proto
- x/circuit/proto
Expand Down
2 changes: 1 addition & 1 deletion client/grpc/cmtservice/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func TestStatusCommand(t *testing.T) {
t.Skip() // https://github.com/cosmos/cosmos-sdk/issues/17446
t.Skip() // Rewrite as system test

cfg, err := network.DefaultConfigWithAppConfig(depinject.Configs() /* TODO, test skipped anyway */)
require.NoError(t, err)
Expand Down
4 changes: 4 additions & 0 deletions client/v2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [#18626](https://github.com/cosmos/cosmos-sdk/pull/18626) Support for off-chain signing and verification of a file.
* [#18461](https://github.com/cosmos/cosmos-sdk/pull/18461) Support governance proposals.

### Improvements

* [#21936](https://github.com/cosmos/cosmos-sdk/pull/21936) Print possible enum values in error message after an invalid input was provided.

### API Breaking Changes

* [#17709](https://github.com/cosmos/cosmos-sdk/pull/17709) Address codecs have been removed from `autocli.AppOptions` and `flag.Builder`. Instead client/v2 uses the address codecs present in the context (introduced in [#17503](https://github.com/cosmos/cosmos-sdk/pull/17503)).
Expand Down
2 changes: 1 addition & 1 deletion client/v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ https://github.com/cosmos/cosmos-sdk/blob/main/client/grpc/cmtservice/autocli.go

To further enhance your CLI experience with Cosmos SDK-based blockchains, you can use `hubl`. `hubl` is a tool that allows you to query any Cosmos SDK-based blockchain using the new AutoCLI feature of the Cosmos SDK. With `hubl`, you can easily configure a new chain and query modules with just a few simple commands.

For more information on `hubl`, including how to configure a new chain and query a module, see the [Hubl documentation](https://docs.cosmos.network/main/tooling/hubl).
For more information on `hubl`, including how to configure a new chain and query a module, see the [Hubl documentation](https://docs.cosmos.network/main/build/tooling/hubl).

# Off-Chain

Expand Down
7 changes: 6 additions & 1 deletion client/v2/autocli/flag/enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ func (e enumValue) String() string {
func (e *enumValue) Set(s string) error {
valDesc, ok := e.valMap[s]
if !ok {
return fmt.Errorf("%s is not a valid value for enum %s", s, e.enum.FullName())
var validValues []string
for k := range e.valMap {
validValues = append(validValues, k)
}

return fmt.Errorf("%s is not a valid value for enum %s. Valid values are: %s", s, e.enum.FullName(), strings.Join(validValues, ", "))
}
e.value = valDesc.Number()
return nil
Expand Down
4 changes: 3 additions & 1 deletion client/v2/autocli/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autoc
return err
}

cmd.AddCommand(subCmd)
if !subCmdDescriptor.EnhanceCustomCommand {
cmd.AddCommand(subCmd)
}
}

if cmdDescriptor.Service == "" {
Expand Down
4 changes: 3 additions & 1 deletion client/v2/autocli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ func (b *Builder) AddQueryServiceCommands(cmd *cobra.Command, cmdDescriptor *aut
return err
}

cmd.AddCommand(subCmd)
if !subCmdDesc.EnhanceCustomCommand {
cmd.AddCommand(subCmd)
}
}

// skip empty command descriptors
Expand Down
2 changes: 0 additions & 2 deletions client/v2/autocli/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,8 +575,6 @@ func TestBinaryFlag(t *testing.T) {
}

func TestAddressValidation(t *testing.T) {
t.Skip() // TODO(@julienrbrt) re-able with better keyring instiantiation

fixture := initFixture(t)

_, err := runCmd(fixture, buildModuleQueryCommand,
Expand Down
8 changes: 4 additions & 4 deletions client/v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module cosmossdk.io/client/v2
go 1.23.1

require (
cosmossdk.io/api v0.7.5
cosmossdk.io/api v0.7.6
cosmossdk.io/core v1.0.0-alpha.3
cosmossdk.io/depinject v1.0.0
cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91
Expand All @@ -13,7 +13,7 @@ require (
github.com/cosmos/cosmos-sdk v0.53.0
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
google.golang.org/grpc v1.66.2
google.golang.org/grpc v1.67.0
google.golang.org/protobuf v1.34.2
gotest.tools/v3 v3.5.1
sigs.k8s.io/yaml v1.4.0
Expand Down Expand Up @@ -163,8 +163,8 @@ require (
golang.org/x/text v0.18.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
pgregory.net/rapid v1.1.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions client/v2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,10 @@ google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEY
google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY=
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo=
google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 h1:+rdxYoE3E5htTEWIe15GlN6IfvbURM//Jt0mmkmm6ZU=
google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117/go.mod h1:OimBR/bc1wPO9iV4NC2bpyjy3VnAwZh5EBPQdtaE5oo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8=
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61 h1:N9BgCIAUvn/M+p4NJccWPWb3BWh88+zyL0ll9HgbEeM=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
Expand All @@ -664,8 +664,8 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo=
google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand Down
3 changes: 3 additions & 0 deletions collections/naming_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,23 @@ func TestNaming(t *testing.T) {
}

func expectKeyCodecName[T any](t *testing.T, name string, cdc codec.KeyCodec[T]) {
t.Helper()
schema, err := codec.KeySchemaCodec(cdc)
require.NoError(t, err)
require.Equal(t, 1, len(schema.Fields))
require.Equal(t, name, schema.Fields[0].Name)
}

func expectValueCodecName[T any](t *testing.T, name string, cdc codec.ValueCodec[T]) {
t.Helper()
schema, err := codec.ValueSchemaCodec(cdc)
require.NoError(t, err)
require.Equal(t, 1, len(schema.Fields))
require.Equal(t, name, schema.Fields[0].Name)
}

func expectKeyCodecNames[T any](t *testing.T, cdc codec.KeyCodec[T], names ...string) {
t.Helper()
schema, err := codec.KeySchemaCodec(cdc)
require.NoError(t, err)
require.Equal(t, len(names), len(schema.Fields))
Expand Down
Loading

0 comments on commit e96f2b4

Please sign in to comment.