Tags: Teslow/cosmos-sdk
Tags
feat(errors): support grpc codes (cosmos#11274) ## Description Follow-up to cosmos#11113 (review). This PR also makes `New` an alias of `Register` as some packages are using `New` as if it were `Register` but are not actually registering their error codes. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
feat(orm)!: add orm app wiring proto definitions (cosmos#11119) ## Description This follows up on cosmos#11119 and adds app wiring proto definitions for the ORM. These would be used together with an app-wiring `cosmos.app.v1.module` option like so: ```proto package foo.bar.my_module.v1; message Module { option (cosmos.app.v1.module) = { go_import: "github.com/foo/bar/x/my_module" }; option (cosmos.orm.v1alpha1.module_schema) = { schema_file: { id: 1 path: "foo/bar/my_module/state.proto" } schema_file: { id: 2 path: "foo/bar/my_module/memory.proto" storage_type: cosmos.orm.v1alpha1.STORAGE_TYPE_MEMORY } }; } ``` This supports various alternative storage types (memory, transient, etc.) which can be scoped to individual file descriptor schemas. This PR also removes the `references` fields currently in `cosmos.orm.v1alpha`. I do think something like that should be supported, but I don't like having a field unsupported by the tooling when the documentation says otherwise. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
fix(orm): ValidateJSON fails when tables are missing (cosmos#11174)
feat(orm): add mock hooks (cosmos#11135) * feat(orm): add mock hooks * add hooks * add tests * update docs * Update orm/testing/ormmocks/docs.go Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com> * add Backend.WithHooks method Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
fix(orm): fix edge case exporting json (cosmos#11134) * fix(orm): fix edge case exporting json * add import json test
feat(orm)!: return ormerrors.NotFound for Get methods in codegen (cos… …mos#11113) ## Description I was talking with @technicallyty and we agreed that returning an error value when an entity is not found is the common golang idiom. What do you think @fdymylja ? You can see how this looks in practice in `module_test.go`. I'm not actually sure this makes the code more succinct or the orm any easier to use. But maybe in certain cases yes. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
build(deps): Bump github.com/tendermint/tendermint from 0.35.0 to 0.3… …5.1 (cosmos#11041) Bumps [github.com/tendermint/tendermint](https://github.com/tendermint/tendermint) from 0.35.0 to 0.35.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/tendermint/tendermint/releases">github.com/tendermint/tendermint's releases</a>.</em></p> <blockquote> <h2>0.35.1 (WARNING: BETA SOFTWARE)</h2> <h2>Changelog</h2> <p><a href="https://github.com/tendermint/tendermint/blob/v0.35.1/CHANGELOG.md#v0.35.1">https://github.com/tendermint/tendermint/blob/v0.35.1/CHANGELOG.md#v0.35.1</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/tendermint/tendermint/blob/master/CHANGELOG.md">github.com/tendermint/tendermint's changelog</a>.</em></p> <blockquote> <h2>v0.35.1</h2> <p>January 26, 2022</p> <p>Special thanks to external contributors on this release: <a href="https://github.com/altergui"><code>@altergui</code></a>, <a href="https://github.com/odeke-em"><code>@odeke-em</code></a>, <a href="https://github.com/thanethomson"><code>@thanethomson</code></a></p> <h3>BREAKING CHANGES</h3> <ul> <li> <p>CLI/RPC/Config</p> <ul> <li>[config] <a href="https://github-redirect.dependabot.com/tendermint/tendermint/pull/7276">#7276</a> rpc: Add experimental config params to allow for subscription buffer size control (<a href="https://github.com/thanethomson"><code>@thanethomson</code></a>).</li> </ul> </li> <li> <p>P2P Protocol</p> <ul> <li>[p2p] <a href="https://github-redirect.dependabot.com/tendermint/tendermint/pull/7265">#7265</a> Peer manager reduces peer score for each failed dial attempts for peers that have not successfully dialed. (<a href="https://github.com/tychoish"><code>@tychoish</code></a>)</li> <li>[p2p] <a href="https://github-redirect.dependabot.com/tendermint/tendermint/pull/7594">#7594</a> always advertise self, to enable mutual address discovery. (<a href="https://github.com/altergui"><code>@altergui</code></a>)</li> </ul> </li> </ul> <h3>FEATURES</h3> <ul> <li>[rpc] <a href="https://github-redirect.dependabot.com/tendermint/tendermint/pull/7270">#7270</a> Add <code>header</code> and <code>header_by_hash</code> RPC Client queries. (<a href="https://github.com/fedekunze"><code>@fedekunze</code></a>) (<a href="https://github.com/cmwaters"><code>@cmwaters</code></a>)</li> </ul> <h3>IMPROVEMENTS</h3> <ul> <li>[internal/protoio] <a href="https://github-redirect.dependabot.com/tendermint/tendermint/pull/7325">#7325</a> Optimized <code>MarshalDelimited</code> by inlining the common case and using a <code>sync.Pool</code> in the worst case. (<a href="https://github.com/odeke-em"><code>@odeke-em</code></a>)</li> <li><a href="https://github-redirect.dependabot.com/tendermint/tendermint/pull/7338">#7338</a> pubsub: Performance improvements for the event query API (backport of <a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7319">#7319</a>) (<a href="https://github.com/creachadair"><code>@creachadair</code></a>)</li> <li><a href="https://github-redirect.dependabot.com/tendermint/tendermint/pull/7252">#7252</a> Add basic metrics to the indexer package. (<a href="https://github.com/creachadair"><code>@creachadair</code></a>)</li> <li><a href="https://github-redirect.dependabot.com/tendermint/tendermint/pull/7338">#7338</a> Performance improvements for the event query API. (<a href="https://github.com/creachadair"><code>@creachadair</code></a>)</li> </ul> <h3>BUG FIXES</h3> <ul> <li><a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7310">#7310</a> pubsub: Report a non-nil error when shutting down (fixes <a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7306">#7306</a>).</li> <li><a href="https://github-redirect.dependabot.com/tendermint/tendermint/pull/7355">#7355</a> Fix incorrect tests using the PSQL sink. (<a href="https://github.com/creachadair"><code>@creachadair</code></a>)</li> <li><a href="https://github-redirect.dependabot.com/tendermint/tendermint/pull/7683">#7683</a> rpc: check error code for broadcast_tx_commit. (<a href="https://github.com/tychoish"><code>@tychoish</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/tendermint/tendermint/commit/7983f9cc36c31e140e46ae5cb00ed39f637ef283"><code>7983f9c</code></a> Prepare changelog for v0.35.1 release. (<a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7702">#7702</a>)</li> <li><a href="https://github.com/tendermint/tendermint/commit/190d26aa4799181ed4d2b0f9d6c3983206ad230a"><code>190d26a</code></a> build(deps): Bump github.com/golangci/golangci-lint (<a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7696">#7696</a>)</li> <li><a href="https://github.com/tendermint/tendermint/commit/58036f7bc142e64e586a8df85d801d31537e5a3f"><code>58036f7</code></a> build(deps): Bump google.golang.org/grpc from 1.43.0 to 1.44.0 (<a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7693">#7693</a>)</li> <li><a href="https://github.com/tendermint/tendermint/commit/47635f756b5320508cd517e015fd18c9dc103565"><code>47635f7</code></a> rpc: check error code for broadcast_tx_commit (<a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7683">#7683</a>) (<a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7688">#7688</a>)</li> <li><a href="https://github.com/tendermint/tendermint/commit/353562a2adf4a958bd706ad993d61e6013f54afe"><code>353562a</code></a> build(deps): Bump github.com/vektra/mockery/v2 from 2.9.4 to 2.10.0 (<a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7684">#7684</a>)</li> <li><a href="https://github.com/tendermint/tendermint/commit/4b565fe58a65f044a32ec23c225d0c4c7bd36467"><code>4b565fe</code></a> p2p: always advertise self, to enable mutual address discovery (<a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7620">#7620</a>)</li> <li><a href="https://github.com/tendermint/tendermint/commit/114548d402666dd0b4b8b880ee3c86e0c8e8bcc0"><code>114548d</code></a> consensus: check proposal non-nil in prevote message delay metric (<a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7625">#7625</a>) (<a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7">#7</a>...</li> <li><a href="https://github.com/tendermint/tendermint/commit/c2f58fa9f9cc4e200f390065cd9fc448713d8bb2"><code>c2f58fa</code></a> build(deps): Bump github.com/prometheus/client_golang (<a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7637">#7637</a>)</li> <li><a href="https://github.com/tendermint/tendermint/commit/b2c4128ac0d6e538dbd1a1d23ed364244c043d33"><code>b2c4128</code></a> build: Make sure to test packages with external tests (backport <a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7608">#7608</a>) (<a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7635">#7635</a>)</li> <li><a href="https://github.com/tendermint/tendermint/commit/d4f26f7d61c3930550d732c50466e1f721ee4aa9"><code>d4f26f7</code></a> consensus: calculate prevote message delay metric (backport <a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7551">#7551</a>) (<a href="https://github-redirect.dependabot.com/tendermint/tendermint/issues/7618">#7618</a>)</li> <li>Additional commits viewable in <a href="https://github.com/tendermint/tendermint/compare/v0.35.0...v0.35.1">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
PreviousNext