* reset stalebot to only mark PRs as stale
* Update .github/workflows/stale.yml
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
* Formatting documents
* Fixing typos
* Update the intro document to the latest version
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
* Rename SimulateSubmitProposal to SimulateMsgSubmitProposal to keep naming convention the same as in other similar cases
* x/gov/simulation/operations.go: add unit tests
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
* remove unused functions
* create helper func to send tx
* refactor to use test help to send tx by client
* Commit before getting backend.
* Temporal commit
* temp commit
* remove the creation of txbuilder from cli
* fix imports
* update changelog
* Remove unused function.
* Add flag home into tx sign command.
* migrade TestCLIValidateSignatures to use new test suite
* migrate test one
* Add changes to make sign batch.
* make test pass
* refactor common logic
* First part of cli sign.
* Add test for sign batch.
* refactor a little and improve the test
* migrate broadcast command
* fix linter
* Remove printf for debug in bank module.
* Fix unused err var.
* fix linter
* fix test
* fix tests client
* Fix linter.
* Temp commit signature.
* encode tx
* migrate tests
* Fix imports.
* Remove changelog
* fix tests
* Fix tests.
* Update x/bank/client/testutil/cli_helpers.go
* Remove alias.
* Remove wait for N block func.
* export callCmd function into its own file.
* fix imports
* bring back to inner functions
* apply mock io
* the helpers use mockio
* fix bug
* Add Helpers.
* return to put the function in testutil package
* return BufferWriter in ExecTestCLICmd
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
* 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>
Noticed during my audit, the code for cache.CommitKVStoreCacheManager.Reset()
discarded the prior on every invocation i.e.
m = make(map[T(key)]T(value))
However, this can be made fast and conserve memory by using the map clearing idiom
that the Go compiler recognizes i.e.
for key := range m {
delete(m, key)
}
and turns into very fast code, instead of the extraneous map discarding.
The speed up generated is:
```shell
$ benchstat before after
name old time/op new time/op delta
Reset-8 204ns ± 2% 66ns ± 9% -67.86% (p=0.000 n=20+20)
name old alloc/op new alloc/op delta
Reset-8 384B ± 0% 0B -100.00% (p=0.000 n=20+20)
name old allocs/op new allocs/op delta
Reset-8 3.00 ± 0% 0.00 -100.00% (p=0.000 n=20+20)
```
Fixes#6681
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>
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
* 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>
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.
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.