Commit Graph

1049 Commits

Author SHA1 Message Date
atheeshp 2ebf79fa6d
update legacy rest swagger (#9049)
Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
2021-04-06 10:34:36 +00:00
Andrei Ivasko 410d8edb38
Add client config subcommand to CLI (#8953)
* add client config

* addressed reviewers comments

* refactored,ready for review

* fixed linter issues and addressed reviewers comments

* Bump golangci-lint

* fix linter warnings

* fix some tests

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
2021-03-31 12:04:33 +02:00
MD Aleem 03563287f6
fix swagger gen (#9019)
* update swagger config

* run make proto-swagger-gen

Co-authored-by: SaReN <sahithnarahari@gmail.com>
2021-03-29 16:34:54 +00:00
MD Aleem 636e6598b9
fix: grpc-gateway error codes (#9015)
* update grpc query handler

* try fix http response error codes

* add test

* add changelog

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
2021-03-29 13:42:43 +00:00
Robert Zaremba 7568b6680a
Remove bech32 PubKey support (#7477)
* Move PubKey bech32 to legacy package and migrate the usage where possible

* update /server

* wip

* move proto json encoding helper functions to internal

* update internal/marshal

* wip

* update sections which needs legacybech32

* update validators output

* fix conflicts

* slashing update

* add more tests and helper function for ANY JSON serialization

* update slashing

* Update function documentation

* Rename code any-marshal helper functions

* Update pubkey unpacking test

* Update test comments

* solve TestDecodeStore

* solve legacytx issues

* all code compiles

* keyring tests

* keyring cleanup

* remove AssertMsg

* fix some tests

* fix add_ledger_test.go

* update cli tests

* debug cli test

* rename clashed bech32 names

* linter fixes

* update tmservice tests

* linter: update legacy deprecated checks

* fix names

* linting

* legacybech32 pubkey type rename

* fix staking client

* fix test compilation

* fix TestGetCmdQuerySigningInfo

* rename NewIfcJSONAnyMarshaler

* keyring: remove duplicated information from multinfo structure

* todo cleanups

* Update Changelog

* remove some legacybech32 from tests

* remove todos

* remove printlnJSON from /server CLI and amino encoding

* remove protocdc.MarshalJSON

* client/show remove duplicated function

* remove protocdc package

* comment update

* remove legacybech32.MustMarshalPubKey from a test

* add todo

* fix TestPublicKeyUnsafe test

* review update

* fix bech32 UnmarshalPubKey

* Use codec.MarshalIfcJSON

* fix linter issues

* merging conflict: fix codec.Unmarshal calls

* cleanups

* Update CHANGELOG.md

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Reword changelog updates

* use pubkey.String for comparison in Test_runAddCmdLedgerWithCustomCoinType

* Update GetCmdQuerySigningInfo example

* cli: update keys add docs

* Add errors AsOf and errors.ErrIO type

* restore multisigPubKeyInfo structure bring it back to multiInfo struct

* Update codec/proto_codec.go

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>

* Update crypto/keys/ed25519/ed25519_test.go

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>

* Update codec/proto_codec.go

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>

* move pubkey any marshaling tests

* Apply suggestions from code review

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>

* review updates

* adding missing return

* errors: use IsOf instead of AsOf

* keyring: add a correct check for key not found in keyring.Get

* add checkKeyNotFound

* fix linter issues

* fix: keyring key not found check

* fix keyring tests

* fix linting issues

* cli tests

* fix: 'simd keys show <key> -p'

* fix: TestVerifyMultisignature

* rename keyring Bech32... functions to Mk...

* fix RunAddCmd

* Update pubkey display

* wip

* add more tests

* udate keyring output tests

* remove todo from ledger tests

* rename MkKeyOutput

* Changelog update

* solve liner issues

* add link to github issue

Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
2021-03-25 14:53:22 +00:00
Amaury 1fa2c22d8a
Prefer sending tx_bytes to Simulate gRPC endpoint (#8926)
* First run

* Remove dead code

* Make test pass

* Proto gen

* Fix lint

* Add changelog

* Fix tests

* Fix test

* Update x/auth/tx/service.go

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>

* Remove protoTxProvider

* Add grpc-gateway test

* Add comment

* move to api breaking

* lesser diff

* remove conflict

* empty commit to rerun CI

* empty commit to rerun CI

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-03-25 10:52:54 +00:00
MD Aleem a78f777ea8
add reverse iteration to pagination (#8875)
* WIP

* add tests

* add tests

* fix lint

* fix pagination

* add proto message doc

* fix filtered_pagination

* fix test

* cleanup

* add reverse flag to pagination

* changelog

* Update client/flags/flags.go

* Update CHANGELOG.md

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2021-03-23 09:28:20 +00:00
Aksh Gupta 7b1d80e6e4
chore: refactor code quality issues (#8932)
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
2021-03-22 09:30:27 +00:00
Gianguido Sora deaee53111
CLI/keys: define default supported keyring algorithms (#8825)
* define package-level supported Keyring algorithms

This commit lets developer define what algorithms Keyring supports instead of relying on just keyring.New options.

This change is needed since it allows us to support those algorithms in CLI commands too without subverting their current execution flow.

* read dry run cli flag as persistent command flag

* add dry run field to CLI command handling context

* use CLI context keyring instead of creating a new one

* keyring supported algorithms are used as if they were defaults, name them as such

* --dry-run value is now associated to client.context.Simulate

Since Simulate is now used in both tx and query commands, move its reading routine into ReadPersistentCommandFlags.

Removed DryRun from Context, since it's not needed anymore.

* rename supported algorithms variable

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

* remove keyring algorithms global, let user set them via client.Context methods

* remove old keyring globals test

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
2021-03-18 08:27:03 +00:00
Alessio Treglia 3954c244b6
keyring: update documentation (#8839)
* keyring: update documentation

* Update docs/run-node/keyring.md

Co-authored-by: Barrie Byron <barrie.byron@tendermint.com>

* Update docs/run-node/keyring.md

Co-authored-by: Barrie Byron <barrie.byron@tendermint.com>

Co-authored-by: Barrie Byron <barrie.byron@tendermint.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-03-11 15:17:43 +00:00
Alessio Treglia 010eeef457
Rename InfoImporter -> LegacyInfoImporter (#8739)
Avoid namespace clash with the InfoImporter interface
that already exists in the v0.41 release series.
2021-03-01 20:09:01 +00:00
SaReN b1c72fda7f
crypto/keyring: fix offline keys migration (#8639)
Fix `keys migrate` command (#8703)

crypto/keyring: reinstate the InfoImporter interface

InfoImporter is implemented by those Keyring implementations
that support import of Info objects.

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
2021-03-01 12:41:49 +00:00
Segue 92bc2904d3
Fix legacy rest api (#8434) 2021-02-26 08:28:48 +00:00
Federico Kunze cc70749b07
keyring: remove hardcoded default passphrase on NewMnemonic (#8662)
* keyring: remove hardcoded default passphrase on NewMnemonic

* minor changes

* changelog

* address @alessio's comment

* Update CHANGELOG.md

* test fixes

* update comment and test

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-02-23 16:49:09 +00:00
Alessio Treglia f2ee972e31
various linter fixes (#8666) 2021-02-23 08:46:01 +00:00
Riccardo Montagnin f49e1554e6
Deprecate SetFullFundraiserPath in favor of SetPurpose and SetCoinType (#8629)
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2021-02-22 15:14:09 +00:00
MD Aleem 81cc5c1194
gRPC gateway issue with colons in the account url path (#8649)
* add allow_colon_final_segments flag

* add test

* Update x/auth/client/rest/rest_test.go

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-02-22 11:30:45 +00:00
Amaury 73e38e4009
Use service Msgs in CLI tx commands (#8512)
* Use service Msgs in CLI tx commands

* Update comment

* Gracefully support amino signing

* CLI to use svc msg

* Fix lint

* Use fq method name in events

* Update tests

* Fix quering events

* Add docs

* Fix test build

* Fix events

* Fix search for events

* Handle old andd new event quering

* Use merge events

* Better encCfg

* Add page in search

* Fix tests

* Update test and comments

* Update x/auth/legacy/legacytx/stdsign.go

Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>

* Fix conflict for weighted vote

* Make CopyTx actually run

* Fix CopyTx

* Fix test

* Add changelog entry

* Remove useless code

* Add msgs tests

* Remove testing proto Msg via CLI

* Fix lint

* Fix test

* Implement GetSignBytes on ServiceMsg

* Fix %T

Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-02-18 18:00:19 +00:00
MD Aleem d162b29cf4
Add pagination to GetValidatorSetByHeight response (#8567)
* fix pagination

* add test

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-02-15 10:41:39 +00:00
Amaury e306e5b6f5
Make gRPC requests go through tendermint Query (#8549)
* Make gRPC requests go through tendermint Query

* Remove commented code

* Dry run in InitChain?

* Save type of first run

* Add metadata in repsonse

* Factorize some code

* Fix lint

* Update comments

* Fix md test

* Fix test expected

* Don't put RunGRPCQuery as clientCtx method

* Update baseapp/grpcserver.go

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* Address review comments

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
2021-02-15 10:01:44 +00:00
Andrei Ivasko d37c590e90
Limit context background (#8093)
* limit context background

* update

* fixed minor issues

* fixed TestStatusCommand

* Fix keyring import from older versions. (#8436)

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>

* Add changelog (#8490)

* fix: tendermint subcommands should not create missing files (#8481)

If the user specifies an incorrect `--home`, then the old behaviour
would automatically populate it with fresh values, but we should
fail instead.

* limit context background

* update

* fixed minor issues

* fixed TestStatusCommand

* statik.go

* replaced static.go

Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
Co-authored-by: Michael FIG <mfig@agoric.com>
2021-02-03 09:47:25 +00:00
Jonathan Gimeno f9da95ad09
Fix keyring import from older versions. (#8436)
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
2021-02-02 09:59:25 +00:00
atheeshp d97e7907f1
Add fee grant module (#8061)
* Add docs

* Add BasicFeeAllowance implementation

* Add expiration structs and complete basic fee

* Add delegation messages, add validation logic

* Add keeper and helper structs

* Add alias and handler to top level

* Add delegation module

* Add basic querier

* Add types tests

* Add types tests

* More internal test coverage

* Solid internal test coverage

* Expose Querier to top level module

* Add FeeAccount to auth/types, like StdTx, SignDoc

* Fix all tests in x/auth

* All tests pass

* Appease the Golang Linter

* Add fee-account command line flag

* Start on DelegatedDeductFeeDecorator

* Cleanup the Decorator

* Wire up delegation module in simapp

* add basic test for decorator (no delegation)

* Table tests for deduct fees

* Table tests over all conditions of delegated fee decorator

* Build full ante handler stack and test it

* Start genesis

* Implement Genesis

* Rename package delegation to subkeys

* Clarify antes test cases, handle empty account w/o fees

* Allow paying delegated fees with no account

* Pull mempool into delegated ante, for control on StdFee

* Use custom DelegatedTx, DelegatedFee for subkeys

* Revert all changes to x/auth.StdTx

* Appease scopelint

* Register DelegatedTx with codec

* Address PR comments

* Remove unnecessary DelegatedMempoolFeeDecorator

* Cleaned up errors in querier

* Clean up message sign bytes

* Minor PR comments

* Replace GetAllFees... with Iterator variants

* PrepareForExport adjusts grant expiration height

* Panic on de/serialization error in keeper

* Move custom ante handler chain to tests, update docs

* More cleanup

* More doc cleanup

* Renamed subkeys module to fee_grant

* Rename subkeys/delegation to fee grant in all strings

* Modify Msg and Keeper methods to use Grant not Delegate

* Add PeriodicFeeAllowance

* Update aliases

* Cover all accept cases for PeriodicFeeAllowance

* Et tu scopelint?

* Update docs as requested

* Remove error return from GetFeeGrant

* Code cleanup as requested by PR

* Updated all errors to use new sdk/errors package

* Use test suite for keeper tests

* Clean up alias.go file

* Define expected interfaces in exported, rather than importing from account

* Remove dependency on auth/ante

* Improve godoc, Logger

* Cleaned up ExpiresAt

* Improve error reporting with UseGrantedFee

* Enforce period limit subset of basic limit

* Add events

* Rename fee_grant to feegrant

* Ensure KeeperTestSuite actually runs

* Move types/tx to types

* Update alias file, include ante

* I do need nolint in alias.go

* Properly emit events in the handler. Use cosmos-sdk in amino types

* Update godoc

* Linting...

* Update errors

* Update pkg doc and fix ante-handler order

* Merge PR #5782: Migrate x/feegrant to proto

* fix errors

* proto changes

* proto changes

* fix errors

* fix errors

* genesis state changed to proto

* fix keeper tests

* fix test

* fixed tests

* fix tests

* updated expected keepers

* updated ante tests

* lint

* deleted alias.go

* tx updated to proto tx

* remove explicit signmode

* tests

* Added `cli/query.go`

* Added tx.go in cli

* updated `module.go`

* resolve errors in tx.go

* Add fee payer gentx func

* updated tx

* fixed error

* WIP: cli tests

* fix query error

* fix tests

* Unused types and funcs

* fix tests

* rename helper func to create tx

* remove unused

* update tx cfg

* fix cli tests

* added simulations

* Add `decoder.go`

* fix build fail

* added init genesis code

* update tx.go

* fixed LGTM alert

* modified cli

* remove gogoproto extensions

* change acc address type to string

* lint

* fix simulations

* Add gen simulations

* remove legacy querier

* remove legacy code

* add grpc queries tests

* fix simulations

* update module.go

* lint

* register feegrant NewSimulationManager

* fix sims

* fix sims

* add genesis test

* add periodic grant

* updated cmd

* changed times

* updated flags

* removed days as period clock

* added condition for period and exp

* add periodic fee cli tests

* udpated tests

* fix lint

* fix tests

* fix sims

* renaming to `fee_grant`

* review changes

* fix test

* add condition for duplicate grants

* fix tests

* add `genTxWithFeeGranter` in tests

* fix simulation

* one of changes & test fixes

* fix test

* fix lint

* changed package name `feegrant` to `fee_grant`

* review comments

* review changes

* review change

* review changes

* added fee-account in flags

* address review changes

* read fee granter from cli

* updated create account with mnemonic

* Address review comments

* move `simapp/ante` file to `feegrant/ante`

* update keeper logic to create account

* update docs

* fix tests

* update `serviceMsgClientConn` from `msgservice`

* review changes

* add test case for using more fees than allowed

* eliminate panic checks from keeper

* fix lint

* change store keys string to bytes

* fix tests

* review changes

* review changes

* udpate docs

* make spend limit optional

* fix tests

* fix tests

* review changes

* add norace tag

* proto-docs

* add docs

Co-authored-by: Ethan Frey <ethanfrey@users.noreply.github.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: aleem1413 <aleem@vitwit.com>
Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-01-29 19:54:51 +00:00
Marko ce5db9e4bd
fix proto generation (#8361)
* fix proto generation

* merge grpc_gateway into gocosmos_out

* change env variable names
2021-01-18 12:41:34 -03:00
Aaron Craelius 2521964d50
Update gogo proto deps with v1.3.2 security fixes (#8350)
* Update gogo proto deps with v1.3.2 security fixes

* Regenerate proto files
2021-01-15 19:45:34 +00:00
Anil Kumar Kammari 6a9b0caa57
Add grpc gateway missing endpoints to swagger docs (#8232)
* Add missing endpoints

* Fix swagger gen

* update

* Update static.go

* Fix format

* Fix tests
2021-01-01 13:45:09 -03:00
MD Aleem 92317931c2
Fix Unregistered interface types.Evidence (#8221)
* fix Unregistered interface

* add test

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
2020-12-23 04:22:53 +00:00
Amaury a8e58bcfe3
Fix proto-swagger-gen (#8184)
* Fix proto-swagger-gen

* Fix script

* Run script

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
2020-12-21 11:31:18 +00:00
Robert Zaremba b18a033a17
Clean Any interface (#8167)
* Clean Any interface

+ removed Any.Pack method. This method is not needed, because we have specialized
  functions for createing new Any values. It could be used inappropriately with existing
  Any objects.

* removed deprecated PackAny function

* fix linter issue

* update nil handling

* NewAnyWithValue returns error on nil instead of panic

* NewMsgCreateValidator: handle nil pubkey

* Remove AsAny and tx builder workarounds

* fix linter issue

* Add AsAny methods to TxBuilder and StdTxConfig, but keep intoAny interface private

* remove tx.PubKeyToAny

* cosmetic updates

* fix method interface

* move ProtoTxProvider to x/auth/tx
2020-12-18 14:55:25 +00:00
Emmanuel T Odeke 96f89df56b
client: remove redundant/repeated code (#8182)
Follows up PR #4876 which removed the return on non-nil errors
to always return a non-nil REST response regardless of error.
The checks performed seem benign and the return result is the
same.
This change uses the reverse conditional refactoring method
to gut out nesting and many conditions.
Noticed while hunting through types.ParseABCILogs.

Fixes #8181
2020-12-17 09:30:28 +00:00
Robert Zaremba a3ae6e3704
Combine client.ReadTxCommandFlags with GetClientContextFromCmd (#8155)
* Update codebase to simplify clientCtx loading from cmd

* make ReadTxCommandFlags and ReadQueryCommandFlags private

* fix build error

* fix conflicts
2020-12-14 22:09:51 +00:00
Robert Zaremba 3a9e696bbf
fix: Signature only flag bug on tx sign command 7632 (#8106)
* fix: Signature only flag bug on tx sign command 7632

* Update client/context.go

Co-authored-by: Cory <cjlevinson@gmail.com>

* Update client/context.go

Co-authored-by: Cory <cjlevinson@gmail.com>

* use named return value and closure (#8111)

This is to correctly handle deferred Close()
calls on writable files.

* set the right 'append' logic for signing transactions

* cleanup

* update tx.Sign interface by adding overwrite option

* Update Changelog

* sign command cleanup

* implementation and changelog update

* fix SignTx and tx.Sign calls

* fix: sign didn't write to a file

* update flags description

* Add tx.Sign tests

* fix grpc/server_test.go

* Update client/tx/tx.go

Co-authored-by: Cory <cjlevinson@gmail.com>

* changelog update

* Add test to verify matching signatures

* cli_test: add integration tests for sign CMD

* add output-file flag test

* add flagAmino test

* Update x/auth/client/cli/tx_sign.go

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

* Update x/auth/client/cli/tx_sign.go

* update amino serialization test

* TestSign: adding unit test for signing with different modes

* Add test with Multi Signers into Robert's TxSign PR (#8142)

* Add test with Multi Signers

* remove true false

* Use SIGN_MODE_DIRECT

* Fix litn

* Use correct pubkeys

* Correct accNum and seq

* Use amino

* cleanups

* client.Sign: raise error when signing tx with multiple signers in Direct

+ added more unit tests

* add more tests

* Update client/tx/tx_test.go

Co-authored-by: Cory <cjlevinson@gmail.com>

* fix TestGetBroadcastCommand_WithoutOfflineFlag

* Any.UnsafeSetCachedValue

* fix note packed messages in tx builder

* reorder unit tests

* Changelog update

* cleaning / linting

* cli_tes: copy validator object instead of modifying it's shared codec

* x/auth cli_test: remove custom codec creation in tests

* Update CHANGELOG.md

* updates to CHANGELOG.md

* remove unused method

* add new instance of transaction builder for TestSign

Co-authored-by: Cory <cjlevinson@gmail.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
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-12-14 21:44:15 +00:00
Amaury bce5da0e84
Use SignModeLegacyAminoJSON when signer is ledger key (#8136)
* Use SignModeLegacyAminoJSON when signer is ledger key

* Fix tests

* Fix lint

* Fix tests

* Add warning message

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-12-11 13:54:50 +00:00
Robert Zaremba fe41718047
Robert/api clientctx (#8107)
* rename clientCtx.PrintOutput to PrintObject

* rename clientCtx.PrintOutputLegacy to PrintObjectLegacy

* Changelog update

* Rename PrintObject to PrintProto
2020-12-08 20:17:40 +00:00
MD Aleem d4a919b714
change TmService's validator pubkey type to any (#8060)
* change validator pubkey type to any

* add test for vslidator pubkey

* change address to string

Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
2020-12-07 13:51:38 +00:00
Aleksandr Bezobchuk 5291a8ff31
Refactor Logging using Zerolog (#8072)
* init commit

* server: use flags

* server: godoc++

* updates

* baseapp: update logging

* logging updates

* x/bank: update logging

* logging updates

* lint++

* logging updates

* logging updates

* logging updates

* logging updates

* cl++
2020-12-03 23:17:21 +00:00
MD Aleem b6c8d5ea9f
Add tx broadcast gRPC endpoint (#7852)
* WIP tx/broadcast grpc endpoint

* fix lint

* fix proto lint

* Update service.proto

* resolve conflicts

* update service.proto

* Update service.proto

* review changes

* proto lint

* Switch to txraw

* Add check breaking at the end

* Fix broadcast

* Send Msg on SetupSuite

* Remove proto-check-breaking

* 1 validator in test

* Add grpc server tests for broadcast

* Fix grpc server tests

* Add some changes

* Add ress comments

* Add table tests for tx service

* Add test for mode

* Add simulate tests

* Add build flag back

* Revert custom stringer for enum

* Remove stray logs

* Use /txs/{hash}

Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2020-12-02 17:50:40 +00:00
Alessio Treglia 513dabaec8
client/keys: support export of unarmored private key (#8043)
The --unarmored-hex and --unsafe flags are added to
the keys export command. Users must use both to
export private keys material. The output would be in
hexadecimal format and unarmored.

See #8042 for scope and motivations.

introduce new UnsafeKeyring interface.

Unsafe operations are supported by UnsafeKeyring types.
By doing so, we try to make the client developer aware
of the risks.

Co-authored-by: Sunny Aggarwal <sunnya97@protonmail.ch>
2020-11-30 20:55:39 +00:00
Amaury 7ad2aab2c4
Add panic handler on queries (#8039)
* Add test that panics

* Add panic in abci query

* Move proto gen files to correct place

* Add panic handler in grpc server

* Fix test

* Fix build

* Use %v

* Better panic message

* Fix tests

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2020-11-30 16:59:35 +00:00
MD Aleem c58a8923a0
gRPC-gateway routes as alternative to legacy tendermint REST endpoints (#7965)
* WIP

* WIP setup

* WIP setup testsuite

* add node_info

* add GetLatestBlock,GetBlockByHeight grpc endpoints

* add GetValidatorSetByHeight, GetLatestValidatorSet

* fix lint

* fix tests

* proto format

* Update Makefile

* review changes

* Makefile format

* handle nil pagination

* rename query.go to service.go

* format Makefile

* format Makefile

* review changes

* review changes

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-11-25 15:58:11 +00:00
Amaury 12a02b98a5
CopyTx also copies timeoutHeight (#8015)
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-11-24 17:09:30 +00:00
Aditya c15884a204
Rename Version to Revision in IBC Height (#8020)
* rename Version to Revision in ibc Height

* lint

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-11-24 15:38:24 +00:00
Amaury 13bc504bec
docs: Add REST endpoints migration guide (#8011)
* Add REST endpoints migration guide

* add bank, distrib, evidence

* Add slashing, mint

* Add staking

* Add query

* Add todo

* Typos

* Add link to interact node

* grammar

* Better wording

* Update docs/migrations/rest.md

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* Update docs/migrations/rest.md

* Add footnote

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
2020-11-24 14:34:20 +00:00
Aditya def3c5ba71
Add ConsensusState to IBC Upgrades (#7919)
* upgrade progress

* fix build minus cli

* write state at block before upgrade height

* refix build

* Apply suggestions from code review

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

* fix upgrade and start with tests

* fix tendermint tests

* add tests and remove unnecessary relayer options on upgradedClient

* fix all tests except weird msg panic

* add invalid final client test and codec stuff

* fix everything but msg issue

* remove problematic test for now

* safer self validation

* upgrade fixes

* proto-linting

* remove unnecessary last height

* add timestamp to committed upgrade consensus state

* address final nits

* address nit

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-11-24 11:45:33 +00:00
Amaury 74435137e9
Show height on legacy REST endpoints (#7997)
* Fix showing height in rest endpoints

* Fix query height

* Manually inject req.Height

* Small tweaks

* Use withHeight

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-11-24 10:28:12 +00:00
Amaury 35183a37e6
Fix StatusCommand (#7974)
Co-authored-by: SaReN <sahithnarahari@gmail.com>
2020-11-18 21:44:13 +00:00
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
Alessio Treglia 2802529eeb
prune testdata (#7937)
Remove cruft leftover.
2020-11-14 14:44:07 +00:00
Amaury a8ef4a380d
All Makefile proto commands use Docker (#7931)
* Update tooling around docker

* Run commands

* Remove swagger gen for now

* Update proto-gen-any

* Fix indentn

* Use CURDIR

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-11-13 16:36:58 +00:00
Federico Kunze bcdd6ee15c
ibc: fix grpc gateway routes (#7881) 2020-11-10 17:50:53 +00:00