Commit Graph

68 Commits

Author SHA1 Message Date
Alexander Bezobchuk 8670a10564
Merge PR #6595: Single Binary & Command Refactor 2020-07-07 11:40:46 -04:00
Alexander Bezobchuk 51df2f2033
Module Viper Removal (#6604)
* Remove viper

* Remove viper

* Remove viper

* Skip TestCLIValidateGenesis

* remove cruft leftover

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-07-06 10:12:00 +00:00
SaReN 39f53ac22f
client: rename CliContext to Context (#6290)
* Refactor CliContext as Context

* Fix lint issues

* Fix goimports

* Fix gov tests

* Resolved ci-lint issues

* Add changelog

* Rename cliCtx to clientCtx

* Fix mocks and routes

* Add changelog

* Update changelog

* Apply suggestions from code review

Co-authored-by: Alessio Treglia <alessio@tendermint.com>

* merge client/rpc/ro{ot,utes}.go

* Update docs

* client/rpc: remove redundant client/rpc.RegisterRPCRoutes

* regenerate mocks

* Update ADRs

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-06-01 12:46:03 +00:00
Aaron Craelius 850419fffd
Tx CLI proto module interface (#5989)
* WIP

* WIP

* WIP on removing x/auth dependency from client/tx

* Revert unneeded changes

* Simplify cli tx UX

* Wire up bank tx REST routes

* Fix assignment issue

* Wire up bank NewSendTxCmd

* fix lint

* revert file

* revert file

* fix simcli

* Refactor AccountRetriever

* Fix build

* Fix build

* Fix build

* Fix integration tests

* Fix tests

* Docs, linting

* Linting

* WIP on all modules

* Implement other module new tx cmd's

* Fix cmd's

* Refactor existing GetTxCmd

* Fix cmd

* Removing deprecated code

* Update ADR 020 & CHANGELOG

* Lint

* Lint

* Lint

* Lint

* Lint

* Lint

* Lint

* Fix client/tx tests

* Fix mocks

* Fix tests

* Lint fixes

* REST tx migration

* Wire up REST

* Linting

* Update CHANGELOG, docs

* Fix tests

* lint

* Address review feedback

* Update CHANGELOG.md

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>

* group vars

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-05-21 21:29:34 +00:00
Aaron Craelius 70767c87c4
Update x/gov to use Any (#6147)
* Update x/gov to use Any

* Fixes

* Remove MsgSubmitProposalLegacy

* Update CHANGELOG.md

* Add RegisterInterfaces for x/distribution, x/params, & x/upgrade

* Fix query JSON issue

* Fix gov tests

* Revert custom Any Equals

* Re-remove types

* Rename receivers

* Fix imports in gov

* Sort imports

* Make amino JSON signing work with Any

* Run proto-gen

* Create full amino wrapper

* Fix errors

* Fixes

* Fix tests

* Test fixes

* Fix tests

* Linting

* Update ADR 019 and CHANGELOG

* Updated ADR 019

* Extract Marshal/UnmarshalProposal

* fix error

* lint

* linting

* linting

* Update client/keys/parse.go

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

* linting

* Update docs/architecture/adr-019-protobuf-state-encoding.md

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>

* Update docs/architecture/adr-019-protobuf-state-encoding.md

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>

* Address review feedback

* Add godocs

* Fix errors

* fix errors

* revert file

* Address review feedback

* Address review feedback

* Stacktrace debug flag

* Fix tests

* Address review feedback

Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-05-19 20:17:29 +00:00
Aaron Craelius 58a6c4c007
Merge PR #5942: Tx Client Migration: x/gov 2020-04-14 15:05:14 -04:00
Alessio Treglia b647824716
Refactor x/auth/client/utils/ (#5555)
Packages named utils, common, or misc provide clients with no
sense of what the package contains. This makes it harder for
clients to use the package and makes it harder for maintainers
to keep the package focused. Over time, they accumulate dependencies
that can make compilation significantly and unnecessarily slower,
especially in large programs. And since such package names are
generic, they are more likely to collide with other packages
imported by client code, forcing clients to invent names to
distinguish them.

 cit. https://blog.golang.org/package-names
2020-01-24 16:40:56 +00:00
Alexander Bezobchuk c1991e31bd Merge PR #5527: Bump Tendermint Version to v0.33.0
* Bump Tendermint version to v0.33.0

* Deprecate old cmn package with new packages

* Update update DB APIs

* More DB updates

* Bump IAVL to v0.13.0

* Handle error returned by iavl.NewMutableTree

* Fix some IAVL stuffs

* Update IAVL

* More updates

* Passing tests

* Fix unit tests

Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com>
2020-01-16 13:46:51 -08:00
Ferenc Fabian 8353680115 Merge PR #5442: Remove of the client/alias.go 2019-12-23 11:05:47 -05:00
Alessio Treglia d4c831e63a Drop on-disk keybase in favor of keyring (#5180)
* Switch keys commands to keyring

* Replace NewKeybase with NewKeyring

* Fix delete test

* Purge dead code

* Override COSMOS_SDK_TEST_KEYRING envvar to switch to a test keyring

* s/unningOnServer/unningUnattended/

C'ing @tnachen

* Add deprecated warning, output looks like the following:

```
$ gaiacli keys update --help
Command "update" is deprecated, it takes no effect with the new keyring
based backend and is provided only for backward compatibility with the
legacy LevelDB based backend.
Refer to your operating system's manual to learn how to change your
keyring's password.

Change the password used to protect private key

Usage:
  gaiacli keys update <name> [flags]

Flags:
  -h, --help   help for update

Global Flags:
      --chain-id string   Chain ID of tendermint node
  -e, --encoding string   Binary encoding (hex|b64|btc) (default "hex")
      --home string       directory for config and data (default "/home/alessio/.gaiacli")
  -o, --output string     Output format (text|json) (default "text")
      --trace             print out full stack trace on errors
```

* Update multisign command

* Modify server.GenerateSaveCoinKey()

* GenerateSaveCoinKey more modifications

* Update docs

* Update upgrade module
2019-11-14 15:17:21 +01:00
Alexander Bezobchuk 84621bbd53
Merge PR #5216: Fix Query Gov Proposals Pagination 2019-10-18 12:46:21 -04:00
Alessio Treglia c530c1cbb7
Remove auth's AccountDecoder type (#4588)
AccountDecoder is now entirely redundant.
client package now does no longer depend on x/auth.

Context: #4488
2019-06-19 16:20:27 +02:00
Alessio Treglia 73700df8c3 Merge PR #4555: Move client/{tx,rest,utils} into x/auth/client 2019-06-15 14:34:11 +02:00
frog power 4000 5f9c3fdf88 Merge PR #4451: Client and Module Modularization 2019-06-05 19:26:16 -04:00
Alexander Bezobchuk cfe31c4090
Merge PR #4372: Use Build's Client/Server Name 2019-05-18 19:06:08 -04:00
Alessio Treglia 71d71f2206
Remove gaia (#4347)
Gaia is removed from cosmos-sdk repository.

Few changes were required to make sure no packages depend on gaia subpackages.

CI config is amended accordingly.

Unnecessary targets are removed from Makefile.

Simulations run through a lightweight version of gaia renamed to simapp.

Closes: #4104
2019-05-18 10:42:24 +02:00
Alexander Bezobchuk 85ffce5f58
Merge PR #4306: Allow generate-only to fully operate offline 2019-05-08 16:06:05 -04:00
Alexander Bezobchuk 5ca93ac574 Merge PR #4206: Param Change Proposal
* Add params error types

* Update param module keeper to take a codespace

* Update imports

* Implement SetRaw and SetRawWithSubkey

* Implement ParamChange and update aliases

* Add types codec

* Implement ParameterChangeProposal

* Implement TestParameterChangeProposal

* Fix linting errors

* Update tags

* Implement content

* Updata params aliases

* Finish params handler and proposal types

* Move deposit and vote logic to types package

* Move proposal type to types package

* Move errors to types package

* Update proposal

* Move gov messages to types package

* Minor updates to naming

* Move keys to types package

* Move codec to types package

* Move proposal types to types package

* Update aliases

* Add governance alias types

* Implement governance router

* Update gov aliases

* Update gov keeper

* Update private functions needed for the keeper

* Update godocs

* Update the gov message handler

* Update Gaia app

* Make updates to auth

* Update the message codec in the keeper

* Update gov end blocker

* Update types tests

* Minor tweaks

* Add legacy genesis logic

* Update gov aliases

* Move gov keys to types package

* Revertt to using gov/types in params

* Implement params handler test

* Update governance tests

* Fix endblocker tests

* Fix governance querier tests

* Add seal support to gov router

* Update simulationCreateMsgSubmitProposal

* Disable software upgrade proposals

* Move params keys to types package

* Implement param module proposal client logic

* Update gov client logic

* Update gaia app client hooks

* Fix linting errors

* Fix ValidateBasic

* Remove legacy files

* Update paramchange to use strings

* Update paramchange cli cmd

* Update ValidateBasic and errors

* Use PostCommands when adding child cmds

* Fix codec logic

* Update params client and handler

* Update IsValidProposalType

* Update SubmitProposal to test exec

* Implement TestGaiaCLISubmitParamChangeProposal

* Implement TestSubmitParamChangeProposal

* Update swagger.yaml

* Update gaiacli.md

* Update gov spec docs

* Fix linting errors

* Fix unit tests

* Add pending log entries

* Update docs

* Update docs

* Update client/lcd/swagger-ui/swagger.yaml

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Update docs/cosmos-hub/gaiacli.md

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Update cmd/gaia/cli_test/test_helpers.go

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Update client/lcd/test_helpers.go

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Update docs/cosmos-hub/gaiacli.md

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Update docs/cosmos-hub/gaiacli.md

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Update docs/cosmos-hub/gaiacli.md

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Update x/gov/types/proposal.go

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Update docs/cosmos-hub/gaiacli.md

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Update docs/cosmos-hub/gaiacli.md

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Address PR comments

* Update docs/cosmos-hub/gaiacli.md

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Update gov docs to include quorum notes

* Add logs to handleParameterChangeProposal

* Update docs/spec/governance/02_state.md

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Support and use new StatusFailed when proposal passes but fails exec

* Add docs/notes warning on param validity

* Update docs

* Update docs/spec/governance/02_state.md

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Update docs/spec/governance/02_state.md

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Minor doc update

* Update x/gov/client/cli/tx.go

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Fix usage of fromAddr

* Rige code style  suggestion

* Update x/params/types/proposal.go

Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>

* Fix CI lint errors

* Update NewModuleClient godoc

* Add godoc to rtr.Seal() call

* Rename files

* Rename NewProposalHandler
2019-04-30 12:31:38 -04:00
Federico Kunze eb51a6f84b remove duplicated account check and test (#4068) 2019-04-10 13:10:44 +01:00
Alessio Treglia e7e3c32204 Merge PR #3553: Code cleanup, take #1
* add a bunch of tests, add DONTCOVER text tag

- Also fix flaky test (closes: #3559). Don't test values
  returned by queries since there's no way to query a
  specific height via REST.

* GetTempDir -> NewTestCaseDir
2019-02-08 22:45:41 +01:00
Juan Leni ba63eb1801 Merge PR #3557: Removing pkg/errors when not necessary 2019-02-08 11:37:46 -08:00
Jack Zampolin 408484e6d4
Merge PR #3503: CLI flags to args 2019-02-06 16:15:37 -08:00
Alexander Bezobchuk 90797f5e09 Gaia Lite Generate Only Support (w/o Keybase) (#3396) 2019-01-29 11:22:47 -08:00
Jack Zampolin 9f50c9f5b6
R4R: Ensure all CLI queries respect output flags (#3320) 2019-01-22 09:28:39 -08:00
Alessio Treglia 500fa2b694 Make coins denoms case insensitive (#3092) 2018-12-18 11:14:11 -08:00
Artur Albov 0c6d53dc07 Merge PR #2959: Add TxEncoder to client TxBuilder 2018-12-12 22:29:42 +01:00
Alessio Treglia 24a1670cf0 Run make format 2018-12-10 14:27:25 +00:00
Jack Zampolin 886bd35670
Address gov cli ux issues and add additional input validation for better errors (#2938)
* Fix governance cli ux issues and add additional transaction validation
2018-12-03 12:48:51 -08:00
John McDowall f09fa33cfd Merge PR #2802: Correct the usage of misspelling of English word 'depositor'.
Throughout the codebase the misspelling 'depositer' of the English word
'depositor' has been used. This commit applies a global search and
replace to correct the misspelling.
2018-11-22 00:53:33 +01:00
Alessio Treglia 3e68e44063 Merge PR #2874: gaiad gentx subcommands refactoring
* gaiad gentx subcommands refactoring

- Replace STDIN/STDOUT redirection in `gaiad gentx` with subcommands
  command line options to redirect streams to file since viper does
  not handle redirection well.
- Use `BuildCreateValidatorMsg` to build a `MsgCreateValidator` rather
  than redirecting to `gaiacli tx stake create-validator`.
- `PrintUnsignedStdTx` now takes an `io.Writer` object.
- Mark `--pubkey`, `--amount` and `--moniker` as required flags
  instead of validating them manually.
- Use stake.NewDescription() to make a new Description - ref #2835

* Refresh PENDING.md
2018-11-22 00:44:13 +01:00
Jack Zampolin f525717054
Standardize CLI Exports from Modules (#2840)
* Move query and tx commands to modules
* Move GetAccountDecoder to prevent import cycle and replace calls to it with one call in WithAccountDecoder
* Add moduleClients interface and implement in all applicable modules
* Use module clients in cli initialization
2018-11-19 09:02:34 -08:00
gamarin2 addcfbf5cb Documentation Structure Change and Cleanup (#2808)
* Update docs/sdk/clients.md
* organize ADR directory like tendermint
* docs: move spec-proposals into spec/
* remove lotion, moved to website repo
* move getting-started to cosmos-hub, and voyager to website
* docs: move lite/ into clients/lite/
* move introduction/ content to website repo
* move resources/ content to website repo
* mv sdk/clients.md to clients/clients.md
* mv validators to cosmos-hub/validators
* move deprecated sdk/ content to _attic
* sdk/modules.md is duplicate with modules/README.md
* consolidate remianing sdk/ files into a single sdk.md
* move examples/ to docs/examples/
* mv docs/cosmos-hub to docs/gaia
* Add keys/accounts section to localnet docs
2018-11-14 11:44:17 -08:00
Sunny Aggarwal d1614ebb7e R4R: Query Gov Params (#2576)
* gov query params
2018-11-13 15:45:37 -08:00
Sunny Aggarwal 1d3a04a61c Switch gov proposal-queues to use iterators (#2638)
* switched gov proposals queue to use iterators
* update gov spec
* update proposal.Equal
* Amino api change
* switched proposalID to uint64
* renamed Gov Procedures to Params
* s/ActiveProposalQueueProposalKey/KeyActiveProposalQueueProposal/g
* numLatestProposals -> Limit
* fixed staking invariant breakage because of gov deposits
* Send deposits to DepositedCoinsAccAddr or BurnedDepositCoinsAccAddr
2018-11-06 23:33:18 -08:00
Christopher Goes 234262160e 'make format' 2018-10-24 15:37:06 +02:00
HaoyangLiu 9ee9e28439 Merge PR #2462: Add swagger-ui for gov, stake and slashing 2018-10-24 15:19:48 +02:00
Alessio Treglia 0f4a03b44e Alessio/server refactor (#2472)
* Add arg to PrintUnsignedStdTx() to actually operate in offline mode
* WIP simplifying server module
* Expose ExternalIP()
* Move {GenTx,Init}Cmd into gaia's new init package
2018-10-10 15:45:41 -07:00
Jae Kwon 1e26ba2e0e
CLIContext.Logger -> .Output as it isn't a logger (#2420)
This changes .Logger to .Output, as it isn't used anywhere except as os.Stdout.
2018-09-28 21:45:54 -07:00
Alessio Treglia a2caefc8ae Merge PR #2390: CLI subcommands reorganization 2018-09-26 22:00:49 +08:00
Alexander Bezobchuk 91cac96fea Merge PR #2391: LCD Cleanup and DRY Refactor 2018-09-26 21:29:39 +08:00
Alexander Bezobchuk 611e287375 Merge PR #2401: Remove remnants of gocyclo 2018-09-25 13:45:04 -04:00
Dev Ojha 6b55093c75 Merge PR #2324: rename wire to codec
* rename wire to codec

* fix formatting and cli

* fix the docs
2018-09-13 14:17:32 -04:00
Jae Kwon 6325441861 txBld -> txBldr 2018-09-07 10:15:49 -07:00
Jae Kwon acd125029d x/auth/client/context -> x/auth/client/txbuilder 2018-09-07 10:04:58 -07:00
Alessio Treglia 54b3b5c028
sed -i 's/txCtx/txBld/g' 2018-09-07 14:39:23 +01:00
Alessio Treglia 3b6da7af18
TxContext -> TxBuilder 2018-09-07 14:36:21 +01:00
Alessio Treglia 89b3ab9e51
Don't skip basic validation 2018-09-04 17:29:33 +02:00
Alessio Treglia 86395809cb
Implement generate-only option for commands that create txs
The new CLI flag builds an unsigned transaction and writes it to STDOUT.
Likewise, REST clients can now append generate_only=true to a request's
query arguments list and expect a JSON response carrying the unsigned
transaction.

Closes: #966
2018-09-04 02:32:05 +02:00
Sunny Aggarwal bfdeb3f8ce works 2018-08-27 15:18:01 -07:00
Sunny Aggarwal 6391611005 asdf 2018-08-24 11:07:53 -07:00