Commit Graph

18 Commits

Author SHA1 Message Date
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
Robert Zaremba 6bc8ff2dfe
Use any as validator pubkey (#7597)
* protobuf pubkey type update

* wip2

* wip3

* solving types.NewValidator issues

* remove bech32 from validator type assignment

* update Validator interface

* Changelog update

* wip4

* update genutil

* fix simapp & x/ibc/testing tests

* update staking

* changelog update

* fix import cycle in tests

* fix amino panic on TestValidatorMarshalUnmarshalJSON

* fix TestValidatorMarshalUnmarshalJSON consensus_pubkey check

* Add UnpackInterfaces to HistoricalInfo

* fix TestHistoricalInfo

* update todos

* fix: Expecting ed25519.PubKey to implement proto.Message

* fix linter issues

* Fix migrate test

* Update CHANGELOG.md

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

* review comments

* cosmetic changes

* add UnpackInterfaces got GenesisRandomized test

* Validator.Equal reuses Validator.MinEqual

* fix test

* use Validator.Equal in tests

* Fix staking simulation TestRandomizedGenState

* Remove TODO

* use HistoricalInfo.Equal

* use proto.Equal

* rename Validator.GetConsPubKey to TmConsPubKey

* prefer require.Equal over reflect.DeepEqual

* SetHistoricalInfo using a pointer

* Fix TestQueryDelegation test

* Fix TestQueryValidators test

* Fix TestSimulateMsgUnjail test

* experiement with LegacyAmino instances

* Register codecs in all simapp tests

* Fix cli_test compilation problems

* fix typo sdk -> std

* fix typo

* fix TestPlanStringer

* Rename to MakeEncodingConfig

* Remove RegisterCodecsTests

* Use gRPC in GetCmdQueryValidators

* Empty status

* fix info log check

* linter fixes

* rename simapparams to simappparams

* Update simapp/test_helpers.go

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

* comments updates

* use valAddr1 instead of sdk.ValAddress(pk1.Address().Bytes())

Co-authored-by: Cory Levinson <cjlevinson@gmail.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
2020-10-23 12:07:52 +00:00
Robert Zaremba 8eaf2ececc
Refactor x/staking Validation and Delegation tests based on MsgCreateValidator.Pubkey type change. (#7526)
* testing: refactore Validation and Delegation handling of x/staking

This Changeset introduces set of improvements for writing tests.

The idea is to create a testing subpackage which will provide functions
to make tests more dev-friendly and wrap higher level use-cases.
Here is a show-up of of creating a service for staking module
for tests.

This PR also changes the `x/staking/types.MsgCreateValidator.Pubkey` from string
to types.Any. This change motivated the other change to show the pattern I'm describing here.

* add validator checks

* type change fixes

* use deprecated

* adding test slashing

* new network comment update

* working on tests

* Fix TestMsgPkDecode test

* Add UnpackInterfaces to MsgCreateValidator

* Fix tests

* Convert bech32 pubkey to proto

* Fix test

* fix v039/migrate_test/TestMigrate

* fix tests

* testslashing: rename Service to Helper

* file rename

* update TestMsgDecode

Co-authored-by: blushi <marie.gauthier63@gmail.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Cory Levinson <cjlevinson@gmail.com>
2020-10-19 13:04:55 +00:00
atheeshp 18ef33caff
Refactor x/staking according to ADR 031 (#7556)
* Refactor x/staking according to ADR 031

* lint

* review changes

* review changes

* review changes

Co-authored-by: Aaron Craelius <aaron@regen.network>
2020-10-16 14:53:49 +00:00
Amaury Martiny 33e7297c79
Use enum instead of int32 for BondStatus (#7499)
* Migrate staking module

* Add gov legacy

* Add comments

* Add x/distrib

* x/crisis

* x/mint

* Fix test

* migrate x/genutil

* Fix lint

* Fix staking constants

* Fix test

* Update x/genutil/legacy/v040/migrate.go

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

* Add migrate script instead of change BondStatus constants

* Change staking bondStatus to enum

* Fix test

* Fix another test

* Remove staking exported

* fix references

* Better constants

* Fix build

* Fix lint

* Remove buf version

* Fix tests

* Fix test

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2020-10-12 13:56:02 +00:00
Anil Kumar Kammari d55c1a2665
Change `address` from bytes to bech32 strings (#7242)
* init

* Fix bank proto messages

* missing conversions

* remove casttype for addresses

* Fix tests

* Fix consaddress

* more test fixes

* Fix tests

* fixed tests

* migrate missing proto declarations

* format

* Fix format

* Fix alignment

* Fix more tests

* Fix ibc merge issue

* Fix fmt

* Fix more tests

* Fix missing address declarations

* Fix staking tests

* Fix more tests

* Fix config

* fixed tests

* Fix more tests

* Update staking grpc tests

* Fix merge issue

* fixed failing tests in x/distr

* fixed sim tests

* fixed failing tests

* Fix bugs

* Add logs

* fixed slashing issue

* Fix staking grpc tests

* Fix all bank tests :)

* Fix tests in distribution

* Fix more tests in distr

* Fix slashing tests

* Fix statking tests

* Fix evidence tests

* Fix gov tests

* Fix bug in create vesting account

* Fix test

* remove fmt

* fixed gov tests

* fixed x/ibc tests

* fixed x/ibc-transfer tests

* fixed staking tests

* fixed staking tests

* fixed test

* fixed distribution issue

* fix pagination test

* fmt

* lint

* fix build

* fix format

* revert tally tests

* revert tally tests

* lint

* Fix sim test

* revert

* revert

* fixed tally issue

* fix tests

* revert

* fmt

* refactor

* remove `GetAddress()`

* remove fmt

* revert fmt.Striger usage

* Fix tests

* Fix rest test

* disable interfacer lint check

* make proto-format

* add nolint rule

* remove stray println

Co-authored-by: aleem1314 <aleem.md789@gmail.com>
Co-authored-by: atheesh <atheesh@vitwit.com>
2020-09-25 10:25:37 +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
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
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 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
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
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
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
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
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
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