Commit Graph
10718 Commits
Author SHA1 Message Date
dependabot[bot] c33cb83cc8 build(deps): Bump golang.org/x/crypto from 0.6.0 to 0.7.0 (#15275) 2023-03-06 23:08:05 +00:00
dependabot[bot] 5e55f56d39 build(deps): Bump github.com/cometbft/cometbft from 0.37.0-rc4 to 0.37.0 (#15283) 2023-03-06 22:07:16 +00:00
Julien Robert fd76793378 chore: remove unnecessary condition (#15277) 2023-03-06 20:06:52 +00:00
Mark Rushakoff e7097b1468 test: add cmdtest package (#15251)
## Description

This PR introduces the `cmdtest` package, offering a lightweight wrapper around cobra commands to simplify testing CLI utilities.

I backfilled tests for the `version` command, which was an example of a very simple test setup; and for the `export` command, which was more involved due to the server and client context requirements.

I did notice that there are some existing tests for some utilities, but the `cmdtest` package follows a simple pattern that has been easy to use successfully in [the relayer](https://github.com/cosmos/relayer/blob/main/internal/relayertest/system.go) and in other projects outside the Cosmos ecosystem.

While filling in these tests, I started removing uses of `cmd.Print`, as that is the root cause of issues like #8498, #7964, #15167, and possibly others. Internal to cobra, the print family of methods write to `cmd.OutOrStderr()` -- meaning that if the authors call `cmd.SetOutput()` before executing the command, the output will be written to stdout as expected; otherwise it will go to stderr. I don't understand why that would be the default behavior, but it is probably too late to change from cobra's side.

Instead of `cmd.Print`, we prefer to `fmt.Fprint(cmd.OutOrStdout())` or `fmt.Fprint(cmd.ErrOrStderr())` as appropriate, giving an unambiguous destination for output. And the new tests collect those outputs in plain `bytes.Buffer` values so that we can assert their content appropriately.

In the longer term, I would like to deprecate and eventually remove the `testutil` package's `ApplyMockIO` method and its `BufferWriter` and `BufferReader` types, as they are unnecessary indirection when a simpler solution exists. But that can wait until `cmdtest` has propagated through the codebase more.

---

### 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] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] ~~provided a link to the relevant issue 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 all author checklist items have been addressed
- [ ] confirmed that this PR does not change production code
2023-03-06 19:40:24 +00:00
Mark Rushakoff f151bf627a refactor(log): require destination in calls to NewLogger (#15262) 2023-03-06 19:05:49 +00:00
Amaury e9478df161 refactor(x/tx): Move textual,aminojson to signing (#15278) 2023-03-06 18:17:24 +00:00
dependabot[bot]andgithub-actions 6f9af26966 build(deps): Bump github.com/jhump/protoreflect from 1.15.0 to 1.15.1 (#15274)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-06 17:45:59 +00:00
testinginprodandtestinginprod 3b40a62276 feat(collections): add NewSchemaBuilderFromAccessor function (#15271)
Co-authored-by: testinginprod <testinginprod@somewhere.idk>
2023-03-06 17:07:17 +00:00
183dde8d00 fix: snapshot recover from exporter error (#13935)
Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Emmanuel T Odeke <emmanuel@orijtech.com>
Co-authored-by: Marko <marko@baricevic.me>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2023-03-06 16:44:26 +00:00
Aaron CraeliusandAmaury 1f40d9d47d feat(x/tx): extract signers using cosmos.msg.v1.signer (#15205)
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
2023-03-06 11:12:54 -05:00
Julien Robert 5f47935747 chore: make proto-gen due to dep update (#15268) 2023-03-06 10:54:50 +01:00
Nikhil Suri 89c956f8ed feat(x/bank): update keeper interface to include GetAllDenomMetaData (#15265)
## Description

Adds `GetAllDenomMetaData` to the bank keeper interface. This enables other modules to refer to it in their `expected_keepers`, for example in `x/wasm`. This PR is therefore a prerequisite for adding denom metadata querying to cosmwasm.



---

### 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/main/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/main/docs/docs/building-modules)
- [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/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)
2023-03-05 20:22:24 +00:00
Devon Bear 672b052f32 perf(x/bank): 👉🥺👈 (reduce logging verbosity) (#15266) 2023-03-05 13:53:17 +01:00
Marko 570bcd2b18 chore: update roadmap with completed items (#15263) 2023-03-05 00:29:47 +01:00
Jeancarlo Barrios 34192a089b feat(autocli): add text|json output for flag output (#15252) 2023-03-03 17:00:06 -05:00
Mark Rushakoff fab029bff5 refactor(log): associate test logger with testing.T instance (#15261) 2023-03-03 20:26:45 +00:00
dependabot[bot]andgithub-actions dcd92eedd3 build(deps): Bump github.com/cometbft/cometbft from 0.37.0-rc3 to 0.37.0-rc4 (#15260)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-03 17:22:49 +00:00
Mark Rushakoff ac74e23769 fix(crypto/keyring): disallow non-owner reads of keyhash (#15258) 2023-03-03 16:25:22 +00:00
Mark Rushakoff 08be7ab2f5 refactor(log): restore customized nop logger (#15257) 2023-03-03 14:33:25 +00:00
Julien Robert 8fb95f06ed chore: clean-up changelog (#15253) 2023-03-03 08:28:40 +01:00
ee458eb6c4 feat(autocli): add simple msg support (#14832)
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
2023-03-02 16:43:09 -05:00
Marko 1edc60b871 chore: changelog 0.47 -> main (#15166) 2023-03-02 18:56:42 +00:00
dependabot[bot] c553831d3c build(deps): Bump github.com/pelletier/go-toml/v2 from 2.0.6 to 2.0.7 in /tools/hubl (#15248)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-02 19:19:39 +01:00
Facundo MedicaandMarko 14ba0248b8 feat: Implement RegisterServices for CoreAPI in module manager (#15133)
Co-authored-by: Marko <marbar3778@yahoo.com>
2023-03-02 14:22:20 -03:00
Devon BearandCal Bera da238c5555 impr(tx): Allow for Custom SignModeHandlers. (#15204)
Co-authored-by: Cal Bera <calbera@berachain.com>
2023-03-02 16:30:46 +00:00
Maksym Hontar 07dc5e70e9 fix: Change proposer address cast for sdk_block conversion (#15243) 2023-03-02 17:08:13 +01:00
Julien Robert 0141817fca docs: add swagger ui in docs (#15241) 2023-03-02 12:40:26 +00:00
Julien RobertandMarko de16912e39 chore: improve UGPRADING.md (#15236)
Co-authored-by: Marko <marbar3778@yahoo.com>
2023-03-02 11:43:19 +01:00
dependabot[bot] 364b5ebc79 build(deps): Bump cosmossdk.io/core from 0.5.1 to 0.6.0 (#15228) 2023-03-01 20:15:43 +01:00
Chi Xiao Wenandchixiaowen a49151d693 refactor: remove bytes/HexBytes (#15211)
Co-authored-by: chixiaowen <chixiaowen@zhigui.com>
2023-03-01 18:27:23 +00:00
dependabot[bot]andJulien Robert 23ef32a35c build(deps): Bump github.com/prometheus/common from 0.40.0 to 0.41.0 (#15229)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
2023-03-01 17:59:14 +00:00
dependabot[bot]andJulien Robert 9a5e948cfe build(deps): Bump bufbuild/buf-setup-action from 1.14.0 to 1.15.0 (#15225)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
2023-03-01 17:11:11 +00:00
dependabot[bot] ce6402c02a build(deps): Bump gaurav-nelson/github-action-markdown-link-check from 1.0.14 to 1.0.15 (#15226)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-01 18:05:31 +01:00
Mark Rushakoffandmergify[bot] 9150a9d255 test(server/grpc): avoid using deprecated protoreflect function (#15221)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-03-01 16:55:48 +00:00
Mark Rushakoff e33c5a7e49 test: fix flakiness due to duplicate denoms (#15223) 2023-03-01 16:22:48 +00:00
Julien Robert 41c8529ff9 chore: bump cometbft to v0.37.0-rc3 (#15220) 2023-03-01 16:30:41 +01:00
Julien Robert 2f4654e40c chore: clean-up of #15151 (#15219) 2023-03-01 11:07:07 +00:00
Marko 44495e7a79 refactor: add burnable params to governance (#15151) 2023-02-28 20:44:46 +00:00
Mark Rushakoff 261af6721b test: use pointer receivers to avoid lock copies (#15217)
## Description
There were several test suite methods that had a value receiver, and which were being ignored for linting. Instead of ignoring the error, use pointer receivers to properly avoid lock copying.

And use a local copy of one loop variable in a possible closure.

---

### 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] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] ~~provided a link to the relevant issue 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 all author checklist items have been addressed
- [ ] confirmed that this PR does not change production code
2023-02-28 18:27:57 +00:00
Julien Robert d2977478bc feat: use go embed for swagger (#15216) 2023-02-28 15:21:38 +00:00
Julien Robert 1273c05ada test(math): fix FormatDec test (#15215) 2023-02-28 14:57:42 +00:00
Marko 17ba80df7c chore: use message router interface (#15213) 2023-02-28 12:40:16 +01:00
dependabot[bot] 82e7ed1f08 build(deps): Bump golang.org/x/sys from 0.0.0-20220209214540-3681064d5158 to 0.5.0 in /depinject (#15161)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-27 22:01:47 +00:00
Julien Robert 5d559dd265 feat!: use cosmossdk.io/log logger (#15011) 2023-02-27 21:36:22 +00:00
dependabot[bot]andgithub-actions 35d1e7a90a build(deps): Bump github.com/jhump/protoreflect from 1.12.1-0.20220721211354-060cc04fc18b to 1.15.0 (#15173)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-27 21:50:12 +01:00
dependabot[bot]andgithub-actions b1603227e5 build(deps): Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 (#15172)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-27 19:49:52 +00:00
dependabot[bot] 5c76bff0d4 build(deps): Bump actions/add-to-project from 0.4.0 to 0.4.1 (#15171) 2023-02-27 19:21:34 +00:00
dependabot[bot] d1625654ae build(deps): Bump github.com/cosmos/cosmos-db from 0.0.0-20221226095112-f3c38ecb5e32 to 1.0.0-rc.1 in /core (#15180)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-27 18:58:45 +00:00
Julien Robert ac39a4215c ci: limit dependabot spam (#15203) 2023-02-27 18:29:39 +00:00
Marko 7c9245dbdf chore: audit changelog (#15132) 2023-02-27 15:05:43 +01:00