Commit Graph

50 Commits

Author SHA1 Message Date
Jacob Gadikian 9bed6333fa
chore: Upgrade the Cosmos-SDK to Go 1.18 (#11663)
## Description

This PR works towards the completion of the Go Workspaces issue #11450 

It does the following:

* Upgrades the Cosmos-SDK to Go v1.18
* Changes the version of gogo/protobuf to v1.3.2, which exists upstream, unlike v1.3.3 everywhere possible.  The use of the 1.3.3 version number and lack of an upstream version is the blocker for Go Workspaces.



---

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

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [x] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [x] provided a link to the relevant issue or specification
- [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [x] added a changelog entry to `CHANGELOG.md`
- [x] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [x] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [x] 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)
2022-04-19 15:35:08 +00:00
dependabot[bot] fed09c593a
build(deps): Bump github.com/regen-network/gocuke from 0.6.1 to 0.6.2 in /orm (#11621)
Bumps [github.com/regen-network/gocuke](https://github.com/regen-network/gocuke) from 0.6.1 to 0.6.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/regen-network/gocuke/releases">github.com/regen-network/gocuke's releases</a>.</em></p>
<blockquote>
<h2>v0.6.2</h2>
<h2>What's Changed</h2>
<ul>
<li>chore: update to newer versions of gherkin and messages dependencies by <a href="https://github.com/aaronc"><code>@​aaronc</code></a> in <a href="https://github-redirect.dependabot.com/regen-network/gocuke/pull/3">regen-network/gocuke#3</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/regen-network/gocuke/compare/v0.6.1...v0.6.2">https://github.com/regen-network/gocuke/compare/v0.6.1...v0.6.2</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="9648eb6c6e"><code>9648eb6</code></a> chore: update to newer versions of gherkin and messages dependencies (<a href="https://github-redirect.dependabot.com/regen-network/gocuke/issues/3">#3</a>)</li>
<li>See full diff in <a href="https://github.com/regen-network/gocuke/compare/v0.6.1...v0.6.2">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/regen-network/gocuke&package-manager=go_modules&previous-version=0.6.1&new-version=0.6.2)](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>
2022-04-13 05:59:52 +00:00
Aaron Craelius 5cbdad3584
perf(orm): add benchmarks (#11525)
## Description

This PR adds benchmarks for inserting, updating, deleting and getting a simple entity compared with handwritten versions of this code.

Two simple optimizations were found with these benchmarks and included in this PR:
* correctly compute buffer size in `KeyCodec.EncodeKey` to avoid growing the buffer
* use `value.String()` instead of `value.Interface().(string)` as the latter causes an additional allocation

Other potential places for optimization can be seen by running CPU and memory profiles. In particular, update is significantly slower because the ORM assumes the existing value always needs to be decoded to keep indexes up-to-date which is not the case in this simple example. In the future, the ORM code generator could potentially generate more code up to the point of essentially mimicking the manual versions if performance tradeoffs become the bottleneck.

As a follow-up, we should do benchmarks using an IAVL tree as the backing store to see if the ORM overhead is significant in a more real-world scenario.



---

### 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)
2022-04-08 13:22:44 +00:00
Aaron Craelius 1486a669b7
fix(orm): add additional checks on invalid tables (#11387)
## Description

Adds checks for two types of errors in table definitions
* defining a key on an `optional` field (haven't found a way to test unfortunately because a test case will break the code generator)
* defining a trivial unique key, essentially a unique key which contains all the fields in the primary key and is redundant



---

### 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)
2022-04-05 19:48:58 +00:00
dependabot[bot] 65385826be
build(deps): Bump github.com/cosmos/cosmos-sdk/api from 0.1.0-alpha5 to 0.1.0 in /orm (#11520)
Bumps [github.com/cosmos/cosmos-sdk/api](https://github.com/cosmos/cosmos-sdk) from 0.1.0-alpha5 to 0.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/cosmos/cosmos-sdk/releases">github.com/cosmos/cosmos-sdk/api's releases</a>.</em></p>
<blockquote>
<h2>Cosmovisor v0.1.0 Release Notes</h2>
<p>This is the first tracked release of Cosmovisor. It contains the original behavior of scanning app stdin and stdout.
Since the original design, this release contains one important feature: state backup. Since v0.1, by default, cosmovisor will make a state backup (<code>&lt;app_directory&gt;/data</code> directory). Backup will be skipped if <code>UNSAFE_SKIP_BACKUP=true</code> is set.</p>
<p>Updates to this release will be pushed to <code>release/cosmovisor/v0.1.x</code> branch.</p>
<p>Please see the <a href="https://github.com/cosmos/cosmos-sdk/blob/cosmovisor/v0.1.0/cosmovisor/CHANGELOG.md">CHANGELOG</a> for more details.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="d5d8738abe"><code>d5d8738</code></a> build(deps): Bump github.com/prometheus/common from 0.32.1 to 0.33.0 (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11493">#11493</a>)</li>
<li><a href="4159d1a9d0"><code>4159d1a</code></a> docs: x/gov state machine inline comments changes (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11498">#11498</a>)</li>
<li><a href="90f61870e6"><code>90f6187</code></a> chore: Add mergify backport to v0.46.x (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11501">#11501</a>)</li>
<li><a href="74432f487e"><code>74432f4</code></a> docs: Fix the broken links in the documents (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11477">#11477</a>)</li>
<li><a href="e3c3467a84"><code>e3c3467</code></a> chore: use canonical name for dockerfile (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11485">#11485</a>)</li>
<li><a href="40a5364ff0"><code>40a5364</code></a> refactor(auth): better error message for method handler panic (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11482">#11482</a>)</li>
<li><a href="67d9da4945"><code>67d9da4</code></a> build(deps): Bump bufbuild/buf-setup-action from 1.2.1 to 1.3.0 (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11479">#11479</a>)</li>
<li><a href="e75c734c83"><code>e75c734</code></a> refactor(x/auth/middleware)!: tx middleware to support pluggable feemarket mo...</li>
<li><a href="4e92b6294d"><code>4e92b62</code></a> docs: Update MultiSend ref to bank/spec/README.md (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11490">#11490</a>)</li>
<li><a href="a7e68bf1ea"><code>a7e68bf</code></a> chore: remove votes sum invariant (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11483">#11483</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/cosmos/cosmos-sdk/compare/api/v0.1.0-alpha5...api/v0.1.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/cosmos/cosmos-sdk/api&package-manager=go_modules&previous-version=0.1.0-alpha5&new-version=0.1.0)](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>
2022-04-04 06:25:36 +00:00
Aaron Craelius 44a129330e
feat(orm): allow bytes keys longer than 255 bytes (#11522)
## Description

Closes: #11381



---

### 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)
2022-04-01 18:01:11 +00:00
Tyler 719030f4ed
fix(ORM): paginated iterator bug (#11432)
## Description

- fixes a bug where iterators were invalid when limit == len(table entries) and CountTotal = true.

Closes: #11431 



---

### 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)
2022-03-25 16:22:30 +00:00
dependabot[bot] 5acd271377
build(deps): Bump google.golang.org/protobuf from 1.27.1 to 1.28.0 in /orm (#11436)
Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.27.1 to 1.28.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/protocolbuffers/protobuf-go/releases">google.golang.org/protobuf's releases</a>.</em></p>
<blockquote>
<h2>v1.28.0</h2>
<ul>
<li><a href="https://github.com/protocolbuffers/protobuf-go/blob/HEAD/#v1.28-overview">Overview</a></li>
<li><a href="https://github.com/protocolbuffers/protobuf-go/blob/HEAD/#v1.28-notable-changes">Notable changes</a>
<ul>
<li><a href="https://github.com/protocolbuffers/protobuf-go/blob/HEAD/#v1.28-recursion-limit">UnmarshalOption RecursionLimit</a></li>
</ul>
</li>
<li><a href="https://github.com/protocolbuffers/protobuf-go/blob/HEAD/#v1.28-breaking-changes">Upcoming breakage changes</a></li>
</ul>
<h2>Overview </h2>
<p>The release provides a new unmarshal option for limiting the recursion depth when unmarshalling nested messages to prevent stack overflows. (<a href="https://pkg.go.dev/google.golang.org/protobuf/proto#UnmarshalOptions.RecursionLimit"><code>UnmarshalOptions.RecursionLimit</code></a>).</p>
<h2>Notable changes </h2>
<p><strong>New features:</strong></p>
<ul>
<li><a href="https://go.dev/cl/340489">CL/340489</a>: testing/protocmp: add Message.Unwrap</li>
</ul>
<p><strong>Documentation improvements:</strong></p>
<ul>
<li><a href="https://go.dev/cl/339569">CL/339569</a>: reflect/protoreflect: add more docs on Value aliasing</li>
</ul>
<p><strong>Updated supported versions:</strong></p>
<ul>
<li><a href="https://go.dev/cl/370055">CL/370055</a>: all: update supported versions</li>
</ul>
<h3>UnmarshalOption RecursionLimit </h3>
<ul>
<li><a href="https://golang.org/cl/385854">CL/385854</a>: all: implement depth limit for unmarshalling</li>
</ul>
<p>The new <a href="https://pkg.go.dev/google.golang.org/protobuf/proto#UnmarshalOptions.RecursionLimit"><code>UnmarshalOptions.RecursionLimit</code></a> limits the maximum recursion depth when unmarshalling messages. The limit is applied for nested messages. When messages are nested deeper than the specified limit the unmarshalling will fail. If unspecified, a default limit of 10,000 is applied.</p>
<p>In addition to the configurable limit for message nesting a non-configurable recursion limit for <a href="https://developers.google.com/protocol-buffers/docs/proto#groups">group</a> nesting of 10,000 was introduced.</p>
<h2>Upcoming breakage changes </h2>
<p>The default recursion limit of 10,000 introduced in the release is subject to change. We want to align this limit with implementations for other languages in the long term. C++ and Java use a limit of 100 which is also the target for the Go implementation.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="32051b4f86"><code>32051b4</code></a> all: release v1.28.0</li>
<li><a href="3992ea83a2"><code>3992ea8</code></a> all: implement depth limit for unmarshaling</li>
<li><a href="e5db2960ed"><code>e5db296</code></a> all: update supported versions</li>
<li><a href="3a9e1dc314"><code>3a9e1dc</code></a> all: gofmt all</li>
<li><a href="26e8bcb3c7"><code>26e8bcb</code></a> all: remove unnecessary string([]byte) conversion in fmt.Sprintf with %s</li>
<li><a href="5aec41b480"><code>5aec41b</code></a> testing/protocmp: add Message.Unwrap</li>
<li><a href="05be61fde3"><code>05be61f</code></a> reflect/protoreflect: add more docs on Value aliasing</li>
<li><a href="b03064a95c"><code>b03064a</code></a> all: start v1.27.1-devel</li>
<li>See full diff in <a href="https://github.com/protocolbuffers/protobuf-go/compare/v1.27.1...v1.28.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/protobuf&package-manager=go_modules&previous-version=1.27.1&new-version=1.28.0)](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>
2022-03-23 10:18:04 +00:00
dependabot[bot] d52982d623
build(deps): Bump github.com/stretchr/testify from 1.7.0 to 1.7.1 in /orm (#11401)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.0 to 1.7.1.
<details>
<summary>Commits</summary>
<ul>
<li><a href="083ff1c044"><code>083ff1c</code></a> Fixed didPanic to now detect panic(nil).</li>
<li><a href="1e36bfe104"><code>1e36bfe</code></a> Use cross Go version compatible build tag syntax</li>
<li><a href="e798dc2763"><code>e798dc2</code></a> Add docs on 1.17 build tags</li>
<li><a href="83198c2c50"><code>83198c2</code></a> assert: guard CanConvert call in backward compatible wrapper</li>
<li><a href="087b655c75"><code>087b655</code></a> assert: allow comparing time.Time</li>
<li><a href="7bcf74e94f"><code>7bcf74e</code></a> fix msgAndArgs forwarding</li>
<li><a href="c29de71342"><code>c29de71</code></a> add tests for correct msgAndArgs forwarding</li>
<li><a href="f87e2b2119"><code>f87e2b2</code></a> Update builds</li>
<li><a href="ab6dc32628"><code>ab6dc32</code></a> fix linting errors in /assert package</li>
<li><a href="edff5a049b"><code>edff5a0</code></a> fix funtion name</li>
<li>Additional commits viewable in <a href="https://github.com/stretchr/testify/compare/v1.7.0...v1.7.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/stretchr/testify&package-manager=go_modules&previous-version=1.7.0&new-version=1.7.1)](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>
2022-03-21 09:55:02 +00:00
dependabot[bot] 46baaf5b47
build(deps): Bump google.golang.org/grpc from 1.44.0 to 1.45.0 in /orm (#11416)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.44.0 to 1.45.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.44.0...v1.45.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
2022-03-19 12:02:27 +01:00
Aaron Craelius 872d9247b8
feat(orm): gRPC codes for save errors (#11386)
## Description

Ref: #11088. First PR of several to add gRPC error codes and make sure that errors are a well-defined part of the API.

Also introduces Cucumber-style BDD acceptance tests into the SDK via https://github.com/regen-network/gocuke.



---

### 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)
2022-03-17 18:57:55 +00:00
Tyler 0a3298f4f9
fix(ORM): support for imported messages in iterators (#11372)
## Description

- adds support for imported messages in iterators

Closes: n/a



---

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

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [x] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [x] provided a link to the relevant issue or specification
- [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [x] 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)
2022-03-14 21:56:18 +00:00
Aaron Craelius ec8024eced
feat(types/errors)!: update to latest errors module beta (#11279)
## Description

Follow-up to #11274 



---

### 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)
2022-03-13 08:42:40 +00:00
Marie Gauthier 75d9d0dd7e
feat: Add `MsgSoftwareUpgrade` and `MsgCancelUpgrade` (for new msgs-based gov proposals) (#11116) 2022-03-03 16:45:02 +01:00
Aaron Craelius d930b7b893
refactor(orm)!: update to new module schema descriptor (#11273)
## Description

Follow-up to #11119 to update the ORM code to use these definitions.



---

### 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)
2022-03-01 16:18:45 +00:00
dependabot[bot] 86927825ff
build(deps): Bump github.com/cosmos/cosmos-sdk/errors in /orm (#11292)
Bumps [github.com/cosmos/cosmos-sdk/errors](https://github.com/cosmos/cosmos-sdk) from 1.0.0-beta.2 to 1.0.0-beta.3.
- [Release notes](https://github.com/cosmos/cosmos-sdk/releases)
- [Changelog](https://github.com/cosmos/cosmos-sdk/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cosmos/cosmos-sdk/compare/errors/v1.0.0-beta.2...errors/v1.0.0-beta.3)

---
updated-dependencies:
- dependency-name: github.com/cosmos/cosmos-sdk/errors
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
2022-02-28 21:17:20 +01:00
dependabot[bot] cf6a7bab29
build(deps): Bump github.com/cosmos/cosmos-sdk/api from 0.1.0-alpha4 to 0.1.0-alpha5 in /orm (#11272)
Bumps [github.com/cosmos/cosmos-sdk/api](https://github.com/cosmos/cosmos-sdk) from 0.1.0-alpha4 to 0.1.0-alpha5.
<details>
<summary>Commits</summary>
<ul>
<li><a href="4de7d40010"><code>4de7d40</code></a> feat(orm)!: add orm app wiring proto definitions (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11119">#11119</a>)</li>
<li><a href="7e18e9f1bf"><code>7e18e9f</code></a> feat!: Add hooks to allow app modules to add things to state-sync (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/10961">#10961</a>)</li>
<li><a href="c9a37fe4be"><code>c9a37fe</code></a> updates (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11263">#11263</a>)</li>
<li><a href="ef6fed67de"><code>ef6fed6</code></a> fix: case unauthorized message (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11229">#11229</a>)</li>
<li><a href="6324b5affb"><code>6324b5a</code></a> fix: reject query with block height in the future (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11222">#11222</a>)</li>
<li><a href="40190fbba7"><code>40190fb</code></a> build(deps): Bump github.com/magiconair/properties from 1.8.5 to 1.8.6 (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11257">#11257</a>)</li>
<li><a href="cf82b663d5"><code>cf82b66</code></a> docs: add module migration order guidance (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11255">#11255</a>)</li>
<li><a href="75bcf47f13"><code>75bcf47</code></a> refactor: prune everything (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11177">#11177</a>)</li>
<li><a href="ff31490769"><code>ff31490</code></a> feat: replace all ModuleCdc instances with legacy.Cdc (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11240">#11240</a>)</li>
<li><a href="433420091a"><code>4334200</code></a> build(deps): Bump github.com/google/go-cmp from 0.5.6 to 0.5.7 in /orm (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-sdk/issues/11247">#11247</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/cosmos/cosmos-sdk/compare/api/v0.1.0-alpha4...api/v0.1.0-alpha5">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/cosmos/cosmos-sdk/api&package-manager=go_modules&previous-version=0.1.0-alpha4&new-version=0.1.0-alpha5)](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>
2022-02-26 10:48:38 +00:00
Aaron Craelius 57b46134a9
refactor(orm)!: refactor hooks into validate and write hooks (#11185)
* refactor(orm)!: refactor hooks into validate and write hooks

* impl and tests

* docs

* update mock hooks and tests

Co-authored-by: Marko <marbar3778@yahoo.com>
2022-02-25 14:54:44 +01:00
dependabot[bot] 433420091a
build(deps): Bump github.com/google/go-cmp from 0.5.6 to 0.5.7 in /orm (#11247)
Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.6 to 0.5.7.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.5.6...v0.5.7)

---
updated-dependencies:
- dependency-name: github.com/google/go-cmp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
2022-02-23 12:10:02 +01:00
dependabot[bot] 5c8021ed0f
build(deps): Bump github.com/tendermint/tm-db in /orm (#11244)
Bumps [github.com/tendermint/tm-db](https://github.com/tendermint/tm-db) from 0.6.6 to 0.6.7.
- [Release notes](https://github.com/tendermint/tm-db/releases)
- [Changelog](https://github.com/tendermint/tm-db/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tendermint/tm-db/compare/v0.6.6...v0.6.7)

---
updated-dependencies:
- dependency-name: github.com/tendermint/tm-db
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-21 20:45:47 +01:00
Aaron Craelius 7869d38e94
feat(orm): support nil PageRequest (#11171)
## Description

Closes: #XXXX



---

### 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)
2022-02-15 17:56:22 +00:00
Aaron Craelius 0d4cb92dad
refactor(orm)!: rename table interfaces from Store -> Table in codegen (#11176)
## Description

I realize it's more intuitive to name the interfaces in codegen `FooTable` rather than `FooStore` for the type `Foo`.

Since we (and possibly others) are starting to build off of this, better to change now rather than later.

How does this change look?



---

### 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)
2022-02-14 15:23:52 +00:00
Aaron Craelius 94e6a379a2
fix(orm): ValidateJSON fails when tables are missing (#11174) 2022-02-11 16:02:36 -05:00
Aaron Craelius 77ac8fa378
feat(orm): add mock hooks (#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>
2022-02-08 11:56:53 -05:00
Aaron Craelius ebddeee360
fix(orm): fix edge case exporting json (#11134)
* fix(orm): fix edge case exporting json

* add import json test
2022-02-07 17:36:12 -05:00
Aaron Craelius 1944a0883e
feat(orm)!: ordered variable length encoding for uint32 and uint64 types (#11090)
## Description

`uint64` values are used in the ORM as auto-incrementing primary keys. Always using 8 bytes for these values is a bit of a waste of space. Unfortunately, varint encoding does not support ordered prefix iteration.

This PR introduces a compact, well-ordered variable length encoding for `uint32` and `uint64` types. `fixed32` and `fixed64` integers are still encoded as 4 and 8 byte fixed-length big-endian arrays. With this, users have a choice of encoding based on what type of data they are storing. An auto-incrementing primary key should prefer the variable length `uint64` whereas a fixed precision decimal might want to use `fixed64`.

See the golden test updates to see how this reduces key lengths.

This encoding works by using the first two bits to encode the buffer length (4 possible lengths). I'm not sure if my choice of 2,4,6 and 9 bytes is the right choice of 4 lenths for `uint64` - there are many alternate choices. I could have also chosen 3 bits and allowed for 8 possible lengths, but way waste an extra bit? Input on the right design parameters would be appreciated.



---

### 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)
2022-02-07 17:58:55 +00:00
Aaron Craelius 81105764f9
feat(orm)!: return ormerrors.NotFound for Get methods in codegen (#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)
2022-02-04 16:07:36 +00:00
Aaron Craelius 37ae08d92a
feat(orm): ModuleDB JSON import/export/default/validate methods (#11101)
* feat(orm): ModuleDB JSON methods

* WIP

* WIP on JSON

* WIP

* WIP

* tests and docs

* revert

* tests and docs

* docs

* address review comments
2022-02-03 20:36:21 -08:00
Aaron Craelius 888548ab53
fix(orm): fix broken Table.Delete method (#11112) 2022-02-03 15:59:16 -05:00
Aaron Craelius 63a248ef03
feat(orm): range/prefix deletion support (#11103)
## Description

This adds `DeleteBy...` methods to the ORM codegen for the primary key + every unique index.



---

### 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)
2022-02-03 10:04:02 +00:00
Aaron Craelius 5126ec3c79
feat(orm)!: tweak API to allow pagination in generated code (#11079)
* WIP on fixing issues and expanding tests with codegen

* fixes

* fix tests

* feat(orm)!: pagination codegen and API cleanup

* WIP on refactoring list/paginate

* fixes

* fixes

* tests pass

* codegen

* codegen

* Update orm/model/ormtable/index.go

Co-authored-by: Marko <marbar3778@yahoo.com>

* codegen

* Update orm/model/ormtable/filter.go

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* revert

Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
2022-02-02 16:12:11 -05:00
Aaron Craelius 4e8172d1a1
feat(orm): return newly generated ID with auto-increment tables (#11040)
## Description

Adds a new interface `AutoIncrementTable` which extends `Table` and has a method `InsertWithID` which returns the newly generated ID. The new ID is also set on the message itself, but it feels like a nice improvement to have this method in real usage.



---

### 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)
2022-02-01 17:14:46 +00:00
Aaron Craelius 02dd5060a2
fix(orm): codegen issues (#11061) 2022-01-31 19:23:15 -05:00
dependabot[bot] dd99727164
build(deps): Bump github.com/cosmos/cosmos-proto from 1.0.0-alpha6 to 1.0.0-alpha7 in /orm (#11077)
Bumps [github.com/cosmos/cosmos-proto](https://github.com/cosmos/cosmos-proto) from 1.0.0-alpha6 to 1.0.0-alpha7.
<details>
<summary>Commits</summary>
<ul>
<li><a href="508be82654"><code>508be82</code></a> fix: add DO NOT EDIT comment (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-proto/issues/59">#59</a>)</li>
<li><a href="54245cae61"><code>54245ca</code></a> chore(deps): bump google.golang.org/protobuf from 1.27.0 to 1.27.1 (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-proto/issues/53">#53</a>)</li>
<li><a href="a24585c0bc"><code>a24585c</code></a> chore(deps): bump github.com/google/go-cmp from 0.5.5 to 0.5.6 (<a href="https://github-redirect.dependabot.com/cosmos/cosmos-proto/issues/54">#54</a>)</li>
<li>See full diff in <a href="https://github.com/cosmos/cosmos-proto/compare/v1.0.0-alpha6...v1.0.0-alpha7">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/cosmos/cosmos-proto&package-manager=go_modules&previous-version=1.0.0-alpha6&new-version=1.0.0-alpha7)](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>
2022-01-31 21:38:05 +00:00
Aaron Craelius 22517392b3
fix(orm): bad error messages (#11059)
## Description

I've tested this locally running codegen and this PR changes this error message:
```
panic: nil field: unsupported key field

goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/orm/internal/codegen.newTableGen({0xc00000d938, 0xc0003c4100}, 0xc0003c0c60, 0xc0002d4c80)
        /Users/arc/go/pkg/mod/github.com/cosmos/cosmos-sdk/orm@v1.0.0-alpha.3/internal/codegen/table.go:47 +0x3e5
github.com/cosmos/cosmos-sdk/orm/internal/codegen.fileGen.gen({0xc00000d938, 0xc0003c4100})
        /Users/arc/go/pkg/mod/github.com/cosmos/cosmos-sdk/orm@v1.0.0-alpha.3/internal/codegen/file.go:32 +0x205
github.com/cosmos/cosmos-sdk/orm/internal/codegen.PluginRunner(0xc000137cc0)
        /Users/arc/go/pkg/mod/github.com/cosmos/cosmos-sdk/orm@v1.0.0-alpha.3/internal/codegen/codegen.go:40 +0x159
google.golang.org/protobuf/compiler/protogen.run({0x0, 0x0}, 0x143b8f0)
        /Users/arc/go/pkg/mod/google.golang.org/protobuf@v1.27.1/compiler/protogen/protogen.go:74 +0x142
google.golang.org/protobuf/compiler/protogen.Options.Run({0x0, 0x0}, 0xc0000001a0)
        /Users/arc/go/pkg/mod/google.golang.org/protobuf@v1.27.1/compiler/protogen/protogen.go:52 +0x2a
main.main()
        /Users/arc/go/pkg/mod/github.com/cosmos/cosmos-sdk/orm@v1.0.0-alpha.3/cmd/protoc-gen-go-cosmos-orm/main.go:10 +0x25
Failure: plugin go-cosmos-orm: exit status 2; context canceled; exit status 2; signal: killed; signal: killed; context canceled
```

into this:
```
Failure: plugin go-cosmos-orm: field id on regen.ecocredit.v1beta1.BatchSupply: field not found
```




---

### 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)
2022-01-28 19:28:51 +00:00
Aaron Craelius 627748d4e9 fix: orm go.mod 2022-01-28 13:51:03 -05:00
Tyler 20b2605d79
feat(orm): codegen (#11033)
## Description

adds orm code generation

Closes: #10737 



---

### 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)
2022-01-28 18:43:24 +00:00
atheeshp 8133ee8048
refactor: remove deprecated vote option (#10854)
## Description

Closes: #10792



---

### 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)
2022-01-26 10:37:20 +00:00
Aaron Craelius 6ea2049944
feat(orm): add module db (#10991)
## Description

This PR adds a `ModuleDB` interface which can be used directly by Cosmos SDK modules. A simplified bank example with Mint/Send/Burn functionality against Balance and Supply tables is included in the tests.

This PR also:
* adds simplified `Get` and `Has` methods to `Table` which use the primary key values in the message instead of `...interface{}`
* adds a stable deterministic proto JSON marshaler and updates the `Entry.String` methods to use it because the golden tests are not deterministic without this. This code is currently internal but can be extracted to a public `codec` or `cosmos-proto` package eventually.

---

### 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)
2022-01-22 03:13:43 +00:00
Aaron Craelius 531bf50845
feat(orm): add ORM Table and Indexes (#10670)
## Description

Closes: #10729 

Includes:
* table, auto-increment table, and singleton `Table` implementations
* primary key, index and unique index `Index` implementations
* store wrappers based on tm-db but that could be retargeted to the new ADR 040 db which separate index and commitment stores, with a debug wrapper
* streaming JSON import and export
* full logical decoding (and encoding)



---

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

- [x] 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
- [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [x] 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)
- [x] 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`
- [x] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [x] updated the relevant documentation or specification
- [x] 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)
2022-01-20 16:22:06 +00:00
dependabot[bot] 931bb6e97c
build(deps): Bump gotest.tools/v3 from 3.0.3 to 3.1.0 in /orm (#10959)
Bumps [gotest.tools/v3](https://github.com/gotestyourself/gotest.tools) from 3.0.3 to 3.1.0.
- [Release notes](https://github.com/gotestyourself/gotest.tools/releases)
- [Commits](https://github.com/gotestyourself/gotest.tools/compare/v3.0.3...v3.1.0)

---
updated-dependencies:
- dependency-name: gotest.tools/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-18 12:29:21 +01:00
Aaron Craelius 8a75b959aa
build: add scripts to update all go.mod's at once (#10901)
Following up on https://github.com/cosmos/cosmos-sdk/discussions/10582#discussioncomment-1909115, this PR adds two scripts that update all go.mod's at once:
* `scripts/go-update-dep-all.sh` updates a dependency in all go.mod's which use it
* `scripts/go-mod-tidy-all.sh` runs `go mod tidy` in all go.mod's

It also updates the cosmos-proto dep as an example

---

### 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)
2022-01-07 17:05:07 +00:00
Aaron Craelius 0cb7fd081e
feat: full api module building alongside gogo proto files with buf schema registry support (#10669)
* chore: get proto files setup for buf schema registry

* WIP on bsr setup

* WIP

* WIP

* full API module + gogo proto building together

* switch to pulsar

* regen pulsar

* API module builds

* update ver

* cleanup

* update script

* fix api module

* update api

* update buf.yaml

* add docs

* update to pulsar alpha6

Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Frojdi Dymylja <33157909+fdymylja@users.noreply.github.com>
2022-01-06 14:57:55 -05:00
Aaron Craelius 074c95bdbf
chore: link go.mod's to tagged errors/v1.0.0-beta.2 go.mod (#10878)
* chore: link go.mod's to github.com/cosmos/cosmos-sdk/errors@v1.0.0-beta.1

* update to beta.2

* tidy
2022-01-04 19:43:22 -05:00
dependabot[bot] b3f4ff0d3a
build(deps): Bump github.com/cosmos/cosmos-proto in /orm (#10753)
Bumps [github.com/cosmos/cosmos-proto](https://github.com/cosmos/cosmos-proto) from 1.0.0-alpha1 to 1.0.0-alpha4.
- [Release notes](https://github.com/cosmos/cosmos-proto/releases)
- [Commits](https://github.com/cosmos/cosmos-proto/compare/v1.0.0-alpha1...v1.0.0-alpha4)

---
updated-dependencies:
- dependency-name: github.com/cosmos/cosmos-proto
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
2021-12-13 17:50:38 +01:00
dependabot[bot] 89d7e3c232
build(deps): Bump github.com/cosmos/cosmos-sdk in /orm (#10752)
Bumps [github.com/cosmos/cosmos-sdk](https://github.com/cosmos/cosmos-sdk) from 0.44.3 to 0.44.5.
- [Release notes](https://github.com/cosmos/cosmos-sdk/releases)
- [Changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.44.5/CHANGELOG.md)
- [Commits](https://github.com/cosmos/cosmos-sdk/compare/v0.44.3...v0.44.5)

---
updated-dependencies:
- dependency-name: github.com/cosmos/cosmos-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-13 15:59:34 +01:00
Aaron Craelius c41ac20c6c
feat(orm): add ormkv.EntryCodec and ormkv.IndexCodec's (#10647)
* feat(orm): add KeyCodec

* WIP

* code coverage

* add DefaultValue test

* fix range key check

* revert DefaultValue

* fix range check

* feat(orm): add ormkv.Codec's

* WIP

* add UniqueKeyCodec

* add IndexKeyCodec

* fixes

* add SeqCodec

* add doc comments

* test fields

* refactor field names

* Update orm/encoding/ormkv/index_key.go

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* Update orm/encoding/ormkv/index_key.go

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* Update orm/encoding/ormkv/index_key.go

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* Update orm/encoding/ormkv/unique_key.go

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* add tests for entry strings

* address review comments

* fix non-deterministic string rendering and tests

* Update x/auth/middleware/priority_test.go

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* Update x/auth/middleware/priority_test.go

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
2021-12-02 22:21:57 -05:00
Aaron Craelius cf6ace5a1c
feat(orm): add ormkv.KeyCodec (#10640)
* feat(orm): add KeyCodec

* WIP

* code coverage

* add DefaultValue test

* fix range key check

* revert DefaultValue

* fix range check

* Update orm/encoding/ormkv/key_codec.go

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* Update orm/encoding/ormkv/key_codec.go

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* Update orm/encoding/ormkv/key_codec.go

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* Update orm/encoding/ormkv/util.go

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* Update orm/encoding/ormkv/key_codec.go

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* Update orm/encoding/ormkv/key_codec.go

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* Update orm/encoding/ormkv/key_codec.go

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* address review comments

* address review comments

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
2021-11-30 16:27:17 -05:00
Aaron Craelius 6662f2ff30
feat(orm): add ormfield.Codec (#10601)
* feat(orm): add ormvalue.Codec

* WIP

* WIP

* working tests

* update dep

* support more types, add docs

* comments

* address review comments

* updates

* add comment
2021-11-24 13:10:26 -05:00
Aaron Craelius e04f2d6a5d
feat: init ORM proto (#10579)
* feat: init ORM proto

* docs

* package fix

* add SchemaDescriptor, unique, references and docs

* move schema

* update docs, add go.mod
2021-11-23 11:26:43 -05:00