Commit Graph

184 Commits

Author SHA1 Message Date
colin axnér 4d9c32f44f
Remove UNINITIALIZED usage from connection and channel (#7297)
* remove UNINITALIZED connection state

* remove uninit channel state

* add back uninitalized def in proto file

* fix typo

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-09-14 21:41:23 +00:00
colin axnér 813be217e3
Remove GetHeight from ConsensusState (#7274)
* remove height from tm consensus state

* various updates to removing dep on GetHeight

* inital addition of wrapper around consensus state with height

* fix tests

* remove GetHeight interface func

* wip test

* add test

* apply @AdityaSripal comments

* apply @fedekunze suggestions

Co-authored-by: Aditya <adityasripal@gmail.com>
2020-09-14 18:16:42 +00:00
SaReN b2348180b8
Migrate {x/auth, x/gov, x/staking} missing CLI queries to proto (#6994)
* Fix error code

* Fix decoder

* Fix typo

* Fix decode

* refactor

* Migrate SearchTxsResult to proto

* fix MarkEventsToIndex

* lint++

* Fix output

* Add QueryTxCmd cli test

* Add fmt

* Put txBuilder in types/tx

* Add GetAnyTx in TxBuilder

* Add new IsAnyTx

* Rename to IntoAny

* Fix bug

* fmt

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

* Fix ibc CLI to use proto

* Fix any MarshalJSON

* Fix test

* Make tx.Tx implement sdk.Tx

* Register sdk.Tx

* Fix lint

* Allow DefaultJSONTxEncoder to take tx.Tx

* refactor

* Rename variable

* remove fmt

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Marie <marie.gauthier63@gmail.com>
2020-09-10 18:26:47 +00:00
colin axnér ec74416276
x/ibc: move solo machine sequence to client state (#7271)
* update proto

* move solo machine sequence to client state

Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-09-09 12:14:11 -03:00
colin axnér b4f146b62d
Add standard acknowledgement to channels and apply usage in ibc transfer (#7263)
* gen ack proto type

* remove transfer ack

* change ics20 ack to use standard type

* update commented tests

* small typo fix

* revert back to module cdc

* update docs

* fix lint

* nit

* update ack event emission

* Update x/ibc-transfer/spec/01_concepts.md

* add comment for onacknowledgement

* Update proto/ibc/channel/channel.proto

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-09-09 10:01:28 +00:00
Anil Kumar Kammari a9547b54ff
Add proto formatting tool (#7266)
* Add proto format option

* Add clang format options

* Fix proto format

* Fix fmt

* Fix SpacesInSquareBrackets to match with SpacesInSquareBrackets setting
2020-09-08 22:06:54 +00:00
Alexander Bezobchuk 325be6ff21
Merge PR #7209: Create Vesting Account Message 2020-09-08 09:09:50 -07:00
Erik Grinaker 4faeefebd2
Add state sync support (#7166)
* Add state sync support

* fix incorrect test tempdir

* proto: move and update Protobuf schemas

* proto: lint fixes

* comment tweaks

* don't use type aliasing

* don't call .Error() when logging errors

* use create terminology instead of take for snapshots

* reuse chunk hasher

* simplify key encoding code

* track chunk index in Manager

* add restoreDone message for Manager

* add a ready channel to Snapshotter.Restore()

* add comment on streaming IO API

* use sdkerrors for error handling

* fix incorrect error

* tweak changelog

* syntax fix

* update test code after merge
2020-09-08 09:05:44 +00:00
Anil Kumar Kammari ebfb616d88
Migrate missing `x/distribution` CLI queries to proto (#7244)
* migrate CommunityPoolSpendProposalJSON to proto

* migrate NewWithdrawAllRewardsCmd to proto

* fix ineffectual issue

* refactor

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-09-07 13:14:00 +00:00
Federico Kunze 2f25c9a0d8
x/ibc: solo machine signature format (#7237)
* x/ibc: solo machine signature format

* update tests and verification

* diversifier updates

* update tests

* fix lint

* Update x/ibc/light-clients/solomachine/types/header_test.go

Co-authored-by: Aditya <adityasripal@gmail.com>

* Apply suggestions from code review

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

* update test

* misbehaviour sign bytes

* consensus state tests

* fix tests

* more fixes

Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-09-07 12:46:48 +00:00
dauTT b52ffa08e1
Implement ADR 026 (#7029)
* Add allow_governance_override_after_expiry flag to tendermint NewCreateClientCmd

* 1) Add LatestTimestamp to ClientState struct by adding a new attribute latest_timestamp to the message ClientState in proto/ibc/tendermint/tendermint.proto
2) Autogenerate x/ibc/07-tendermint/types/tendermint.pb.go by running 'make proto-gen'. Strangely, as a side effect x/distribution/types/genesis.pb.go, x/evidence/types/genesis.pb.go were also modified by the command 'make proto-gen'
3) Add Expired() function

* Fix tests

* 1) Add allow_governance_override_after_expiry flag to tendemint clientStatus
2) Add allow_governance_override_after_misbehaviour flag to tendermint ClientStatus

* Cosmetic changes

* Fix tests

* Add Unfreeze function

* Add new ClientUpdateProposal type

* Add minor fixes

* Add NewClientUpdateProposalHandler unit tests

* Fix proto-lint-docker

* Delete x/ibc/07-tendermint/tendermint_test.go

* Follow convention to put signer last in msg function signature

* 1) Add GetLatestTimestamp function  to ClientStatus interface
2) Change Expired() signature to Expired(now time.Time)

* 1) Add override flag to UpdateClient function
2) Fix tests

* Refactor HandleClientUpdateProposal

* 1) Extend exported Header interface with MarshalBinaryBare and UnmarshalBinaryBare methods
2) Move ClientUpdateProposal message to from ibc.proto to client.proto
3) Refactoring code
4) Add override flag to UpdateClient method
5) Fix tests

* 1) Uncomment tests and clean up code
2) Add basic validation of the header (ValidateBasic) when the override flag is true

* Cosmetic changes

* Add TODO comments

* Fix header MarshalBinaryBare, UnmarshalBinaryBare by using protobuf encoding/decoding

* Fix proto comments

* Fix override logic

* undo gettimestamp for solo machine and localhost

* add update after proposal func, some major refactoring in progress, various issues addressed

* fix tendermint proposal update handling

* run make proto-gen

* remove timestamp from tendemint client

* fix build issue for tm types

* apply various review comments

* add tests for 02-client functionality

* self review fixes

* typo

* update tests slightly

* update tendermint proposal handling tests

* Update x/ibc/02-client/keeper/proposal.go

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

* Update x/ibc/07-tendermint/types/proposal_handle.go

Co-authored-by: Aditya <adityasripal@gmail.com>

* Update x/ibc/07-tendermint/types/proposal_handle.go

Co-authored-by: Aditya <adityasripal@gmail.com>

* apply most of @fedekunze and some of @AdityaSripal suggestions

* convert test to bools

* update docs and increase code cov

* fix build

* fix typo, remove omitempty

* add switch

* apply @fedekunze latest suggestions

* fix lint

* Update x/ibc/02-client/keeper/proposal_test.go

Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Colin Axner <colinaxner@berkeley.edu>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-09-04 20:59:22 +00:00
Aditya 4f9e31ea21
x/ibc: implement Height interface (#7211)
* change interfaces

* fix tendermint client interfaces

* fix other clients interfaces

* fix queries

* fix tendermint build

* fix builds of clients

* fix 02-build

* start fixing connection and make queries non-nullable

* fix connection keepers and queries

* fix connection build

* fix channel build

* fix all non-test files

* fix testing build

* cleanup

* lint

* fix timeout height interface

* fix tendermint tests

* fix rest of clients

* fix connection tests

* fix client tests

* fix channel tests

* fix all ibc tests

* fix transfer tests:

* docs

* fix connection query

* Apply suggestions from code review

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

* wrap-up review

Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com>
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-09-03 16:23:20 -04:00
colin axnér d7175e12c2
remove old client messages (#7218) 2020-09-01 12:38:40 -04:00
Federico Kunze 0fffaf589b
ibc: modular client messages (#7160)
* ibc: modular client messages

* more updates

* remove client messages

* fixes

* fix tests

* lint

* Apply suggestions from code review

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

* codec.go tests

* cleanup exported

* MsgCreateClient test

* msg tests

* Apply suggestions from code review

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

* fix tests

* proto files update

* errors

* address comments

* spec changes

* add sanity check test cases

* add additional sanity check

* fix expPass

* fix build and remove unnecessary test since validatebasic is checked in the msg

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Aditya Sripal <adityasripal@gmail.com>
Co-authored-by: Colin Axner <colinaxner@berkeley.edu>
2020-09-01 10:40:31 +00:00
Aditya 1c9158b746
quick fix (#7212) 2020-09-01 08:00:36 +00:00
Aditya d208d2bed8
Make clients use proto Height (#7184)
* start using Height in TM client

* fix client tests

* fix client tests

* fix connection tests

* fix rest of tests

* Apply suggestions from code review

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

* fix simple issues

* add and use LTE and GTE methods

* remove TM-specific height semantics from 02-client

* fix lint and build

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-08-31 17:57:08 +00:00
Aditya 5ee4fad501
Remove Evidence handler from IBC (#7196)
* fix builds

* fix tests

* lint

* Update x/ibc/02-client/handler.go

* Update x/ibc/handler.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-29 14:20:48 +00:00
Aditya 9fc0dbbe05
Rename Evidence to Misbehaviour in IBC (#7151)
* rename Evidence to Misbehaviour in IBC code

* tidy go.sum

* remove more references to evidence

* Apply suggestions from code review

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

* Update x/ibc/07-tendermint/client/cli/tx.go

* nit and doc

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-08-26 17:51:13 +00:00
colin axnér 1f7a2787aa
Final IBC migration and Amino removal (#7157)
* migrate tm messages and change header/evidence to pointers

* remove amino

* add nil checks and test for pointer changes

* fix format
2020-08-25 10:17:38 -04:00
colin axnér d52c17bb74
migrate tm evidence to proto (#7145)
* migrate tm evidence to proto

* Update proto/ibc/tendermint/tendermint.proto

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-08-24 21:12:47 +00:00
Amaury Martiny 3d969a1ffd
Implement gRPC Simulate endpoint (#7035)
* Implement simulate endpoint

* Add GetProtoTx()

* Add signing in test

* Add txBuilderFromProto

* Remove stray println

* Update to master

* Merge master

* Fix tests

* Make tests pass

* Integrate in router

* Make proto-gen

* Fix lint

* Really fix lint

* Refactor to fix import cycles

* Rename builder -> wrapper

* Update proto/cosmos/base/reflection/v1beta1/reflection.proto

* Fix after merge

* t->w

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-08-24 14:41:08 +00:00
colin axnér 46927c31cf
implement solo machine client (#6267)
* pause work until client refactor resolved

* continued scaffolding

* add msgs and evidence

* add update and misbehaviour functionality

* implement cli

* various types compile issues

* add sig proof and various bug fixes

* added rest routes

* verification funcs now update sequence number

* add sm suite and header test

* msgcreateclient and msgupdateclient tests

* add basic evidence test

* evidence validate basic test

* consensus state tests

* rm accidental file

* add verify con state and channel state, pause work for counterparty commitment type

* client state tests added

* update clienttype numbers

* update test added

* add misbehaviour tests

* update alias

* update cli tx

* update import alias

* cleanup code

* remove todo, tested by evidence tests

* add info to err msg

* wrapf

* Update x/ibc/06-solomachine/client/cli/tx.go

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

* Update x/ibc/06-solomachine/client/cli/tx.go

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

* Update x/ibc/06-solomachine/client/cli/tx.go

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

* Update x/ibc/06-solomachine/client/cli/tx.go

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

* Update x/ibc/06-solomachine/update.go

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

* Update x/ibc/23-commitment/types/signature.go

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

* Update x/ibc/06-solomachine/types/header.go

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

* apply most of the review suggestions from @fedekunze

* remove alias.go

* update cli context with master changes

* merge selective downstream changes from colin/solomachine

* fix build issues

* remove signature proof

* try to migrate to proto

* rm go structs for consensus state and header

* address @fedekunze review and continue proto migration

* fix proto issues

* fix compile bugs in types, proto panics on getpubkey currently

* add timestamp

* update pubkey to be type sdkcrypto.PublicKey

* update timestamp handling

* begin removing amino, migrate to proto

* fix various build issues

* fix most test in types

* change sanitize to produce, fix bug, types test passing

* begin updating cli

* move solomachine into light-clients/

* fix merge issue

* update proto and fix cli

* more fixes and update proto again

* update pubkey to be any

* fix string func issue

* update tests to use testing pkg

* update from tm crypto keys ref to sdk

* fix tests 🎉

* increase codecov

* address TODOs

* address most of @fedekunze comments

* add test case for misbehaviour frozen client

* fix lint

* fix proto lint?

* rename Signature to TimestampedSignature

* remove chainID

* rename FrozenHeight to FrozenSequence

* apply verify consensus state changes requested by @AdityaSripal

* remove dup check

* fix typo in proto file comment

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 10:06:48 +00:00
Amaury Martiny 50bab8f820
Put AccountSequence in SignerInfo (#6997)
* WIP test the grounds

* Update ADR020

* Fix compile errors

* Fix ADR

* Make ante tests pass

* Fix remaining ante handler tests

* Simplify code

* Fix x/bank app_test

* Fix tests

* Remove useless accSeq from signerdata

* Fix test

* Update simapp/helpers/test_helpers.go

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

* Update simapp/helpers/test_helpers.go

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

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

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

* Address rewview

* Update x/auth/ante/sigverify.go

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>

* Update x/auth/ante/sigverify_test.go

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>

* Update x/auth/tx/builder_test.go

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>

* Update x/auth/tx/builder_test.go

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>

* Update x/auth/tx/direct_test.go

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>

* Update x/auth/tx/builder_test.go

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>

* AccSeq -> Seq

* Address reviews

* Better variable naming

* Fix variable assign

* Remove old SetSignerInfo

* Fix test

* proto-gen

* Make proto-gen

* Reput gw comment

* Add Changelog

* Update x/bank/app_test.go

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

* Update x/bank/app_test.go

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

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
2020-08-21 14:20:47 +00:00
Aditya 97df8b605c
Verify Client on Connection Handshake (#7057)
* verify client state

* add client state to msgs and retrieve in handler

* fix connection msgs

* fixed handshake tests

* fix tests

* fix sim tests

* revert pb edit

* add ValidateClient tests

* Apply suggestions from code review

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

* fix tests

* fixed msgs test

* use ibctesting for client state consts

* Apply suggestions from code review

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

* address rest of comments

* rename to ValidateSelfClient and update spec

* lint

* Update x/ibc/02-client/keeper/keeper_test.go

* Update x/ibc/02-client/keeper/keeper_test.go

* complete rest of review

* improve cov

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-08-20 22:05:41 +00:00
colin axnér be0cc63808
Migrate IBC tendermint header to proto (#7120)
* gen header proto file

* fix tm type to proto conversion issues

* fix tendermint type tests

* fix remaining tests

* fix lint

* Update x/ibc/07-tendermint/types/header.go

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

* Update x/ibc/07-tendermint/types/header.go

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

* apply @fedekunze review suggestions

* fix build

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-08-20 11:46:11 -04:00
Federico Kunze 3368dae5f5
x/ibc: final gRPC migration (#7077)
* x/ibc: final gRPC migration

* grpc test

* query client consensus states

* remove dup type

* query constructors

* CLI queries

* missing cmd

* latest consensus state

* parser test

* register query service

* Update x/ibc/02-client/client/cli/query.go

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

* Update x/ibc/module.go

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

* few grpc tests

* fix tests

* final gRPC tests

* rm comment

* address @colin-axner comment

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-08-20 10:23:19 -04:00
Federico Kunze 16435a0f4d
ibc: TimeoutOnClose support (#7066)
* ibc: TimeoutOnClose support

* revert added callback

* update proto

* update spec and add msg test

* update handler and add test

* apply self-review changes

* apply @fedekunze review suggestion

Co-authored-by: Colin Axner <colinaxner@berkeley.edu>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-08-20 07:19:57 -04:00
Cory f02b0b5745
Protobuf audit: base package, module packages, tx/Msg's (#7059)
* proto audits auth, bank, crisis, distribution

* audit module proto files

* audit base proto package

* make protogen

* golint

* fix gov genesis test

* Update proto/cosmos/bank/v1beta1/tx.proto

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

* update coin metadata protos & documentation

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
2020-08-19 07:36:41 +00:00
Aaron Craelius 3f81c0a18d
gRPC interface reflection. (#6722)
* WIP on gRPC interface reflection.

* Update docs in proto

* Add tests

* Add test

* Add route inside router

* Address nits

* ListInterfaces -> ListAllInterfaces

* Fix proto lint

* Remove stray println

* Update proto/cosmos/base/reflection/v1beta1/reflection.proto

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

* Update codec/types/interface_registry.go

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

* Update codec/types/interface_registry.go

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

* Add godoc

Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-08-17 17:02:13 +00:00
Alexander Bezobchuk 7d2062b674
x/bank: gRPC Params Route (#7070)
* update x/bank proto gRPC query service

* fix path

* update keeper

* add godoc

* add test

* lint++
2020-08-17 13:55:04 +00:00
Federico Kunze 23cabc0786
ibc-transfer: split params (#7068) 2020-08-17 08:16:24 -04:00
Federico Kunze 0e3f87313e
ibc-transfer: enable transfer parameter (#6607)
* ibc-transfer: enable transfer parameter

* param_test.go

* update tests and types

* gRPC test

* relay logic and spec update

* fix tests

* unused param
2020-08-17 02:24:14 -04:00
Federico Kunze 3022fe9044
x/ibc-transfer: ADR001 source tracing implementation (#6871)
* x/ibc-transfer: ADR001 source tracing implementation

* gRPC proto file

* validation

* fix validation

* import export genesis

* relay.go updates

* gRPC service methods

* client CLI

* update implementation

* build

* trace test

* fix CLI tx args

* genesis import/export tests

* update comments

* update proto files

* GRPC tests

* remove field from packet

* fix coin validation bug

* more validations

* update comments

* minor refactor

* update relay.go

* try fix test

* minor updates

* fix tests

* fix test

* ADR updates and comments

* build

* Apply suggestions from code review

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

* address a few comments from review

* gRPC annotations

* update proto files

* Apply suggestions from code review

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

* address comments

* docs and changelog

* sort traces

* final changes to ADR

* client support for full path denom prefixes

* address @AdityaSripal comments

* address TODO

* increase test timeouts

Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-08-14 17:46:26 -04:00
Marko 8de96d16f9
tendermint: update to rc3 (#6892)
* modify light imports

* change abci.header to tmproto.header

* use rc

* rc

* fix import

* Merge PR #6893: fix key imports

* fix rc2

* tendermint: update 3 (#6899)

* tendermint: update 4 (#6919)

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

* tendermint: update 5 (#6923)

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

* bump to latest master

* tendermint: update (#6972)

Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Co-authored-by: Cory Levinson <cjlevinson@gmail.com>

* Update x/ibc/07-tendermint/types/test_utils.go

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

* address comment

* go mod

* bring back things

* fix test

* update tm proto files

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Co-authored-by: Cory Levinson <cjlevinson@gmail.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
2020-08-14 13:58:53 -04:00
atheeshp f87624e9de
Add Grpc gateway annotations (#6918)
* grpc for bank module

* edit module.go

* added annotations for x/auth query proto

* generated gw file

* added grpc gateway for x/staking query proto

* added annotations for evidence

* added annotations for gov query proto

* added annotations

* added annotations for slashing module

* updated annotations

* added annotations for staking module

* added annotations for upgrade query

* annotations added for x/ibc/channel query proto

* added annotations for ibc/connection query proto

* updated annotations

* updated annotations

* annotation changes

* ommitted ibc module

* updated go.mod

* fixed lint issue

* review changes

* review changes

* review changes

* review changes

* go sum changes

* updated annotations

* annotation changes

* Fix proto lint issues

* review changes

* review changes

* review changes

* discussion changes

* review changes

* grpc for bank module

* edit module.go

* added annotations for x/auth query proto

* generated gw file

* added grpc gateway for x/staking query proto

* added annotations for evidence

* added annotations for gov query proto

* added annotations

* added annotations for slashing module

* updated annotations

* added annotations for staking module

* added annotations for upgrade query

* annotations added for x/ibc/channel query proto

* added annotations for ibc/connection query proto

* updated annotations

* updated annotations

* annotation changes

* ommitted ibc module

* updated go.mod

* fixed lint issue

* review changes

* review changes

* review changes

* review changes

* go sum changes

* updated annotations

* annotation changes

* Fix proto lint issues

* review changes

* review changes

* review changes

* discussion changes

* review changes

* fixed conflicts

* review changes

* updated gw files

* lint

* lint

* lint

* added missing annotations

* review changes

* review changes

* review changes

* review changes

Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
2020-08-14 10:05:35 +00:00
Amaury Martiny 5559af8b97
Proto Auditing: Replace ID with Id (#7032)
* Proto Auditing: Replace ID with Id

* make proto-gen

* Update docs

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-08-14 08:55:54 +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
Amaury Martiny 134e1dcecd
Protobuf Audit: Genesis states (#6978)
* Remove some casttypes

* Add more comments

* Finish remaining modules

* Fix lint

* Revert customname

* Revert evidence

* Review nits

* Consistent doc for genesis state

* Make proto-gen

* Update docs for capability

* Remove useless customtype

* Update proto/cosmos/auth/v1beta1/genesis.proto

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>

* Add godoc

* Update proto/cosmos/evidence/v1beta1/genesis.proto

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
Co-authored-by: Marie <marie.gauthier63@gmail.com>
2020-08-12 15:48:22 +00:00
colin axnér 3a4e608930
Add clientState and consensusState gRPC support to connection (#7017)
* add proto querys for connection

* add client state and consensus state grpc for connection

* update client utils
2020-08-12 08:54:38 -04:00
Aaron Craelius 20c5ee3624
Enable proto JSON for genesis (#7000)
* Enable proto JSON for genesis

* Test fixes

* Cleanup

* Cleanup

* Cleanup

* Update CHANGELOG.md

* Protogen

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
2020-08-11 14:22:30 +00:00
colin axnér 1744194e71
x/ibc: migrate rest of 04-channel to gRPC (#6964)
* migrate channel querier to grpc

* fix various issues in channel grpc migration

* remove querier and add tests

* fix lint

* update utils based on self review

* Update x/ibc/24-host/keys.go

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

* apply @fedekunze review suggestions

* fix build

* fix build

* run make proto gen again

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-08-11 08:29:29 -04:00
Cory 61a97ef347
Audit / Refactor proto packages layout (#6905)
* create base proto package, move ValAddresses to staking

* move tx, crypto, query proto packages into base; mark module level packages as beta

* new cosmos/base/abci.proto file, refactor some message names

* add comments to TxResponse

* refactor RegisterInterface calls to new proto package names

* fix bug in merge commit

* move missing module proto packages to beta, move cosmos.kv to cosmos.base.kv

* add tx.proto files, holding proto messages for module Msgs

* rm old generated pb.go files

* cosmos/base/base.proto -> cosmos/base/coin.proto

* mark genutil proto package as beta

* Fix conflicts

* Restructure proto files

* Re put signing

* Fix test

* Update slashing genesis

* Ignore confio proto files

* Fix interface register

* Make proto-gen

* Fix lint

* Put tx service into tx.v1beta1

* Use v1beta1 in interface registry

* Remove to cosmos.base.store

* Remove extra confio in buf

Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-08-11 11:49:45 +00:00
Alexander Bezobchuk 0f44d1af23
store: Remove Amino (#6984)
* Update kv pair to proto

* updates

* fix LastCommitID

* lint++

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-08-11 10:09:16 +00:00
Aaron Craelius 0faf545221
Add simulation gRPC service definition (#6872)
* WIP on TxService

* WIP on TxService

* Update docs

* WIP on simulation service

* WIP on simulate service

* Simplify interface

* Simplify interface

* proto-gen

* Update docs

* Update docs

* Simplify

* proto-gen

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-08-11 07:33:35 +00:00
Amaury Martiny 6e3c268a72
Protobuf audit: Queries (#6967)
* Add required fields for queries, p1

* Add comments

* Remove required

* More modules

* 2 to go

* Finish all modules

* Fix typo

* Fix test

* Make proto-gen

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-08-10 08:12:59 +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
atheeshp ceba0cb45d
x/ibc migrate genesis proto (#6878)
* migrated channel genesis types to proto

* connection genesis types migrated to proto

* client proto migration

* failing tests due to tendermint part incomplete

* add genesis test

* x/ibc: ClientState Any

* add genesis test

* suite NotPanics

* comment tests

* update export logic

* refactor

* update test

* fix non-determinism

* castrepeated

* x/ibc: migrate simulations to protobuf

* add proto genesis

* add UnpackInterfaces func to genclientstate

* add unpackinterfaces for consensus states

* formatting

* fix genesis tests

* add modified genesis test

* update comments

* remove localhost register codec

* use app registry

* fix bug

* Update simapp/app.go

* Update x/ibc/02-client/types/genesis.go

* unmarshaler interface

Co-authored-by: Colin Axner <colinaxner@berkeley.edu>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-08-07 08:33:47 +00:00
colin axnér 3076a8b12e
Migrate tendermint consensus state to proto (#6957)
* migrate tm consensus state to proto

* update con state

* register con state

* add confio to proto lint exclude

* Update proto/ibc/tendermint/tendermint.proto

* casttype to hexbytes

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-08-06 05:21:56 -04:00
colin axnér 79cee06967
Migrate Tendermint client state to proto (#6932)
* add tm client state proto file

* migrate tm client state to proto

* bump ics23 dep

* add issue link to makefile
2020-08-04 16:31:50 +00:00
atheeshp 662aa7fa01
Slashing genesis types proto migration (#6881)
* slashing genesis types migrated to proto

* review changes

* fixed lint

* review change

* review change

* review changes

* Update proto messgaes

* Add test for ExportGenesis

* Address naming suggestions

* Update genesis

* Fix genesis test

* Add GetMissedBlocks

* Update genesis test

* Address review suggestions

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
2020-08-04 12:58:36 +00:00
colin axnér 57cd7d62b3
migrate localhost client state to proto (#6925)
* migrate localhost to proto

* localhost returns err on verify consensus state

* fix lint
2020-08-03 09:45:15 -04:00
colin axner b3bbca343f
fix ibc-transfer source bug (#6865)
* update proto and refactor types test

* cleanup SendTransfer

* fix build and prep to update handler tests

* fix handler tests

* fix tests

* update spec

* fix lint

* Apply suggestions from code review

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

* rename amount to token

* merge send transfer and createOutgoingPacket

* apply rest of @fedekunze review suggestions

* apply review suggestions from @AdityaSripal

* update spec to token renaming

* split token in denom and amount when creating fungible token packet

* remove source flag, add prefix on recv

* fix lint

* fix proto numbers

* Update x/ibc-transfer/keeper/relay.go

Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>

* apply @cwgoes review suggestions

* Apply suggestions from code review

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

* apply @fedekunze suggestions

* Apply suggestions from code review

* fix lint

* apply @AdityaSripal review requests

* Update x/ibc-transfer/types/coin.go

* apply @AdityaSpripal last suggestions

Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-01 09:16:22 +00:00
Marko 617b822efa
types: add kv type (#6897)
* add kv type

* add changelog entry

* fix build

* replace sdkkv with kv

* revert change

* fix some tests

* proto-gen

* fix tests

Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-07-30 14:53:02 +00:00
SaReN 72ebafeeca
Update auth cli commands (#6717)
* add utils

* update sign cmd

* update multisign cmd

* update sign batch cmd

* update genutil cmd

* add wrap tx builder

* update gentx cli

* update validate sigs cmd

* fix lint

* add flag reader to cli

* update marshaler for batchscan

* add register query server

* update to master

* remove depricated methods

* fix keyring issue

* update wraptx

* Fix batch scan

* fix register interfaces issue

* update printOutput

* Update Validate Sigs test

* WIP on signature JSON

* Cleanup

* Cleanup

* Test fixes

* Test fixes

* Fixes

* WIP on tests

* Fix gov tests

* fix lint

* fix MultiSign tests

* fix tests

* refactor tests

* Cleanup

* Address review comments

* Update encode

* Test fix

* Rename SignData func

* Fix lint

* Fix lint

* Revert ReadTxCommandFlags

Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
2020-07-29 22:33:42 +00:00
Marie 2da954ff61
x/evidence genesis protobuf migration (#6864)
* Migrate evidence genesis state to proto

* Fix lint error

* Remove commented code

* Clean up

* Add UnpackInterfaces to evidence GenesisState

* Add cosmos_proto.accepts_interface to evidence any and fix lint error

* Add test for x/evidence ExportGenesis and use table tests

* Update x/evidence/types/genesis.go

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

* Update proto/cosmos/evidence/evidence.proto

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

* Keep []Evidence as return type in GenEvidences

* Add GenesisState Validate tests

* Add test case for NewGenesisState

* Add tests for GenesisState UnpackInterfaces

Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-07-29 18:22:51 +00:00
Marie bc7e943158
x/auth genesis protobuf migration (#6880)
* Add auth genesis.proto and related changes

* Add UnpackInterfaces method to auth GenesisState

* Remove unrelevant test case

* Update proto/cosmos/auth/genesis.proto

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

* Add test for auth types ConvertAccountsAny

* Apply naming suggestions

* Update x/auth/types/genesis_test.go

Co-authored-by: Federico Kunze <31522760+fedekunze@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-07-29 16:00:15 +00:00
atheeshp a4d1f306c0
x/{capability, genutil} genesis types migrated to proto (#6867)
* x/capability genesis types migrated to proto

* added docs

* x/genutil: genesis proto migration

* fixed package issue

* review changes

Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-07-29 15:01:20 +00:00
SaReN 804b80a82c
Migrate gov, ibc-transfer genesis state to proto (#6866)
* Migrate gov genesis state

* Migrate ibc-transfer genesis state

* format genesis proto
2020-07-28 19:57:09 +00:00
atheeshp b33b1e9052
x/{distribution, staking, bank, mint, crisis} genesis protobuf migration (#6835)
* distribution genesis types migrated to proto

* removed types from types/genesis.go

* fix lint

* added new line proto

* staking genesis migrated to proto

* fix lint

* x/bank: genesis types migrated to proto

* fix lint

* x/mint: genesis types changed to proto

* x/crisis: genesis types changed to proto

* Migrate genesis state of x/crisis

* add new lines

* whitespace

* Fix bad merge

* added missing field

* fixed error

Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
2020-07-28 09:20:17 +00:00
dauTT 5a7e22022c
Implement ADR 024 - Coin Metadata (#6821)
* Implement ADR 024 - Coin Metadata

* Fix lint

* Fix proto lint

* Index metadata by denom

* Fix test

* Fix proto comments

* Add GetAllDenomMetaData help method and refactor code accordingly

* Add x/bank/keeper/genesis_test.go

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-07-28 07:49:56 +00:00
colin axner ef0a7344af
x/ibc: remove ID from ConnectionEnd (#6814)
* remove connection id

* various test and code fixes

* fix tests

* Update proto/ibc/connection/connection.proto

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

* rename utils.go to parse.go in host

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-22 09:59:15 -04:00
colin axner 35a59b1573
rename MsgPacket to MsgRecvPacket (#6813) 2020-07-22 10:01:57 +00:00
Amaury Martiny 61d0c4adcd
proto: Consistent naming for Params (#6803)
* Use consistent "Params" in proto

* Update comments

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-21 14:04:51 +00:00
Amaury Martiny 69bbb8b327
Rename proto Req/Res to Pagination (#6796)
* Rename proto Req to Pagination

* Change Res to Pagination

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-07-20 16:51:16 +00:00
colin axner 1d6344888e
Fix query unrelayed packets logic (#6733)
* add some query functions to channel keeper

* update grpc queries and cli cmd and tests

* rerun proto gen after merging master

* fix build broken from merge conflicts

* add test and update proto

* Update x/ibc/04-channel/client/cli/query.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-20 12:42:36 +00:00
Cory 32de79d0aa
refactor auths broadcast cmd in alignment with #6216 (#6713)
* refactor auths broadcast cmd in alignment with #6216

* add TxResponse proto definition, and related refactoring

* re-run make proto-gen, updating staking.pb.go

* cleanup TxResponse tests to handle nil return values

* properly handle nil Tx value in TxResponse's implementation of UnpackInterfaces

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-17 17:17:21 +00:00
atheeshp 28269908d9
x/gov: gRPC query Service (#6491)
* WIP: adding gRPC for gov

* removed passing new store

* fixed error

* added register query service in module

* order of imports changed

* order of imports changed

* Fix proto file

* added get all proposals grpc

* added more tests

* added doc in tests

* added grpc for votes

* Added grpc for Deposits

* updated protos

* added grpc for proposal, vote, deposit, tally

* WIP: adding params grpc

* added params in gRPC

* updated error messages

* fixed error check

* added more tests

* updated tests

* added yaml types

* review changes and lint issues

* updated tests

* code cleanup

* removed cosmos.gov prefixes

* added more checks

* added more test checks

* added filtered pagination

* removed test check

* added tests for filtered pagination

* Fix Proposals

* lint

* fixed error in tests

* lint issues

* Add nil check for params

* Added unpacker

* removed casttypes

* review changes

* use suite in grpc query tests

* migrated tests to use suite

* fix non-determinism

* tests migrated to table driven tests

* fixed doc typo

* revert change

* Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/5921-grpc-x-gov

* review changes

* review changes

* review changes

* review change

* review changes

* docs updated

* review change

* review changes

* review changes

* review changes

* Update x/gov/keeper/keeper_test.go

Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
Co-authored-by: Anil Kumar Kammari <anil@vitwit.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-07-16 09:16:23 +00:00
colin axner a65bcdd7e5
add custom relative and absolute timeouts to ibc-transfer (#6724)
* add custom relative and absolute timeouts

* fix misspell

* Update x/ibc-transfer/client/cli/tx.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-15 13:32:09 +00:00
SaReN 5656e8647b
x/staking: gRPC query Service (#6490)
* Add types for staking grpc

* Update module.go

* Update staking query types

* Add grpc query methods

* Add delegation response to proto

* Add queriers for delegations

* Add queriers for unbonding

* Add queriers for redelegations

* Add cases for redelegations

* Add test for grpc validators

* Update staking types to proto

* Update staking query proto

* Add tests for grpc

* Add tests for grpc pool, parameters

* Fix lint issues

* Add grpc redelegation tests

* Add more tests

* Add docs for query proto

* Add docs for query types

* Modify redel querier

* Add debugging statements

* Revert debugging

* Fix proto lint errors

* Add wrapper for keeper

* Embed keeper in querier

* Add more tests

* Add tests for validator unbondings

* Add redel tests

* fix queryRedelegationsFromSrcValidator

* Fix Redelegation tests

* update godoc

* Update args

* Update tests with suite

* Fix lint

* Remove redundant types

* Refactor tests

* fix test

* refactor query proto

* Fix tests

* address review comments

* lint staking proto

* add godoc

* Update tests to table driven tests

* add debugging

* Fix grpc tests

* address comments

* address whitespace suggestions

* Add more tests

* add tests for invalid redels

* update error messages

* address review suggestions

* add tests

* move suite to keeper_test

Co-authored-by: Aaron Craelius <aaronc@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-07-14 17:41:30 +00:00
Alexander Bezobchuk 6bd36c8719
Merge PR #6702: x/slashing: In-Process CLI Integration Tests 2020-07-14 11:55:19 -04:00
colin axner 5dfc4a2ec9
Standardize connection versioning + channel versioning docs (#6640)
* update connection versions with feature set flag

* make connection version modular to support channel versioning and registering

* revert IBCVersion renaming, add channel versioning logic

* fix channel version flag

* remove unnecessary godoc

* remove unused func

* fix lint and version test

* add test and fix error

* revert changes

* update docs

* remove unnecessary godoc

* Apply suggestions from code review

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

* update doc

* add test cases for unchecked lines

* go fmt

* begin migration to standardized version

* revert proto changes

* restructure versioning to go from string to proto

* update versionStr to encodedVersion naming

* fix version test build

* fix keeper tests

* fix various tests

* fixes from self review

* update docs

* fix lint

* add more code cov

* rename ToString funcs to Encode/DecodeVersion + GetCompatibleEncodedVersions renaming

* update spec docs

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-14 08:43:26 +00:00
atheeshp be111ef036
x/distribution: gRPC query service (#6600)
* WIP: adding grpc

* added grpc for query withdraw address

* Fix outstanding rewards query

* added inteerface registry

* added gRPC for delegation rewards

* added remaining commands

* lint issue

* added tests

* added test for community pool

* fixed error

* added test for delegator validators

* updated to use test suite

* updated tests

* more test checks added

* updated tests

* Add sdk wrap

* removed pagination for outstanding rewards

* fixed distr tests issue

* fixed slashes issue

* migrated tests to table driven tests

* docs updated

* review changes

* review changes

* review changes

* Update x/distribution/keeper/grpc_query.go

Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
Co-authored-by: anilCSE <anil@vitwit.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-13 20:01:16 +00:00
Marie 1e23679066
x/evidence: gRPC query service (#6593)
* Add basic grpc query service for x/evidence

* Add grpc query test for AllEvidences query

* linting

* Add AnyUnpacker to query test helper and some var renaming

* Add test to check Evidence query result

* Update proto/cosmos/evidence/query.proto

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

* Use table tests

* Use NewQueryEvidenceRequest in place of QueryEvidenceParams

* Remove ConvertEvidence

Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-10 13:52:59 +00:00
Ira Miller 589c1a531e
Enable/disable coin transfers by denom (#6527)
* initial implementation of per denom sendenabled

* Fix for accidentally removed keyword

* Validate individual param in param array

* Lint fix

* Refactor bank params to use protobuf
Modified SendEnabled property to be part of generic Params object
Updated genesis functions to use default params structure

* Refactor simulation genesis for clarity

* update changelog for bank sendenable per denom

* fix NoOpMsg type in multisend test

* Add a coin denom send check utility function

* Additional godoc comments and clarification

* Add default send enabled parameter to bank.
Remove empty denom capability from SendEnabled parameters
Update simulation to exercise both configuration options independently

* Minor suggested improvements.

* simulation fix

* bank proto sendenabled package name removed

* Remove extra gogo proto yaml tags

* Params rename IsSendEnabled to SendEnabledDenom

* Refactor to SendEnabledCoin(s)

* update slashing test to use bank params

* Clean up change log entry for feature.

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-07-08 17:43:08 +00:00
Akhil Kumar P 674845c7f6
x/params: query gRPC service (#6585)
* Add grpc queries in x/params

* Modify grpc query tests format

* Modify query request and revert changes in querier

* Fix protobuf lint issues
2020-07-08 15:33:55 +00:00
Akhil Kumar P 4536ca22bb
x/auth: gRPC query service (#6565)
Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
2020-07-08 13:12:38 +02:00
atheeshp 58dcef15e1
x/mint: gRPC query service (#6535)
* Added grpc for mint

* changed unused params

* updated tests

* removed empty query request

* fixed lint issues

* review changes

* review changes

* migrated to use test suite

* Update x/mint/keeper/grpc_query_test.go

Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-07 07:33:43 +00:00
SaReN a0daec2d94
x/Slashing: gRPC query service (#6597)
* Add grpc methods - slashing

* Add slashing grpc queries

* Add tests

* Remove duplicate declarations

* Add signing infos

* Update query test

* Use suite for grpc tests

* Update godoc

Co-authored-by: Alexander Bezobchuk <alexanderbez@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-07-06 21:54:25 +00:00
Federico Kunze f35e3b2c02
x/ibc: gRPC query service (#6466)
* x/ibc: gRPC query service

* fixes

* connection updates

* register channel query service

* update clients

* change proofs to bytes

* implement additional channel grpc queries

* unrelayed packets query

* query.proto files

* move next sequence recv query to channel client

* update REST

* wip test

* add missing cli queries

* install the right tools

* fixes

* build

* lint

* use gRPC when query proof is not requested

* connection gRPC tests

* IBC query server interface

* more gRPC channel tests

* pagination tests

* connection use query server

* connection pagination tests

* channel pagination tests

* typo

* remove buf

* Update x/ibc/03-connection/keeper/grpc_query_test.go

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

* address comments from review

* fix tests

* unrelayed packet sequences flag

* remove ClientsConnections query

* fix

Co-authored-by: colin axner <25233464+colin-axner@users.noreply.github.com>
2020-07-06 15:35:35 -04:00
Aaron Craelius 2f44fbf2ab
Add support for protobuf TxGenerator and SIGN_MODE_DIRECT (#6385)
* Add TxWrapper, encoder, decoder and DirectModeHandler

* fix pkg name

* Update API and leave test TODO's

* Update TxWrapper API

* tests for tx wrapper (#6410)

* WIP: added test for direct mode handler

* updated code

* Add msg

* Update TxWrapper API

* Fix pubkey declaration

* Add pubkey for tests

* Fix SetFee

* Remove logs

* Avoid global var declaration for tests

* Add test for GetPubKeys

* Fix direct signing tests

* Add more test cases for GetSignBytes

* Revert SetFee API

* Remove logs

* Refactor tests

Co-authored-by: anilCSE <anil@vitwit.com>
Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>

* Refactoring

* Refactoring

* Integrate SignatureV2 API

* Fix wrapper tests

* Fix tests

* Linting and API tweaks

* Update API

* WIP on updating API

* Fix tests

* Update to new SigVerifiableTx

* Rename

* Update docs to reflect ADR 020

* proto-gen

* proto docs

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* Add tests

* Refactor and improving test coverage

* WIP on test coverage

* WIP on test coverage

* proto-gen

* Fix CompactBitArray.Size() bug

* Rename

* Remove Builder interface

* Address review comments

* Update x/auth/tx/sigs.go

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

* Update x/auth/tx/encoder.go

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

* Update x/auth/tx/encoder.go

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

* Address review feedback

* Fix build issues

* Resolve conflicts

* Fix ValidateBasic test coverage

* Add test for malicious multisig

Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
Co-authored-by: anilCSE <anil@vitwit.com>
Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-06 17:03:45 +00:00
Amaury Martiny 4459201591
x/upgrade gRPC query service (#6590)
* Add .proto and make proto-gen

* Correct proto types

* Update pseudo tests

* Update tests

* line break

* Fix tests after merge

* Update proto/cosmos/upgrade/query.proto

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

* Update proto/cosmos/upgrade/query.proto

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

* Update proto/cosmos/upgrade/query.proto

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

* Update proto/cosmos/upgrade/query.proto

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

Co-authored-by: Aaron Craelius <aaron@regen.network>
2020-07-04 17:30:17 +00:00
Alexander Bezobchuk d5049413ef
Merge PR #6525: x/bank: Refactor CLI & Tests 2020-06-30 16:59:21 -04:00
SaReN 4b0c66982a
Add pagination (#6452)
* Add pagination types and helper func

* Update API

* Add pagination to queryBalance

* Add QueryBalance to use Paginate

* Update GetAllBalances usage

* Add tests for QueryAllBalances

* Fix bank get balance querier tests

* Add pagination test setup

* revert simapp changes

* Fix pagenation tests

* Add more tests for pagination

* Add offset nullable

* Add more tests

* Fix paginate for offset

* Add grpc queryconn for query

* Fix paginate

* Fix maxlimit

* Fix queryClient

* Fix pagination tests

* refacor

* Fix grpc tests

* Revert

* review changes

* Fix lint

* Update types/query/pagination.go

* Fix review suggestions

* Remove maxLimit and use defaultLimit

* change example paginate as a testable fun

* Fix review comments

* Merge master

* Add bank query.pb.go

* Add missing import

* Add pageReq to queryBalance

* Add example for pagenate

* Fix cli tests

* Remove example for pagination

* Update paginate example

Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: anilCSE <anil@vitwit.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-06-20 23:44:04 +00:00
Cory 4e73e0f817
Update proto files & definitions in accordance with ADR023 (#6413)
* consolidate proto files into single directory, turn on PACKAGE_DIRECTORY_MATCH linting

* add third_party root for third party proto files

* move ibc proto files to top level folder, rename .proto files to types.proto as before

* update protocgen script, and run code generation

* move vesting proto definition to cosmos namespace, rename from types.proto in alignment with buf.build naming conventions

* update Makefile so proto dependencies are set with new structure when updated

* add comment for sed usage in makefile

* remove unused aliases of proto generated types

* add settings.json instructions to contributing.md for including protobuf paths

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
2020-06-18 10:04:26 -07:00