Commit Graph

337 Commits

Author SHA1 Message Date
Aaron Craelius 850419fffd
Tx CLI proto module interface (#5989)
* WIP

* WIP

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

* Revert unneeded changes

* Simplify cli tx UX

* Wire up bank tx REST routes

* Fix assignment issue

* Wire up bank NewSendTxCmd

* fix lint

* revert file

* revert file

* fix simcli

* Refactor AccountRetriever

* Fix build

* Fix build

* Fix build

* Fix integration tests

* Fix tests

* Docs, linting

* Linting

* WIP on all modules

* Implement other module new tx cmd's

* Fix cmd's

* Refactor existing GetTxCmd

* Fix cmd

* Removing deprecated code

* Update ADR 020 & CHANGELOG

* Lint

* Lint

* Lint

* Lint

* Lint

* Lint

* Lint

* Fix client/tx tests

* Fix mocks

* Fix tests

* Lint fixes

* REST tx migration

* Wire up REST

* Linting

* Update CHANGELOG, docs

* Fix tests

* lint

* Address review feedback

* Update CHANGELOG.md

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

* Update CHANGELOG.md

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

* group vars

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-05-21 21:29:34 +00:00
SaReN bf8809ef98
Update x/auth to use Any (#6165)
* Migrate keeper codec to use marshaler

* Migrate AccountI to types

* Did go imports

* Fix tests for x/auth

* Cleanup std/codec

* Sort imports

* Fix legacy codec

* Add godoc for RegisterInterfaces

* Add RegisterInterfaces to std

* Fix typo

* Fixed merge changes

* Eliminate vesting import in auth

* Fix lint issues

* Fix tests

* Addressed comments

* Rename interfaces in RegisterInterfaces

* Removed codec.proto from std

* Minor code cleanup

Co-authored-by: Aaron Craelius <aaron@regen.network>
2020-05-20 19:21:00 +00:00
Aaron Craelius 70767c87c4
Update x/gov to use Any (#6147)
* Update x/gov to use Any

* Fixes

* Remove MsgSubmitProposalLegacy

* Update CHANGELOG.md

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

* Fix query JSON issue

* Fix gov tests

* Revert custom Any Equals

* Re-remove types

* Rename receivers

* Fix imports in gov

* Sort imports

* Make amino JSON signing work with Any

* Run proto-gen

* Create full amino wrapper

* Fix errors

* Fixes

* Fix tests

* Test fixes

* Fix tests

* Linting

* Update ADR 019 and CHANGELOG

* Updated ADR 019

* Extract Marshal/UnmarshalProposal

* fix error

* lint

* linting

* linting

* Update client/keys/parse.go

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

* linting

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

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

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

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

* Address review feedback

* Add godocs

* Fix errors

* fix errors

* revert file

* Address review feedback

* Address review feedback

* Stacktrace debug flag

* Fix tests

* Address review feedback

Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-05-19 20:17:29 +00:00
Federico Kunze 6d7fc911c2
x/distribution: register MsgFundCommunityPool (#6211) 2020-05-13 12:14:45 -04:00
Marko bef3689245
linter: enable nolintlint (#6162)
* nolintlint enable

* remove space

* fix tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-05-08 08:46:12 +00:00
Aaron Craelius 386217209d
Merge PR #6076: Proto Any init + evidence 2020-05-05 10:28:20 -04:00
Alessio Treglia 2414e5bdd4
x/auth: turn sign --validate-sigantures into a standalone command (#6108)
--validate-signatures should not be a flag of the sign command
as the operation performed (transaction signatures verification)
is logically distinct.

cli_test is and has always been an horrible name for package
directory as it's very much Go anti-idiomatic - _test is the
suffix used by test packages, not directories. Plus, CLI test
cases can and should live alongside other testcases that don't
require binaries to be built beforehand. Thus:

x/module/client/cli_test/*.go -> x/module/client/cli/

Test files that require sim{cli,d} shall be tagged with // +build cli_test

With regard to cli test auxiliary functions, they should live in:

x/module/client/testutil/

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-05-04 13:55:16 +00:00
Marko 218ec99508
various linter fixes (#6106)
x/staking: Fix all linter warnings.

Fixed warnings across base packages.

New linters:
- unparam
- nolintlint

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-05-02 21:26:59 +02:00
SaReN f92f6c9dd1
Add CLI tests for simd, distribution (#6095)
* Added cli integration base setup

* Added cmd to simapp

* Fixed ci-lint issues

* Fixed ci-lint issues

* Addressed changes in Makefile

* Updated simd to latest

* Removed testnet and replay commands

* Modified tx command for simcli

* Did code cleanup

* Removed duplication in Makefile

* Refactored cli_test

* Added build-sim to Makefile

* Added test-cli to circleci

* Added tests for staking txns

* Addressed format issues

* refctored tests code

* Added tests for send, staking

* Removed test_hepers file

* Moved test_cover to contrib

* Added codec in fixtures

* Migrated tests to respective modules

* Exported helper methods

* Moved helpers to bank

* Added codec to fixtures

* Migrated tests to modules

* Removed auth helpers from staking

* Did minor code cleanup

* Added test-cli to Makefile

* Updated github actions

* Did code refactor

* Fixed github actions for cli-test

* Added tests for recover keys and fee deduction

* Did minor code cleanup

* Added build flag to cli_tests

* Moved cli_test to tests

* Modified path in Makefile

* Updated codec std in fixtures

* Added doc for cli tests

* Remove ibc genesis validation

* Fix issue number

* Added missing imports

* Add tests for distribution and simd

* Modified naming for test functions

* Added test for withdraw rewards

* Modified test function names

* Fixed import format

* Migrated helpers to package cli

* Fixed github test actions

* Fixed test coverage in actions

* Added build sim to actions

* Apply Alessio patch for tests

* Removed unused imports

* Added init for go tests

* try fix tests

* goimports what wasn't goimports'd

* try fix ci

* add relevant tags to integration tests

* run integration tests separately

* use go build -o flag and let compiler gemerate the binary with the
right extension for the HOST platform

rename cli-test to test-integration

* update ci

* rename

Co-authored-by: atheesh <atheesh1>
Co-authored-by: kaustubhkapatral <54210167+kaustubhkapatral@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: anilCSE <anil@vitwit.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-05-01 20:16:17 +00:00
Alessio Treglia 2879c0702c
x/ibc: fix missing return statement (#6099)
* enable the wsl linter

Fix various wsl-related warnings.

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

* goimports -w files

* remove unknown linter references

* run make format

* Revert "run make format"

This reverts commit f810b62b9e4993f08506663d4e5f2ec2228a9863.

* run make format
2020-04-29 22:36:34 -04:00
Aaron Craelius cc90f2e002
Merge pull request #6085: Move codec/std to std 2020-04-27 15:40:50 -04:00
Federico Kunze 3ee975c57b
Merge PR #6037: refactor simulation decoder 2020-04-21 17:33:56 -04:00
Alexander Bezobchuk fea231556a
Move ModuleAccount to x/auth (#6029)
* Move ModuleAccount to x/auth

* Update x/auth module

* Update x/staking

* Update x/mint

* Update x/gov

* Update x/distribution

* Update simapp

* Update x/bank

* Update std codec

* Add changelog entries

* Update CHANGELOG.md

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

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-04-20 19:32:10 +00:00
Alexander Bezobchuk 1083fa948e
Merge PR #6010: Merge x/supply into x/bank 2020-04-20 11:22:12 -04:00
Marko b26109c5dc
ci: upload artifacts on failure (#5987) 2020-04-16 12:41:22 +02:00
Alessio Treglia aeee097b2f
spring cleanup (#5991)
* Make format

* Fix golangci-lint warnings

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

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

Ref #5964
2020-04-14 17:24:27 +02:00
SaReN 192f259e77
Merge PR #5967: Fixed cliCtx in tx cli 2020-04-09 10:00:10 -04:00
SaReN ed9f488fd9
Merge PR #5941: Add proto compatible x/distribution tx cli 2020-04-08 11:05:14 -04:00
Alessio Treglia ca19fbc5f8
types/rest: add convenience functions for error checking (#5900) 2020-04-01 09:50:22 +02:00
Aleksandr Bezobchuk 6135912e53
JSON Proto changes 2020-03-26 12:46:10 -04:00
Jonathan Gimeno 49102b1d98
Remove dependency of types/module package on x/simulation (#5835)
Closes: #5724
2020-03-23 12:55:44 +01:00
Marko d657513741
lint: various linting fixs (#5825)
* lint: various linting fixs

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* more linting

* more linting fixes

* more errchecking

* comment out errcheck for now

* undo error check

* address some comments

* remore require error

* change delete to batch delete

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-03-20 19:24:18 +00:00
Alessio Treglia 1d0967c32a
run go mod tidy && make format (#5847) 2020-03-20 17:14:14 +00:00
Jonathan Gimeno 8c7bb89549
Implementing --offline flag (#5810)
Closes: #5448
2020-03-19 02:49:33 +01:00
Gavin e0280bf2d5
Update 07_params.md 2020-03-17 11:30:24 -04:00
Aleksandr Bezobchuk 25f036f248
Update params doc with restrictions 2020-03-16 19:02:55 -04:00
Jonathan Gimeno 2e42f9cb74
Favor marshal unmashal binare bare (#5799)
* change abci file to use BinaryBare

* change all calls to EncodeLengthPrefixed to BinaryBare in distribution keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in mint keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in auth keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in distribution keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in staking keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in staking keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in gov keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in slashing keeper store.

* update decoder test

* migrate decoder

* migrate gov simulation decoder

* migrate baseapp_test

* refactor QuerySubspace

* refactor coedc std codec

* migrate keybase

* migrate iavl store

* migrate root multi

* migrate ante basic

* migrate tx type to bare

* migrate auth client

* update auth types

* update decoder

* migrate supply decoder

* migrate stake encoding

* migrate staking simulation

* migrate genutil

* migrate simapp test helpers

* migrate docs

* upgrade changelog

* Update CHANGELOG.md

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

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-03-13 19:58:43 +00:00
Jonathan Gimeno 382e5021b2 update cli documentation distribution 2020-03-11 18:06:39 +01:00
Jonathan Gimeno 36554e73e2 refactor cli tx for distribution param change request 2020-03-11 18:03:47 +01:00
Jonathan Gimeno e45be08eb1 create module account on init for FeeCollectorName and tests for other module accounts 2020-03-05 22:11:05 +01:00
mergify[bot] 9acd722db2
x/distribution: simapp for testing (#5725)
* migrate first distribution test to use simapp

* refactor test TestAllocateTokensTruncation

* migrate allocation test for distribution

* migrate TestCalculateRewardsBasic to simapp in distribution

* migrate TestCalculateRewardsAfterSlash to simapp in distribution

* migrate TestCalculateRewardsAfterManySlashes to use simapp

* migrate TestCalculateRewardsMultiDelegator to use ssimapp

* migrate TestWithdrawDelegationRewardsBasic to simapp

* migrate TestCalculateRewardsAfterManySlashesInSameBlock to simapp

* migrate TestCalculateRewardsMultiDelegatorMultiSlash

* migrate old delegation test

* migrate keeper test to simapp

* refactor all distribution to use simapp

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-03-05 14:00:45 +00:00
Aaron Craelius 333066efa8 Fix distribution proto package 2020-02-26 20:16:48 -05:00
Aaron Craelius feb8b0d4c3 Protogen fix 2020-02-26 20:15:32 -05:00
Aaron Craelius 56104c2961
Merge PR #5703: Fix typo in distribution proto package name 2020-02-26 10:58:27 -05:00
Alexander Bezobchuk 238928ed50
Merge PR #5688: Proto Option Updates 2020-02-21 11:31:16 +01:00
Marko ebbfaf2a47
Merge PR #5681: proto: migrate bank to hybridcodec 2020-02-20 15:24:26 +01:00
Jonathan Gimeno 434f539bff
Merge PR #5649: Update x/params to follow module standards 2020-02-19 12:52:20 +01:00
Alexander Bezobchuk a63de303b8
Merge PR #5665: Bump Module ABCI Error Codes 2020-02-18 14:43:00 +01:00
Alexander Bezobchuk 794a496892
Merge PR #5533: Protobuf: x/auth & x/supply 2020-02-18 13:50:13 +01:00
Alessio Treglia c77bb7b038
Squash various linter warnings (#5652)
Closes: #5651
2020-02-16 20:06:45 +01:00
Marko 48d39e344e
Merge PR #5619: proto: migrate params to hybrid codec 2020-02-12 11:34:09 -05:00
Marko 56c5868975
Merge PR #5610: proto: migrate x/distr to use hybrid codec 2020-02-11 09:58:37 -05:00
Alessio Treglia 6cbf634ad5
Merge PR #5620: Fix nil pointer deref in distribution tax/rewward validation helpers 2020-02-07 13:09:18 -05:00
Alexander Bezobchuk 53bf2271d5
Merge PR #5600: Migrate x/staking to Protobuf 2020-02-06 14:21:02 -05:00
Erik Grinaker a7f25ade03
Merge PR #5613: update to golangci-lint v1.23.3
Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com>
2020-02-05 11:32:45 -08:00
Alexander Bezobchuk 6890feb3d2
Merge PR #5572: ADR 004 Implementation 2020-01-30 16:31:16 -05:00
Alessio Treglia b647824716
Refactor x/auth/client/utils/ (#5555)
Packages named utils, common, or misc provide clients with no
sense of what the package contains. This makes it harder for
clients to use the package and makes it harder for maintainers
to keep the package focused. Over time, they accumulate dependencies
that can make compilation significantly and unnecessarily slower,
especially in large programs. And since such package names are
generic, they are more likely to collide with other packages
imported by client code, forcing clients to invent names to
distinguish them.

 cit. https://blog.golang.org/package-names
2020-01-24 16:40:56 +00:00
Alexander Bezobchuk a4b36b9dcd
Merge PR #5561: v0.38 Migration Fixes 2020-01-23 13:15:22 -05:00