Commit Graph

7209 Commits

Author SHA1 Message Date
Anil Kumar Kammari ca7b31dd5d
Register swagger API (#7246)
* init

* Fix statik gen

* Fix swagger

* Change swagger url

* Fix swagger serve

* remove ibc swagger from legacy docs

* Add old routes config

* Move swagger api to app.go

* add godoc

* Fix inputs

* Fix swagger dir

* Fix statik

* refactor

* fmt

* fix doc

* Fix swagger config check
2020-09-19 00:34:56 +00:00
Alessio Treglia d6357e77b4
use *testing.T.TempDir() in tests (#7346) 2020-09-18 17:56:27 +01:00
atheeshp 34bbf4d31c
Adds x/gov missing cli tests (#7128)
* WIP: adding missing cli tests

* fix command

* fixed vote tests

* udpated proposals test

* added test for single proposal

* WIP: gov cli tests

* added missing tests

* fixed tests

* Fix test

* added test for query proposals

* refactor

* refactor

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
2020-09-18 14:26:46 +00:00
Alessio Treglia 3e616a60d5
replace testutil.NewTestCaseDir() with Go1.15's T.TempDir() (#7014)
Override go's default version with go 1.15.
2020-09-18 12:08:24 +01:00
atheeshp 2715af34a2
Registers grpc routes for `x/gov` (#7216)
* Registers grpc routes for x/gov

* added todos

* order

* lint

* added norace build flag

* new line

* review changes

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-09-18 10:06:26 +00:00
Aditya 7b1efcb8ae
Fix QueryUnreceivedPackets/Acks (#7320)
* fix queries

* proto stuff

* rebuild proto-tools off old makefile

* rm buf-stamp

* fix godoc

* rename and fix implementation of UnreceivedAcks

* lint

* Update proto/ibc/channel/query.proto

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

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

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

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-09-18 09:56:20 +00:00
Marie 23578a9612
Remove old PubKeyMultisigThreshold (#7284)
* WIP on protobuf keys

* Use Type() and Bytes() in sr25519 pub key Equals

* Add tests

* Add few more tests

* Update other pub/priv key types Equals

* Fix PrivKey's Sign method

* Rename variables in tests

* Fix infinite recursive calls

* Use tm ed25519 keys

* Add Sign and VerifySignature tests

* Remove ed25519 and sr25519 references

* proto linting

* Add proto crypto file

* Implement some of the new multisig proto type methods

* Add tests for MultisigThresholdPubKey

* Add tests for pubkey pb/amino conversion functions

* Move crypto types.go and register new proto pubkeys

* Add missing pointer ref

* Address review comments

* panic in MultisigThresholdPubKey VerifySignature

* Use internal crypto.PubKey in multisig

* Add tests for MultisigThresholdPubKey VerifyMultisignature

* Only keep LegacyAminoMultisigThresholdPubKey and move to proto keys to v1

* Remove conversion functions and introduce internal PubKey type

* Start removal of old PubKeyMultisigThreshold references

* Remove old secp256k1 PubKey and PrivKey

* Uncomment test case

* Fix linting issues

* More linting

* Revert tests keys values

* Add Amino overrides to proto keys

* Add pubkey test

* Fix tests

* Use threshold isntead of K

* Standardize Type

* Revert standardize types commit

* Add comment

* Simplify proto names

* Fixed merge issues

* Uncomment tests

* Remove old multisig

* Add amino marshal for multisig

* Fix lint

* Correctly register amino

* One test left!

* Remove old struct

* Fix test

* Fix test

* Unpack into tmcrypto

* Remove old threshold pubkey tests

* Fix register amino

* Fix lint

* Use sdk crypto PubKey in multisig UnpackInterfaces

* Potential fix?

* Use anil's suggestion

Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-09-18 09:40:39 +00:00
atheeshp 9cb27fb171
Adds missing cli tests in x/staking (#7158) 2020-09-17 14:43:38 +01:00
Alessio Treglia 92cd5884aa
ci: fix liveness test job (#7335)
Add build-simd-linux to make's command line.
2020-09-17 13:55:07 +01:00
Alessio Treglia 36d30f9e83
reintroduce rule to cross-build a linux binary (#7334)
closes: #7333
2020-09-17 10:08:20 +01:00
Cory 62b4aa9a14
Fix sequence number handling for LegacyAmino > SignatureV2 (#7285)
* add multi-sequence ante_test with explicit amino, test out alternative without SkipSequenceCheck

* add attempt at rest based test for full transactions

* drop extraneous ante_handler explicit amino test

* add rest handler test for multiple broadcasts, remove SkipSequenceCheck flag

* add godoc & cleanups

* add test case for incorrect sequence number

* remove artifact files

* Update x/auth/ante/sigverify.go

Co-authored-by: Zaki Manian <zaki@manian.org>

* Update sigverify.go

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Zaki Manian <zaki@manian.org>
2020-09-16 19:35:20 +00:00
Robert Zaremba e4c67eddc7
Added glossary explaning Denomination Key (#7330)
When reading this ADR, I was confused about _denomination_. When reading this in context of tokens I always think about a unit / measure. Examples: bills denominated in $20 and $50. Or as 100 cents makes 1 dollar.

The Merriam-Webster dictionary defines [denomination](https://www.merriam-webster.com/dictionary/denomination) as:

1. an act of denominating. Eg: the denomination of prices in U.S. dollars
2. a value or size of a series of values or sizes. Eg: metric denominations
3. name, designation especially : a general name for a category

It seams that we are using the last definition (3rd).
2020-09-16 10:27:01 -07:00
Alessio Treglia 28347acad0
ci: remove unused update-qa job (#7329) 2020-09-16 16:53:03 +01:00
colin axnér b2d48a9e81
Merge PR #7327: remove resulting value return from AddCoins and SubtractCoins 2020-09-16 08:40:47 -04:00
Marie 320a852ee2
PubKey proto types (#7147)
* WIP on protobuf keys

* Use Type() and Bytes() in sr25519 pub key Equals

* Add tests

* Add few more tests

* Update other pub/priv key types Equals

* Fix PrivKey's Sign method

* Rename variables in tests

* Fix infinite recursive calls

* Use tm ed25519 keys

* Add Sign and VerifySignature tests

* Remove ed25519 and sr25519 references

* proto linting

* Add proto crypto file

* Implement some of the new multisig proto type methods

* Add tests for MultisigThresholdPubKey

* Add tests for pubkey pb/amino conversion functions

* Move crypto types.go and register new proto pubkeys

* Add missing pointer ref

* Address review comments

* panic in MultisigThresholdPubKey VerifySignature

* Use internal crypto.PubKey in multisig

* Add tests for MultisigThresholdPubKey VerifyMultisignature

* Only keep LegacyAminoMultisigThresholdPubKey and move to proto keys to v1

* Remove conversion functions and introduce internal PubKey type

* Remove old secp256k1 PubKey and PrivKey

* Uncomment test case

* Fix linting issues

* More linting

* Revert tests keys values

* Add Amino overrides to proto keys

* Add pubkey test

* Fix tests

* Use threshold isntead of K

* Standardize Type

* Revert standardize types commit

* Add comment

* Simplify proto names

* Add comment about multisig codec

Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-09-16 11:08:55 +00:00
Alessio Treglia d4266dcde8
update .gitignore (#7325) 2020-09-16 11:08:42 +01:00
Alessio Treglia d97f32e5f0
pipe go test -race output into tparse (#7309) 2020-09-16 10:31:14 +01:00
Cory 0d2599b922
add changelog entry for 0.39.1 (#7321)
Co-authored-by: Marko <marbar3778@yahoo.com>
2020-09-16 09:00:40 +00:00
puneet2019 a38e8fe103
Removing an incomplete sentence. (#7313)
I think the train of thoughts were interrupted here, removing it for completeness.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
2020-09-16 08:57:38 +00:00
Marko 41845021b7
ci: fix (#7323) 2020-09-16 10:54:54 +02:00
Aditya 984c2d4179
Retrieve Epoch from ChainID (#7280)
* add functions to parse epoch from height

* remove 0 epoch hardcoding

* fix tendermint tests

* fix tests

* start update docs

* progress

* better parsing of chainID

* fix update and misbehaviour logic and add tests

* update docs

* docfix

* Apply suggestions from code review

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

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

* change self checks to use epochs

* address rest of reviews

* rename epoch number to version in docs

* wrap up rest of TODOs

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

* add self validate test

* Apply suggestions from code review

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

* fix godoc

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-09-15 21:09:48 +00:00
colin axnér 5dc434fbca
Uncomment and fix tests in ibc-transfer (#7282)
* WIP fixing relay_test

* fix send and recv tests

* update ack tests

* update relay and tests

* comment test

* remove func and uncomment test

Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com>
2020-09-15 11:27:51 +00:00
Alessio Treglia 7ada179aef
enable -race on go test (#7305)
Introduce 'norace' build tag that is used to
filter out test files containing test cases
or test suites that, if run with the -race
flag on would cause race conditions.

Supersede #7300.
2020-09-15 10:43:46 +01:00
Jack Zampolin a8990eab71
Quick fixes for IBC (#7302)
* Fix page variable for querying consensus state of a node

* Add pointer where required

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-09-15 09:21:42 +00:00
dependabot[bot] 1d462c6b18
Bump github.com/magiconair/properties from 1.8.2 to 1.8.3 (#7308)
* Bump github.com/magiconair/properties from 1.8.2 to 1.8.3

Bumps [github.com/magiconair/properties](https://github.com/magiconair/properties) from 1.8.2 to 1.8.3.
- [Release notes](https://github.com/magiconair/properties/releases)
- [Changelog](https://github.com/magiconair/properties/blob/master/CHANGELOG.md)
- [Commits](https://github.com/magiconair/properties/compare/v1.8.2...v1.8.3)

Signed-off-by: dependabot[bot] <support@github.com>

* run go mod tidy

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-09-15 08:57:57 +00:00
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
Michael FIG 63c3a6eeca
feat: allow "any" to specify a "binary" with no arch/os deps (#7230) 2020-09-14 21:32:10 +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
Alexander Bezobchuk 7ae84898de
Merge PR #7265: Tendermint Block Pruning 2020-09-14 10:12:49 -04:00
Alessio Treglia 56e3bc1945
proto tools install script (#7294)
Follow up of #7266 (comment)

Replace the convoluted Makefile in contrib/devtools/
with a separate (almost) idempotent install script.
2020-09-14 14:30:12 +01:00
Erik Grinaker 5e16c215ba
test: fix data race in snapshots.ChunkReader test (#7299)
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-09-14 14:00:08 +01:00
Alessio Treglia f640ad6cea
Makefile: reorganise test rules (#7290)
Adding a new test suite is now as easy as write a oneliner.

Format test output with tparse if available:
 go get github.com/mfridman/tparse

Ref #7287
2020-09-14 13:00:33 +01:00
Alessio Treglia 46a8e94740
run make format && go mod tidy (#7298) 2020-09-14 12:42:09 +01:00
Alessio Treglia 6cd4ac9b50
baseapp: fix TestGRPCRouter (#7293) 2020-09-14 11:30:17 +01:00
dependabot[bot] c96867f3dd
Bump github.com/tendermint/go-amino from 0.15.1 to 0.16.0 (#7295)
Bumps [github.com/tendermint/go-amino](https://github.com/tendermint/go-amino) from 0.15.1 to 0.16.0.
- [Release notes](https://github.com/tendermint/go-amino/releases)
- [Changelog](https://github.com/tendermint/go-amino/blob/v0.16.0/CHANGELOG.md)
- [Commits](https://github.com/tendermint/go-amino/compare/v0.15.1...v0.16.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-09-14 09:29:41 +00:00
dependabot[bot] 201787bba3
Bump github.com/gorilla/handlers from 1.5.0 to 1.5.1 (#7296)
Bumps [github.com/gorilla/handlers](https://github.com/gorilla/handlers) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/gorilla/handlers/releases)
- [Commits](https://github.com/gorilla/handlers/compare/v1.5.0...v1.5.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-14 03:51:08 -03:00
Alessio Treglia c26ef79ed0
move client/testutil -> x/auth/testutil (#7292)
We should never break the
top-level-packages-do-not-depend-on-x-packages rule.
2020-09-14 03:21:29 +01:00
Alessio Treglia 606956b668
Reproducible buildsystem (#7247)
Provide a simple Docker-based mechanism for application
developers to provide reproducible builds. Unlike gaia's
current reproducible buildsystem, this does not depend on
external tools, e.g. `gitian-builder`.

`build-simd-linux` now builds `simd` in a deterministic
Linux container.
2020-09-13 20:55:35 +01:00
Anil Kumar Kammari cfb5fc03e5
Merge PR #7094: Add x/auth cli tests 2020-09-13 09:52:09 -04:00
Alessio Treglia f413d3a5d0
use os.UserHomeDir() to get user's home dir (#7288) 2020-09-13 12:18:02 +01:00
Alessio Treglia 9544718d7e
Merge PR #7286: simapp: merge node and client config directories
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-09-12 10:03:20 -04:00
Murthy Vitwit 1c3172576c
Add staking CLI tests (#7111)
* add cli test to GetQueryCmdValidator, Pool and Params methods

* modify TestGetQueryCmdValidator testcase

* add test script for GetQueryCmdValidators method

* added tests for x/staking delegation commands

* fix tests

* added tests for queries

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: atheesh <atheesh@vitwit.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-09-11 22:39:53 +00:00
John Adler 2bb9a241bb
ADR-027: Make rules more precise (#7220)
* Update changelog.

* Fix typos.

* Remove 'by default' from packed encoding rule.

* Further specify longer requirement.

* Clarify that bool must have value of 1 if included.

* Fix typo variant -> varint.

* Disambiguate rule 3.

* Add more reasoning for requirements on zeroes.

* Reword rules to make bit restrictions clearer. Add exception for negative int32.

* Add reference for signed integer encoding.

* Clarify rule for signed int requirement.

* Deterministic -> bijective.

* Normalize spacing in 'protobuf 3'.

* Add background to clarify 70 bits.

* Fix nit: all -> most.

* Clarify is -> must.

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-09-11 14:46:37 +00:00
Amaury Martiny c94fd4afc5
Return app_hash in InitChain (#7208)
* Return app_hash in InitChain

* Hash empty string
2020-09-11 14:22:18 +00:00
Alessio Treglia 32eccde501
cosmovisor: various small improvements (#7275)
{,cosmosvisor/}Makefile: Add Makefile to cosmovisor/
subdirectory and integrate build target into the
top-directory Makefile.

cosmovisor/:

Create Golang-idiomatic cmd/ subdirectory to make
`cosmosvisor` binary (instead of a binary named `cmd`)
automatically installable with `go get`.

Minor changes to error handling:

- Plain error strings bring more value than the whole
  stacktrace in case of dumb configuration errors.

- Output errors to /dev/stderr instead of /dev/stdout.

Remove dependency on github.com/pkg/errors.
2020-09-11 10:42:11 +01:00
Alessio Treglia d4b0e5baab
client: fix validator's command pagination default page (#7278)
Fix issue encountered in the stargate-2 testnet:

 Error: RPC error -32603 - Internal error: page should be within [1, 1] range, given 0

Co-authored-by: Helder Moreira <helder@tendermint.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-09-10 18:36:49 +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 d84296a5fc
add zero height (#7270)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-09-09 15:25:49 +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
Robert Zaremba 93dd06ad4c
Makefile: use go install in the build target (#7248)
go install also caches dependency packages and
it's faster than go build.

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-09-09 12:31:39 +01:00