Commit Graph

6990 Commits

Author SHA1 Message Date
Alexander Bezobchuk 5d50e13425
cleanup x/bank and x/crisis (#6697) 2020-07-13 06:55:58 +00:00
dauTT c80ebf3ab7
x/slashing/simulation/operations.go: add unit tests (#6695)
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-07-12 14:56:53 +00:00
Alessio Treglia 2ba21d33ab
types: better Dec.MarshalTo's performance (#6691)
Use big.Int.Cmp() and compare against zeroInt instead
of checking Bytes() against a 0-length byte slice.

Closes: #6680
Thanks: @odeke-em for the patch.

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-12 13:26:51 +00:00
Alessio Treglia ba6a2f57c2
crypto/hd: update godoc for ComputerMastersFromSeed (#6694)
Closes: #5338
2020-07-12 09:17:59 -04:00
dauTT 2de851d5bd
Merge PR #6693: x/staking/simulation/params.go: add unit tests 2020-07-11 22:26:38 -04:00
dauTT d6e0888ea6
Merge PR #6692: x/staking/simulation/genesis.go: add unit tests 2020-07-11 22:15:31 -04:00
dauTT 3ab823c587
x/staking/simulation/operations.go: add unit tests (#6690) 2020-07-12 01:56:28 +00:00
Emmanuel T Odeke 152ac24931
rootmulti/internal/maps: remove duplicated code, simplify and speed up KVPair (#6689)
Noticed during an audit, we've got duplicated code that's unused.
There were 2 type definitions:
* type kvPair types.Pair
* type KVPair types.Pair

and each had a .bytes() and .Bytes() method respectively that
then used some extra code.

This change deletes the duplicated/unnecessary code but also
while here improves the performance by removing the use of a
bytes.Buffer which is unnecessary given that we are only
length prefixed the key, length prefixing the value hence
the various helpers are unnecessary.

The added benchmarks shows the performance boost
```shell
$ benchstat before after
name           old time/op    new time/op    delta
KVPairBytes-8     146µs ± 1%     142µs ± 2%   -3.05%  (p=0.000 n=18+17)

name           old speed      new speed      delta
KVPairBytes-8  6.84GB/s ± 1%  7.06GB/s ± 2%   +3.15%  (p=0.000 n=18+17)

name           old alloc/op   new alloc/op   delta
KVPairBytes-8    1.01MB ± 0%    1.01MB ± 0%   -0.04%  (p=0.000 n=17+20)

name           old allocs/op  new allocs/op  delta
KVPairBytes-8      6.00 ± 0%      1.00 ± 0%  -83.33%  (p=0.000 n=20+20)
```

Closes: #6688
2020-07-11 13:44:10 +02:00
Alexander Bezobchuk e7554bb3b0
Fix Gas Flag Usage + CLI Flag APIs (#6685)
* Use new APIs

* fix usage

* fix usage of gas flag

* tests: TestParseGasSetting
2020-07-11 08:13:46 +00:00
Alexander Bezobchuk e1476c1f9d
x/distribution: CLI & Module Tweaks (#6684)
* init commit

* cleanup methods

* fix
2020-07-10 19:59:26 +00:00
Alexander Bezobchuk 400c3cb08e
Merge PR #6652: x/distribution: In-Process Testing & CLI Refactor 2020-07-10 10:45:46 -04: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
Emmanuel T Odeke 59cd0659a5
codec: remove unused and untest ProtoMarshalJSONIndent (#6668)
Noticed from coverage reports and from offline consultation
with Alexander and Aaron, that this function can be removed.
2020-07-10 14:33:35 +02:00
Emmanuel T Odeke c9ec4be3a8
codec: add as much visible coverage (#6670)
As part of an audit, adds as much visible coverage from
73.4% to about 84.2%, but after #6668 is merged, we'll
have it about 88.X% and the coverage report seems to show
only missing cases of not common scenarios, e.g. a case that'll
make jsonpb.Marshaling to fail, and which will return an error
anyways.
2020-07-10 13:01:25 +02:00
Emmanuel T Odeke 7f69b088d9
types: fix invalid int->string conversion in benchmarks (#6678)
Fixes an invalid int->string conversion that will become
a vet error for Go1.15. The correct conversion was to use

    fmt.Sprintf("COINZ_%d", i)

instead of

    "COINZ_" + string(i)

Noticed during a coverage audit.
2020-07-10 12:34:43 +02:00
Amaury Martiny d23c779b87
Fix godocs for NewTxBuilderFromFlags (#6676) 2020-07-10 11:55:17 +02:00
Jonathan Gimeno 6ceedc9e4f
Remove TxBuilder references to viper. (#6653)
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-07-10 11:05:35 +02:00
Alessio Treglia 255ed06eb4
testutil: add ApplyMockIODiscardOutErr, simplify existing functions (#6665) 2020-07-10 08:55:48 +02:00
Al d269eaf74c
Document types/context.go code (#6654)
* document context.go code

* update CHANGELOG.md unreleased

* creates -> returns

* Update CHANGELOG.md

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

* Apply suggestions from code review

Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>

* Update types/context.go

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-07-09 19:14:18 +00:00
Emmanuel T Odeke 2da1a63288
Merge PR #6667: codec: remove unused, untested and expensive MarshalIndentFromJSON 2020-07-09 14:28:27 -04:00
colin axner 03fdc9d744
x/ibc: update error messages (#6659)
* update errors in 02-client

* update errors in 03-connection

* update 04-channel errors + fixes to 03 changes

* update ibc handler errors

* tm, commitment, and verify error updates

* update ics20

* remove unnecessary wrapping

* fix various build issues
2020-07-09 12:06:08 -04:00
Alessio Treglia a940214a49
testutil cleanup and reorg (#6658)
Prepare migrating testing auxiliary functions from tests
to testutil.

Remove local duplicates on testutil.WriteToNewTempFile().

Always favor testutil.NewTestCaseDir() over ioutil.TempDir().

Add test cases for the testing auxiliary functions.
2020-07-09 14:21:20 +02:00
Amaury Martiny f8df05f6f1
x/upgrade: Refactor CLI to use protobuf query (#6623)
* x/upgrade: Refactor CLI to use protobuf query

* Import lint

* Use table tests

* Small tweak in setup

* Address bez cli refactor

* Address fede's review

* Remove useless func args

* Add back clientCtx to tx command

* Update comments

* Update docs

* Small refactor

* remove Init()

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-08 22:00:56 +00:00
Jonathan Gimeno a417b38926
Remove viper in Staking module. (#6631) 2020-07-08 22:00:34 +02:00
Alexander Bezobchuk b25e3fc76d
Merge PR #6651: More CLI cleanup 2020-07-08 13:57:45 -04: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
Marko a459b785d6
run sims on master (#6648) 2020-07-08 17:50:01 +02: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
Federico Kunze 3fc5a4dfc6
x/ibc: update CLI queries (#6647) 2020-07-08 10:57:42 -04:00
Alessio Treglia 67be012e3f
x/genutil: use HomeDir stored in ClientCtx (#6646)
Follow-up of #6636
2020-07-08 16:41:46 +02:00
Alexander Bezobchuk 33decc9779
Remove context param (#6645) 2020-07-08 14:25:02 +00:00
Marko a9da918f98
ci: codecov revert to 1.0.7 (#6642)
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-07-08 13:18:54 +02: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
Federico Kunze e6bb2e7ed7
x/ibc: refactor CLI (#6639)
* x/ibc: refactor CLI

* refactor client CLI

* rename version ClientName

* Update x/ibc/09-localhost/client/cli/cli.go

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

* address comments from review

Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
2020-07-08 05:57:59 -04:00
Marko e50c8df10c
ci: bump codecov (#6638) 2020-07-08 11:03:23 +02:00
Alexander Bezobchuk 3de1c7d4fd
x/crisis: In-Process CLI Integration Tests (#6634)
* init commit

* fix tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-07-08 08:23:34 +00:00
Ethan Buchman 83e71049e6
x/genutil: fix HomeFlag (#6636)
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-07-08 09:02:04 +02:00
Jonathan Gimeno c41b787e06
Merge PR #6626: Remove viper from genutil tests 2020-07-07 14:19:32 -04:00
Alessio Treglia 86243f6a8c
fix docs build failure (#6633) 2020-07-07 19:56:01 +02:00
Alessio Treglia 57ac28c814
client/flags: remove NewCompletionCmd() (#6632)
The functionality was adopted tendermint upstream, see
* https://github.com/tendermint/tendermint/pull/4665
2020-07-07 19:29:30 +02:00
Alexander Bezobchuk bc261d9e83
version: Remove Viper (#6628)
* version: remove viper

* Remove home flag gets

* fix: tests
2020-07-07 17:20:09 +00:00
Alessio Treglia 57ffe14631
Makefile: build simd with ledger support (#6629)
Makefile: parse COSMOS_BUILD_OPTIONS

Look for build options in the make's COSMOS_BUILD_OPTIONS
variable. This allows one to build simd with ledger support.

References:
* https://github.com/cosmos/gaia/pull/363
* https://github.com/tendermint/tendermint/pull/4738

fix tiny typo in nolint: statement that causes golangci-lint to
misbehave.
2020-07-07 19:10:11 +02:00
colin axner 9a029aea04
refactor connection keeper_test (#6622)
* refactor first set of keeper

* finish cleaning up keeper tests

* fix build

Co-authored-by: Aditya <adityasripal@gmail.com>
2020-07-07 16:29:47 +00:00
colin axner b4a027cb5d
update consensus height check (#6625)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-07-07 15:45:30 +00:00
Alexander Bezobchuk 8670a10564
Merge PR #6595: Single Binary & Command Refactor 2020-07-07 11:40:46 -04:00
Alessio Treglia ebf1583462
tests: cleanup unused functions (#6627)
Gut unnecessary test helpers.
2020-07-07 17:15:30 +02:00
Federico Kunze 0fd559e42d
x/ibc: minor fixes (#6621) 2020-07-07 07:33:06 -04:00
Federico Kunze be194ca1b7
docs: improve IBC guide (#6472)
* docs: improve IBC guide

* remove module specs

* capability spec

* update capability spec

* move cap to concepts

* remove module specs

* split IBC section

* wip integration.md

* complete integration.md

* format integration.md

* docs updates

* Apply suggestions from code review

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

* fix Next links

* further readings

Co-authored-by: colin axner <25233464+colin-axner@users.noreply.github.com>
2020-07-07 06:19:36 -04:00
Aditya 7fdcdc18e0
Enforce Connection Features on Channel Opening (#6620)
* add channel open checks for supported feature

* add tests and fix bugs

* fix version tests

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-07 10:00:12 +00:00
colin axner f163ec6765
refactor ibc ante_test (#6610)
* remove old code from ante test

* add recv packet test

* add acknowledge test

* add timeout tests

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-07 08:30:23 +00:00