Commit Graph

48 Commits

Author SHA1 Message Date
yihuang 54201d11e6
cli: convert coins to smallest unit registered (#7777)
* cli: convert coins to smallest unit registered

fixes: #7623

- test order of decimal operations
- support both int and decimal coins, truncate when normalizing to
  base unit

* Update types/coin_test.go

* Update types/coin_test.go

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Amaury <amaury.martiny@protonmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-11-16 11:34:54 +00:00
Marie Gauthier 90e9370bd8
Replace tmcrypto.PubKey by our own cryptotypes.PubKey (#7419)
* WIP on removing tm pub/privkey

* Fix part of crypto tests

* Add PrivKeyLedgerSecp256K1 proto type

* Use BasePrivKey for ledger priv key type

* Refacto continued

* First round

* x/staking

* Continue porting

* x/* done

* Make build pass

* More conversion

* Remove IntoTmPubKey

* Fix test

* Remove crypto.PubKey in some other places

* Revert ledger changes

* Fix comment

* Remove useless function

* Add To/FromTmPublicKey

* Add migrate tests

* Fix test

* Fix another test

* Rename tm conversion functions

* Less code

* Rename BasePrivKey to LedgerPrivKey

* Add changelog

* Rename functions

Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-11-09 16:01:43 +00:00
Robert Zaremba 9bd42ace6b
simapp: rename MakeEncodingConfig to MakeTestEncodingConfig (#7681)
* simapp: rename MakeEncodingConfig to MakeTestEncodingConfig

* Updating the Changelog

+ Adding DEPRECATED attribute.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-27 11:33:48 +00:00
Anil Kumar Kammari 64b6bb5270
rename RegisterCodec to RegisterLegacyAminoCodec (#7243)
* rename RegisterCodec to RegisterLegacyAminoCodec

* Add changelog

* gofmt

* rename codec.New() to codec.NewLegacyAmino()

* Add change log

* Update CHANGELOG.md

Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>

* Fix

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
2020-09-07 14:47:12 +00:00
SaReN 23a9f46aad
Update tm pubkey references (#7102)
* Update pubkey references

* Update ledger_mock

* Migrate encoding from tm

* Update pubkey prefix

* revert ed25519 to tendermint key

* random account revert

* Revert ed25519 references

* revert secp key name

* test revert

* remove ed25519

* Update x/staking/types/validator.go

Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>

* Revert "remove ed25519"

This reverts commit 66d2e1d061aeae81c4c0a3daf718536b09dda19e.

* remove ed25519 & sr25519

* Apply suggestions from code review

* remove codec

Co-authored-by: Marko Baricevic <marbar3778@yahoo.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
2020-08-28 16:02:38 +00:00
Marie 7f59723d88
Make JSONMarshaler methods require proto.Message (#7054)
* Make JSONMarshaler require proto.Message

* Use &msg with MarshalJSON

* Use *LegacyAmino in queriers instead of JSONMarshaler

* Revert ABCIMessageLogs String() and coins tests

* Use LegacyAmino in client/debug and fix subspace tests

* Use LegacyAmino in all legacy queriers and adapt simulation

* Make AminoCodec implement Marshaler and some godoc fixes

* Test fixes

* Remove unrelevant comment

* Use TxConfig.TxJSONEncoder

* Use encoding/json in genutil cli migrate/validate genesis cmds

* Address simulation related comments

* Use JSONMarshaler in cli tests

* Use proto.Message as respType in cli tests

* Use tmjson for tm GenesisDoc

* Update types/module/simulation.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* Update types/module/module_test.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* Add godoc comments

* Remove unused InsertKeyJSON

* Fix tests

Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-08-26 09:39:38 +00:00
Aaron Craelius 816c5a37bd
Enable proto JSON generally and remove HybridCodec (#6859)
* Remove HybridCodec

* WIP on fixing proto JSON issues

* WIP on fixing proto JSON issues

* WIP on fixing proto JSON issues

* WIP on fixing proto JSON issues

* WIP on fixing proto JSON issues

* Test fixes

* Delete hybrid_codec.go

* Fixes

* Fixes

* Fixes

* Test fixes

* Test fixes

* Test fixes

* Lint

* Sim fixes

* Sim fixes

* Revert

* Remove vesting account JSON tests

* Update CHANGELOG.md

* Lint

* Sim fixes

* Sim fixes

* Docs

* Migrate more amino usages

* Remove custom VoteOption String() and json marshaling

* Fix tests

* Add comments, update CHANGELOG.md

Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-08-13 13:20:02 +00:00
dauTT 20c80cfd44
Rename *codec.Codec to *codec.LegacyAmino (#6991)
* Rename *codec.Codec to *codec.LegacyAmino

* Implement requested changes

Co-authored-by: Aaron Craelius <aaron@regen.network>
2020-08-10 19:41:21 +00:00
Alexander Bezobchuk 9ae17669d6
Tx Height Timeout (#6089)
* Implement TxHeightTimeoutDecorator

* Update error message

* rename type

* set height timeout

* update tests

* update *SignDoc)

* rename

* remove dup

* fix build

* cli updates

* rest updates

* cl++

* Update x/auth/ante/basic.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* Update x/auth/ante/basic.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* Update x/auth/ante/basic.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* Update x/auth/ante/basic.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* rename

* rename

* remove TimeoutHeight from SignDoc

* updates

* fix tests

* update IBC cmd flags

* use omitempty

* update godoc

* add test case to TestStdSignBytes

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.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-08-07 23:32:22 +00:00
SaReN 95cf3c95a6
Remove old tx code from rest (#6939)
* Cleanup rest txs

* Remove nolint

* Update x/ibc to use WriteGeneratedTxResponse

* Update marshaler usages

* Fix PostProcessResponse test

* Update PostProcessResponse
2020-08-05 18:08:13 +00:00
Alexander Bezobchuk 515b25b94e
Context: Remove Init/New (#6797)
* init commit

* remove new/init functions

* update CLI commands

* tests: fix TestCLIQueryConn

* remove viper
2020-07-20 16:42:46 +00:00
Jonathan Gimeno 8f96ec0585
REST bank transfers fail due to encoding. (#6536)
Bank module REST endpoint bank/accounts/{addr}/transfers
was returning invalid StdTx format.
2020-07-02 05:16:39 +02:00
Alexander Bezobchuk d5049413ef
Merge PR #6525: x/bank: Refactor CLI & Tests 2020-06-30 16:59:21 -04:00
Alexander Bezobchuk 9bf3ff75f5
Merge PR #6489: Test Network Testing Framework 2020-06-26 12:30:49 -04:00
Aaron Craelius 81d647e505
Move codec.RegisterCrypto and codec.Cdc to new packages (#6330)
* Move codec.Cdc to legacy_global.Cdc

* Update CHANGELOG.md

* Updates

* nit

* Fix imports

* Updates

* Use cosmos multisig instead of tendermint multisig everywhere

* Fix tests

* Rename legacy_global -> legacy

* Add doc.go

* Linting, move all RegisterCrypto calls to crypto/codec

* Update crypto/codec/amino.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-06-04 10:38:24 +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
Alessio Treglia 2879c0702c
x/ibc: fix missing return statement (#6099)
* enable the wsl linter

Fix various wsl-related warnings.

x/ibc/04-channel/keeper/handshake.go: fix missing return statement in ChanOpenTry().

* goimports -w files

* remove unknown linter references

* run make format

* Revert "run make format"

This reverts commit f810b62b9e4993f08506663d4e5f2ec2228a9863.

* run make format
2020-04-29 22:36:34 -04:00
Alessio Treglia aeee097b2f
spring cleanup (#5991)
* Make format

* Fix golangci-lint warnings

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-04-14 19:13:15 +00:00
Alessio Treglia e8cedf243f
fix all bits broken by viper API changes (#5982)
github.com/spf13/viper's recent releases introduced a semantic
change in some public API such as viper.IsSet(), which have
broken some of our flags checks. Instead of checking whether
users have changed a flag's default value we should rely on such
defaults and adjust runtime behaviour accordingly. In order to do
so, it's important that we pick sane defaults for all our flags.

The --pruning flag and configuration option now allow for a
fake custom strategy. When users elect custom, then the
pruning-{keep,snapshot}-every options are interpreted and
parsed; else they're ignored.
Zero is pruning-{keep,snapshot}-every default value. When
users choose to set a custom pruning strategy they are
signalling that they want more fine-grainted control, therefore
it's legitimate to expect them to know what they are doing and
enter valid values for both options.

Ref #5964
2020-04-14 17:24:27 +02:00
Alessio Treglia ca19fbc5f8
types/rest: add convenience functions for error checking (#5900) 2020-04-01 09:50:22 +02:00
Aleksandr Bezobchuk 6135912e53
JSON Proto changes 2020-03-26 12:46:10 -04:00
Aleksandr Bezobchuk 2978de90e1
Fix MarshalIndentFromJSON 2020-03-25 15:59:29 -04:00
Aleksandr Bezobchuk 3e0cf99e81
Finish remaining x/bank REST handlers 2020-03-25 14:23:34 -04:00
Aleksandr Bezobchuk 17b68fb365
Prep PostProcessResponseBare and PostProcessResponse 2020-03-25 13:20:29 -04:00
Alessio Treglia 3db39cda3c
Fix various linter warnings (#5824) 2020-03-18 12:59:08 +00:00
Alessio Treglia 2de4775a25
types/rest: add unit tests (#5779)
* types/rest: add unit tests

Drop unused functions:
- ParseQueryParamBool()
- ParseInt64OrReturnBadRequest()

* Fix test

* Disable parallelism

* Reintroduce @fedekunze ParseQueryParamBool

* Don't count Name() calls to fix flaky tests
2020-03-10 18:53:25 +00:00
Alessio Treglia 8a74dcafb5
Merge PR #5656: Make golangci-lint happy again 2020-02-17 17:30:18 +01:00
Alexander Bezobchuk 9b3296be79
Merge PR #5655: Fix TestParseHTTPArgs 2020-02-17 14:46:48 +01:00
Gerry Agbobada 235aa6c091
Merge PR #5648: Add min-height and max-height filters to TxSearch 2020-02-17 04:17:34 -05:00
Federico Kunze 5a0a36a8c9
Merge Pr #5585: client and types additions for IBC 2020-01-30 10:13:42 -05:00
Marko b9490f2d93 Merge PR #5203: Add more linters 2019-10-17 09:47:35 -04:00
Marko 6684cdf3e5 Merge PR #5048: Fix linters and add golint 2019-09-16 13:11:17 -04:00
Marko 3a4f1fc4d4 Merge PR #4881: Linting Galore 2019-08-19 12:06:27 -04:00
Alexander Bezobchuk 4b354a782b
Merge PR #4840: Various Updates for Gaia 2019-08-03 09:56:15 -04:00
Alexander Bezobchuk 451535bd79
Merge PR #4837: Cleanup node_info Endpoint 2019-08-02 11:52:55 -04:00
Jack Zampolin 0ba74bb4b7 Merge PR #4777: Fix Height Queries 2019-07-25 17:45:13 -07:00
colin axner 8d8fd9df1a generalize query response with height (#4573)
Addition to #4536, no longer specific to account queries.
Allows for validator endpoints to return height in the response.

Closes: #4609
2019-07-01 17:48:13 +01:00
Alessio Treglia 97d10210be Merge PR #4510: Negative height paramter's value leads to undefined behavior 2019-06-07 14:11:50 -04:00
colin axner c777fb9108 Merge PR #4505: Support height queries in REST client 2019-06-07 09:02:07 -04:00
Alexander Bezobchuk 3180e68c7b
Merge PR #4499: Remove Client Codec Redundancy 2019-06-06 11:43:15 -04:00
Alexander Bezobchuk 925070ae38
Merge PR #4292: Fix Signing Infos Endpoint 2019-05-09 13:38:15 -04:00
Alessio Treglia 85021d4ca9
No packages must depend on cmd/gaia/ (#4048)
Preparation work for moving gaia out of the SDK.
2019-04-04 15:36:39 +01:00
Karoly Albert Szabo 5bb6090e38 Add route for querying signing_info for all validators (#3952)
Also remove duplicate pagination:
- move function to extract query params into types/rest
- adjust pagination values locally until available in tendermint for validators

Code cleanup:
- helper function in test
- fix pagination description in swagger.yaml
- uint instead of int when possible

Closes: #3226
Closes: #3991
2019-03-28 18:43:33 +00:00
Alexander Bezobchuk 0611d2eda2 Merge PR #3688: JSON Decode Log in REST Client 2019-02-22 12:54:31 +01:00
Alexander Bezobchuk 992dc8b2dc Merge PR #3691: Minor Error Message Cleanup
* cleanup error messages

* Add pending log entry

* Rename Message to Error in ErrorResponse
2019-02-21 03:49:57 -05:00
Alexander Bezobchuk e39debd359 Merge PR #3674: Remove password/keybase from REST Client 2019-02-19 10:15:39 -08:00
Alessio Treglia 1aa6c197ff Merge PR #3580: Code cleanup of client types 2019-02-14 08:53:36 -08:00