Commit Graph

259 Commits

Author SHA1 Message Date
testinginprod
0e34478eb7
refactor(mint)!: migrate state management to collections (#16329)
Co-authored-by: unknown unknown <unknown@unknown>
2023-05-30 09:12:45 +00:00
Aaron Craelius
82659a7477
refactor!: deprecate sdk.Msg.GetSigners (#15284)
Co-authored-by: Matt Kocubinski <mkocubinski@gmail.com>
2023-05-25 18:35:09 +00:00
Marko
571c13ea84
refactor(bank): migrate bech32 encoding (#15567) 2023-05-24 17:03:43 +00:00
Aleksandr Bezobchuk
6cee22df52
feat!: Comet v0.38 Integration (#15519)
Co-authored-by: marbar3778 <marbar3778@yahoo.com>
Co-authored-by: cool-developer <51834436+cool-develope@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Matt Kocubinski <mkocubinski@gmail.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
2023-05-24 16:09:19 +00:00
Facundo Medica
cd3abca867
refactor(x/mint)!: use KVStoreService and context.Context (#16179) 2023-05-22 11:55:10 +00:00
ocnc
5865050f01
fix(tests): Fixes LatestHeight in testutil network (#16219)
Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com>
2023-05-19 10:28:49 +00:00
Marko
b8e15a7930
feat: module circuit breaker (#14521)
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Julien Robert <julien@rbrt.fr>
Co-authored-by: Sam Ricotta <samanthalricotta@gmail.com>
Co-authored-by: samricotta <37125168+samricotta@users.noreply.github.com>
Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com>
2023-05-15 14:38:48 +00:00
mmsqe
d818a628a1
fix: rename back TxExtensionOptionI (#16145) 2023-05-15 14:23:52 +00:00
Marko
044fe13789
refactor(math)!: remove aliases in math (#16040)
Co-authored-by: Julien Robert <julien@rbrt.fr>
2023-05-07 17:25:59 +00:00
Likhita Polavarapu
34018f7130
test(x/evidence): write integration tests (#16015) 2023-05-04 17:23:40 +00:00
Marko
678ee79264
chore: move precommit & preparecheckstate to core api (#15923) 2023-05-02 07:17:00 +00:00
Julien Robert
16e940df55
chore: rename comet logger wrapper (#15983) 2023-04-28 14:36:09 +00:00
Matt Kocubinski
00b78fae00
refactor(x/auth): v2 adaptable tx instead of double decode (#15910) 2023-04-26 19:57:01 +00:00
mmsqe
4d41a87a36
feat: add moduleStateCb to allow access moduleState in sim test (#15903)
Co-authored-by: Julien Robert <julien@rbrt.fr>
2023-04-24 13:06:34 +00:00
Facundo Medica
af3122aa6c
feat!: Provide logger through depinject (#15818)
Co-authored-by: Julien Robert <julien@rbrt.fr>
2023-04-24 09:42:55 +00:00
Bryce Neal
93d64cc6fe
feat: Add PrepareCheckState and Precommit callbacks (#14860)
Co-authored-by: dydxwill <119354122+dydxwill@users.noreply.github.com>
2023-04-23 16:04:36 +00:00
Julien Robert
d2d6d0abd6
test(sims): fix sim-import-export and improve sims (#15835) 2023-04-20 19:12:25 +00:00
Matt Kocubinski
86b88b1ace
refactor!: use x/tx/signing in client.TxConfig (#15822) 2023-04-20 16:20:21 +00:00
Mark Rushakoff
7b10ada768
refactor!: instantiate client.TxConfig once for simulations (#15875) 2023-04-19 12:47:27 +00:00
Likhita Polavarapu
7132a7624e
refactor(staking): add missing msgServer tests and move ValidateBasic() logic to msgServer (#15820) 2023-04-14 14:54:29 +00:00
Marko
8d6c23faa4
feat: add endblocker with valsetupdate type (#15829) 2023-04-14 09:41:29 +00:00
Marko
9e4fbb6db1
feat!: add node status endpoint (#15597)
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com>
2023-04-13 13:42:52 +00:00
Likhita Polavarapu
495ef01f71
test(x/distribution): write integration tests (#15569)
Co-authored-by: Marko <marbar3778@yahoo.com>
2023-04-13 10:05:59 +00:00
Marko
00e1f85eca
style: general linting (#15756) 2023-04-12 11:04:01 +00:00
Likhita Polavarapu
fb257ae9d9
feat: add Context as arg to NewIntegrationApp (#15779)
## Description

Closes: #XXXX

This PR adds `sdk.Context` arg to `NewIntegrationApp`. This allows us to set the context updatable while verifying `begin/end block` logic in integration tests.

---

### 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/main/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/main/docs/docs/building-modules)
* [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/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)
2023-04-11 14:55:55 +00:00
testinginprod
7ab0dfc494
refactor(bank): move bank balances to use collections (#15327) 2023-04-11 13:06:04 +00:00
Julien Robert
9a5413dbaa
feat(integration): allow to run begin and endblocker easily (#15732) 2023-04-08 00:24:47 +02:00
Mark Rushakoff
06892b9bc4
feat(testnet): allow a single active Comet RPC service (#15711)
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2023-04-06 21:06:33 +00:00
Mark Rushakoff
68af247459
feat: add testutil/testnet package (#15655)
Co-authored-by: Marko <marbar3778@yahoo.com>
2023-04-05 19:16:45 +00:00
Julien Robert
c3b1b37e49
test: remove api that should not be used (#15678) 2023-04-03 21:57:11 +00:00
Marko
38c7c948f5
style: various linting fixes (#15675)
## Description

fix various linting issues

---

### 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/main/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/main/docs/docs/building-modules)
* [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/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)
2023-04-03 17:00:44 +00:00
Julien Robert
c1974e4b3c
refactor: remove cometbft/libs/cli import (#15673) 2023-04-03 14:48:02 +00:00
Julien Robert
aeaa301506
feat: integration test helpers (#15556) 2023-03-31 18:02:15 +00:00
Jacob Gadikian
a9546bfad0
style: apply any / all automated lint fixes (#15644) 2023-03-31 13:48:41 +02:00
Marko
51f3e70a12
style: more linting (#15618) 2023-03-30 13:00:18 +00:00
Marko
1f2875d445
style: gofumpt linting (#15605) 2023-03-30 06:27:38 +00:00
Jacob Gadikian
37ba88872d
style: enable strict gofumpt (#15579) 2023-03-28 18:59:21 +00:00
Marko
572e657711
refactor(feegrant): remove bech32 global (#15347)
Co-authored-by: Julien Robert <julien@rbrt.fr>
2023-03-24 22:33:34 +00:00
Julien Robert
c77bcc22c3
refactor: use app config configurator for removing boilerplate (#15499) 2023-03-22 07:29:33 +01:00
Amaury
897ef64712
feat: Validate Msg proto annotations (#13793)
Co-authored-by: Marko <marbar3778@yahoo.com>
2023-03-20 16:27:36 +01:00
Amaury
a4a3c81d11
feat(client): Add cobra's context to clientCtx (#15458)
Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com>
2023-03-20 14:14:58 +00:00
Facundo Medica
6a03586074
fix: remove previous header in Prepare/Process Proposal + provide chain id in baseapp + fix context for verifying txs (#15303)
## Description

### Issue
Some values (like chain ID) were being leaked from the previous block/initialization into PrepareProposal and ProcessProposal, these values are only available if:
1. The node has never been stopped since the genesis block (as these values are set on `InitChain`)
2. The node has already commited a block (as the previous header was being used for the new state of prepare and process proposal).

So if a node is restarted, during the first prepare and process proposal these values won't be populated, and that will cause issues if they are being used.

### Solution

Remove any previous header information from a previous block in the prepare and process proposal contexts, making things consistent at every height.

- Added ChainID to baseapp
- Use an empty header in Commit() with only the chain id set
- Fix context for prepare and process proposal

Closes: #15269



---

### 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/main/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/main/docs/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/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)
2023-03-13 17:15:39 +00:00
Marko
ccdd07ff7d
refactor: remove capability module (#15344) 2023-03-10 12:59:10 +00:00
mmsqe
b75d56985c
feat: add extend cb to avoid unmarshal appState twice for sim test (#15305) 2023-03-08 23:51:26 +00:00
Mark Rushakoff
1bb632a567
chore: prefer to panic instead of os.Exit (#15285) 2023-03-07 15:12:39 +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
Julien Robert
5f47935747
chore: make proto-gen due to dep update (#15268) 2023-03-06 10:54:50 +01:00
Julien Robert
5d559dd265
feat!: use cosmossdk.io/log logger (#15011) 2023-02-27 21:36:22 +00:00
Matt Kocubinski
976ecd4c08
feat: protoreflect based amino json encoder (#14877) 2023-02-23 21:41:06 +00:00