Commit Graph

265 Commits

Author SHA1 Message Date
Dev Ojha 097dd8a164 tools: Add unparam linter (#1443)
* tools: Add unparam linter

unparam detects unused parameters in functions, and a parameter to
a function which only ever takes on one value. The latter is an
indication that more tests are required.

There are many nolints in this PR, as I believe that writing tests
to fix alot of these situations is out of scope for this PR / it
will be changed in future commits. There are some nolints for
when we have to comply to normal api's.

* crypto/keys no longer used by x/gov/client/rest/rest.go
2018-06-29 18:22:24 -04:00
Dev Ojha 47e4682d9f Merge PR #1415: x/stake: Limit the size of rationals from user input
* x/stake: Limit the size of rationals from user input

This commit sets the maximum number of decimal points that can be
passed in from messages. This is enforced on the validate basic of
MsgBeginUnbonding and MsgBeginRedelegation. The cli has been
updated to truncate the user input to the specified precision. This
also updates types/rational to return big ints for Num() and Den().

Closes #887

* Switch NewFromDecimal to error instead of truncating
2018-06-29 22:30:12 +02:00
Dev Ojha b66a5cc853 Merge PR #1455: tools: Add make format
This adds a command to automatically fix gofmt and misspell errors.
2018-06-29 09:37:16 +02:00
Christopher Goes 59aadf42aa
Ledger integration (#931)
Merges the keybase and Ledger code from go-crypto (which is no more) into the SDK
Adds support for Ledger into gaiacli
Cherry-picks updated error handling from #1158
2018-06-29 02:54:47 +02:00
Dev Ojha ac3adff1e8 Merge PR #1438: Tools: Add errcheck linter
This linter ensures that all errors are checked.
This is disabled in the client directories, since its not needed on
those writes
2018-06-29 00:52:10 +02:00
David Kajpust 090aaf8137 Merge #1412: Add async flag and functionality to gaiacli send
* added async functionality to gaiacli
* addressed requested changes, updated changelog
2018-06-28 21:23:47 +02:00
Dev Ojha 3e14868bd6 Merge PR #1429: tools: Add ineffassign linter
* tools: Add ineffassign linter

This errors on assignments that don't actually do anything. i.e.

x, err := myFunc(1)
y, err = myFunc(2)

This will call out that the first function's call error was never
used.

* Fix makefile, add misspell to makefile
2018-06-28 19:12:02 +02:00
Dev Ojha 2755c66545 Merge PR #1424: tools: add unconvert linter
unconvert checks for unnecessary type conversions
2018-06-28 18:08:29 +02:00
Dev Ojha 6d9f07dfee tools: Add go vet as a linter (#1421)
* tools: add go vet

* tools: Add go vet as a linter
2018-06-27 20:32:06 -04:00
Sunny Aggarwal 4effa6f8d4 Merge PR #1357: RESTful governance endpoints
* get deposit rest endpoint
* query proposals
* changelog
* fixed commented out headers
* fixed undeterministic tests
* increase circle test timeout
* MustBech32ifyAcc
* asdf
2018-06-28 01:49:59 +02:00
Aditya 9b4838d96e Merge PR #1367: Set ChainID on InitChain
* Added chain-id to context in InitChain
* Fix bug in test
* fmt
* Appease linter
* updated changelog
* Remove chainID hack
* setCheckState in InitChain
* Fix bug
* Fix initialization errors in example tests
* Initialize app tests with default stake genesis
* fix comments
2018-06-28 00:45:10 +02:00
Dev Ojha 49f421db19 Merge PR #1332: benchmarks: Add benchmark for block time to bank module
* benchmarks: Add benchmark folder, and single benchmark for block time
* Move benchmark into module
* Fix merge conflict errors
* Fix spelling
* Add instructions to run benchmark
* Update auth_app_test.go
2018-06-28 00:33:56 +02:00
Joon 6018e719d2 Merge PR #1069: Oracle Module
fix prefixstore iterator
in progress
fix mock validator
fix NewContext
add to changelog
apply requests
fix mock
2018-06-27 19:21:12 +02:00
Rigel 6f140d7296 Merge PR #1119: Unbonding, Redelegation
* stake/fees spec updates
* staking overview.md revisions, moving files
* docs reorganization
* staking spec state revisions
* transaction stake updates
* complete staking spec update
* WIP adding unbonding/redelegation commands
* added msg types for unbonding, redelegation
* stake sub-package reorg
* working stake reorg
* modify lcd tests to not use hardcoded json strings
* add description update
* index keys
* key managment for unbonding redelegation complete
* update stake errors
* completed handleMsgCompleteUnbonding fn
* updated to use begin/complete unbonding/redelegation
* fix token shares bug
* develop docs into unbonding
* got non-tests compiling after merge develop
* working fixing tests
* PrivlegedKeeper -> PrivilegedKeeper
* tests compile
* fix some tests
* fixing tests
* remove PrivilegedKeeper
* get unbonding bug
* only rpc sig verification failed tests now
* move percent unbonding/redelegation to the CLI and out of handler logic
* remove min unbonding height
* add lcd txs
* add pool sanity checks, fix a buncha tests
* fix ante. set lcd log to debug (#1322)
* redelegation tests, adding query functionality for bonds
* add self-delegations at genesis ref #1165
* PR comments (mostly) addressed
* cleanup, added Query LCD functionality
* test cleanup/fixes
* fix governance test
* SlashValidatorSet -> ValidatorSet
* changelog
* stake lcd fix
* x/auth: fix chainID in ante
* fix lcd test
* fix lint, update lint make command for spelling
* lowercase error string
* don't expose coinkeeper in staking
* remove a few duplicate lines in changelog
* chain_id in stake lcd tests
* added transient redelegation
* 'transient' => 'transitive'
* Re-add nolint instruction
* Fix tiny linter error
2018-06-27 04:00:12 +02:00
Dev Ojha d6df6b07d1 Merge PR #1388: types/int: Switch Int, Uint to use pointers internally
* types/int: Switch Int, Uint to use pointers internally
This reduces the amount of pointer refs & derefs.
* Fix nil pointers on unmarshalling amino
* Fix elusive bug in marshalling with unitialized big int
* Remove debug code
* Switch big.rat to use pointers internally
2018-06-27 03:10:34 +02:00
Christopher Goes 8bdf06b9f6 Remove Viper from ante handler 2018-06-26 23:45:31 +02:00
7768 4f57a765ad Merge PR 1354: CLI: Show fractional in human-readable format
Fix https://github.com/cosmos/cosmos-sdk/issues/1353

before:
```
Shares: Status Bonded,  Amount: -6508168128760126341/-3308135364330552608
Delegator Shares: -6508168128760126341/-3308135364330552608
```
after:
```
Shares: Status Bonded,  Amount: 2.0000000000
Delegator Shares: 2.0000000000
```
2018-06-26 19:26:12 +02:00
Dev Ojha 9f30a90980 Merge PR #1374: types/rat: Fix overflowing in printing
This now uses the underlying golang big.rat's string function,
instead of casting to num and den which are int64s.

Closes #1258
2018-06-26 05:03:55 +02:00
Dev Ojha 893bb4027d Merge PR #1377: types: remove GetMemo from Tx
This method is an unneccessary requirement on Tx. Auth casts the Tx
to StdTx, so the memo can be obtained in previous usecases from
StdTx. This also makes it more clear for when something is
implementing StdTx vs Tx.

Resolves #1375
2018-06-26 04:37:21 +02:00
Dev Ojha f2a83a07f9 Merge PR #1366: tests: add method to wait for n blocks to pass
Adds a helper method to tests/util.go for waiting for N blocks to
pass. This is useful for situations when you need to wait for
multiple blocks to pass, but don't know the current block number.
In general, this is safer than using "wait for height", since the
block height could have advanced further than expected while the
test was running.

Resolves remaining point in #1283
2018-06-25 23:53:48 +02:00
Dev Ojha 2e97baabf6 Merge PR #1358: Fix typos and gofmt files
* Fix typos
* gofmt -s files
* Add mispellings and gofmt checks to circle CI
* circleci: Install misspell in the linting step
2018-06-25 20:23:17 +02:00
Dev Ojha eb097c4c5c Merge PR 1361: server: Use differing defaults from tendermint
When loading the config file, this now checks in the sdk if the file
already exists. If not, it writes a config with different defaults.
The defaults differ by having the profiler listen address set,
and increasing the receive / send rates.
2018-06-25 18:33:07 +02:00
Christopher Goes b098c0da74
Merge PR #1344: Swap parallelism: 4 to parallelism: 1 2018-06-22 22:58:48 +02:00
Dev Ojha 15bba919e2 Merge PR #1341: Switch gometalinter to stable
* Switch gometalinter to stable
* Delete empty folder
2018-06-22 22:08:50 +02:00
Sunny Aggarwal c3c570898d Merge PR #1340: Reverted ChangePubKey
* removed msgChangePubKey
* changelog
* removed setPubKey
2018-06-22 21:53:24 +02:00
Geet Kumar 17e5a48b65 Merge PR #1334: democli: fix account query
* democli: fix query account
* Update changelog
2018-06-22 20:50:36 +02:00
Dev Ojha 7f1169db4d Merge PR #1337: tools: Fix makefile install scripts
Previously, the install scripts weren't installing golint and gometalinter.
This commit fixes this, and installs tendermints linter, and the HEAD of
the gometalinter repository. Now make all should work.
2018-06-22 20:01:44 +02:00
Sunny Aggarwal dc2c8f900b Merge PR #1168: Governance MVP 2018-06-22 02:19:14 +02:00
Aditya f049a56376 Merge PR #1266: Multiple messages
* Started work on multiple msgs, types and x/auth tests pass
* Fix issues in x, examples, and baseapp
* Added baseapp tests for multiple msgs
* Documentation fixes
* Fix baseapp tests with sdk.Int
* Modify test
* Transaction handling is now atomic
* Fix test comment
* Minor doc fixes and code cleanup
* Added baseapp result changes
* Use address in validator update accumulation
* Started work on multiple msgs, types and x/auth tests pass
* Fix issues in x, examples, and baseapp
* Added baseapp tests for multiple msgs
* Documentation fixes
* Fix baseapp tests with sdk.Int
* Modify test
* Transaction handling is now atomic
* Fix test comment
* Minor doc fixes and code cleanup
* Added baseapp result changes
* Use address in validator update accumulation
* Added ante tests for multisigner
* Remove validatorUpdates from tx result
* Better error logs
* Put Memo in StdSignBytes and formatting
* Updated changelog
2018-06-22 00:05:25 +02:00
Fabian 4884747662 Merge PR #1317: Added tx hash to query output in LCD
* added tx hash
* changelog
2018-06-21 19:21:58 +02:00
Dev Ojha e2d23040a8 Merge PR #1325: Refactor Complete Setup to not take in a testing parameter
* Refactor Complete Setup to not take in a testing parameter
* Update changelog
2018-06-21 18:55:08 +02:00
Christopher Goes 918e217e1f
Merge PR #1280: Implement simple transaction memos
* AltBytes -> Memo, memo CLI support & thread-through
* Check memo size, update changelog
* Update existing testcases
* Nuke CircleCI caches
* Charge gas proportional to memo size
* Fix gas allocations in ante handler testcases
* Add testcases
* Update changelog
* Fix tiny CLI bug & add to CLI tests
* Add '--memo' to gaiacli
* Add testcase for large memos
* Address PR comments
2018-06-20 21:27:36 +02:00
Christopher Goes 2a9bc2153a Merge pull request #1310: Fix x/bank REST handler
* Update sendtx.go

* Pass chain_id through in LCD tests

* Update changelog
2018-06-20 10:34:12 -07:00
Dev Ojha 0292a3b4d9 Merge PR #1291: Delete unused tests
* Tweak retry logic on waitForHeight
* Add HTTP retry logic to LCD tests
* Simplify waitForHeight changes
* Update changelog
* Add 'make test_cli_retry', 'make test_unit_retry'
* Run test_cli_retry in CI
* Delete unused tests
2018-06-20 00:29:54 +02:00
Dev Ojha 1f88b0bf8f Merge PR #1281: Don't run defers if it would result in an NPE
* Don't run defers if it would result in an NPE
* Nuke CircleCI caches
2018-06-16 09:49:55 +02:00
Joon 314b5a854d Merge PR #1218: sdk.Int in sdk.Coin
implement Int, Int256, Uint256
pass ci
pass ci
add to changelog, add boundcheck to test
add comments, fix cli_test.go
fix errors
apply requested changes
panics on New*WithDecimal
fix Int.BigInt()
fix stake tests
* Panic on uint division-by-zero
* Set ok=false on NewIntFromString, NewUintFromString failure
* Nuke CircleCI caches
2018-06-15 23:16:45 +02:00
Greg Szabo b66f6475ef No-change change to trigger CircleCI 2018-06-14 15:25:34 -07:00
Greg Szabo f8290a0fc3
Merge branch 'develop' into greg/testnet-command-2 2018-06-14 11:34:26 -07:00
Ethan Buchman 1cac5e7a0f Merge branch 'develop' into rigel/spec-staking 2018-06-14 11:22:29 -07:00
Fabian 42e72956f4 Merge PR #1252: Query node version
introduce non store queries
add version query
update lcd spec
changelog
moved version query into baseapp
2018-06-14 07:49:21 +02:00
rigelrozanski 14c1ff27f3 Merge remote-tracking branch 'origin/develop' into rigel/spec-staking 2018-06-13 20:50:59 -07:00
Greg Szabo 17e88a5e00 Fixes requested by Rigel: GenTx, config package name 2018-06-13 17:30:16 -07:00
Dev Ojha bd362ee590 Merge PR #1090: Switch away from ephemeral ports
* Switch ports 4665x to be 2655x
This is done so the default ports aren't in the linux kernel's default ephemeral port range.
* Missed one doc file, change dep so gaiad works
* Update changelog, fix Gopkg.lock
2018-06-14 00:13:51 +02:00
Greg Szabo 73b0b489cf
Merge branch 'develop' into greg/testnet-command-2 2018-06-13 09:28:04 -07:00
Ethan Buchman 1b7396d487 dev version bump 2018-06-13 01:34:51 -07:00
Christopher Goes 65786e4578
Update version.go & changelog 2018-06-13 10:05:50 +02:00
Ethan Buchman 3e07519d58
Merge pull request #1237 from cosmos/bucky/gaiadebug-merge-master
Bucky/gaiadebug merge master
2018-06-13 01:01:03 -07:00
Christopher Goes 219a16c6de Revert "Merge PR #1232: Bucky/gaiadebug"
This reverts commit 37bba35c91.
2018-06-13 09:57:54 +02:00
Ethan Buchman 37bba35c91 Merge PR #1232: Bucky/gaiadebug
* update to tm v0.19.6
* update tm to 0.17.4
* update for tm v0.19.9
* update godep
* Merge PR #1195: gaiacli - Add error message for when account isn't found
* Add --gas flag to specify gas limit for a transaction
* lawl viper
* version and changelog
* add cmd/gaia/testnets folder to deprecate cosmos/testnets repo
* cmd/gaia/testnets: update status.md with recent history
* cmd/gaia/testnets: update versions, use a working seed
* readme points to testnet folder
* add fixes from billy
* fix status.md
* seed->seeds
* readme improvements
add link to official faucet, remove sequence from cmds
readme improvements
wording improvements and simplifications
add link to cosmos explorer
remove instances of candidate
add apostrophe
small fixes
improve the installing software section
fixes based on feedback
add note about querying an empty account
remove panic note
update introduction
add full cp path for copying genesis.json
update moniker warning
remove redundant sections
add error message when querying empty account
don't need a link to golang.org
link to sections, better section names
fix section link
reorganize sections
add h3s
remove & symbol
add whitespace
update h3 to h2
add note about explorer not connecting to every node
* testnets: minor readme update
* gaiadebug tool
* gaiadebug: add hack command
* fix from merge
* gaiadebug: raw-bytes command
* fix from merge
2018-06-13 09:44:46 +02:00
Rigel 83c1183e25 Merge PR #1233: Inflation now unbonded
working debug fix
add broken test
fix testnet bug
updated provision test
changelog
cwgoes comments
2018-06-13 09:12:57 +02:00
Ethan Buchman 85c7702ca0 Merge branch 'master' into local/develop 2018-06-12 22:40:54 -07:00
Greg Szabo 61dc65e3cf Changelog fix 2018-06-12 21:27:26 -07:00
Greg Szabo 072d422da6
Merge branch 'develop' into greg/testnet-command-2 2018-06-12 11:26:58 -07:00
Greg Szabo 4c5e536b31 Added testnet command and localnet targets
Finished testnet command and introduced localnet targets in Makefile, together with gaiadnode Docker image

Fixed function parameter list - now starts with ctx

Separated GenTxConfig into a server/config package so both the server package and the mock package can use it

Adding server/config to app package

gaiadnode Docker image

Separated GenTxConfig into a server/config package so both the server package and the mock package can use it

Adding server/config to app package

Fixes requested by Rigel

Removed commented code

Global flag fixes
2018-06-12 11:25:03 -07:00
Rigel dc62279ae1
Merge pull request #1200 from cosmos/cwgoes/slashing-bugfixes
Slashing bugfixes (start height, handler registration)
2018-06-11 20:12:02 -07:00
Sunny Aggarwal 161cb474d4 Account Numbers for Replay Protection with Account Pruning (#1077)
* in progress
* passes current tests
* added tests and got working
* changelog and docs
* removed prints
* oops
* works!
* issue in test_cli
* number 9 number 9 number 9
* at least it does only the 9 issue now
* hallelujah it works!
* removed print statement
* rebased
* gah
2018-06-12 04:30:54 +02:00
Rigel 1b20adcd22 Merge PR #1191: LCD cleanup / add LCD gas field
* remove global variables from lcd
* added make race, fix lcd race condition
* cleanup
* Five-character changelog update
2018-06-12 03:12:37 +02:00
Fabian 8ece807301 Merge PR #1085: Re-enable tx history in LCD
* reenable tx search
* removed not needed argument
* register types for decoding
* trying to fix indexing tests
* added tx hash query test
* Fix x/bank tagging
* remove dead code
* remove print
* extended tests for tx querying
* changelog
* added txs address querying
* linted
* rename
* use prefix for bech32 addresses in tags
* changed error message
* Fix tiny linter issue
2018-06-11 22:09:29 +02:00
Christopher Goes 2d2b57261c
Update changelog 2018-06-11 02:59:36 +02:00
Ethan Buchman cb6534a8f8 version and changelog 2018-06-09 09:32:59 -07:00
Christopher Goes c6796b8fba Add --gas flag to specify gas limit for a transaction 2018-06-09 09:31:59 -07:00
Dev Ojha aaaa0e16a2 Merge PR #1195: gaiacli - Add error message for when account isn't found 2018-06-09 09:31:22 -07:00
Ethan Buchman be340d2edd
Merge pull request #1189 from cosmos/bucky/merge-master
Bucky/merge master
2018-06-09 09:15:14 -07:00
Christopher Goes d47b7cf5fa
Add --gas flag to specify gas limit for a transaction 2018-06-09 08:51:31 +02:00
Dev Ojha 9c4bbf7dfd Merge PR #1195: gaiacli - Add error message for when account isn't found 2018-06-09 08:40:22 +02:00
Ethan Buchman a277ba91c7 Merge PR #1178: Merge master (Tendermint updates)
* update to tm v0.19.6
* update tm to 0.17.4
* update for tm v0.19.9
* update godep
2018-06-09 06:34:27 +02:00
Ethan Buchman 2913d14239 Merge branch 'master' into develop 2018-06-08 19:31:48 -07:00
Rigel 0b9751ac98
Merge pull request #1170 from cosmos/rigel/test_framework
mock test framework for modules
2018-06-08 13:30:24 -07:00
rigelrozanski 42def02ae9 pr comments 2018-06-08 10:03:37 -07:00
rigelrozanski 61a510ed08 ... 2018-06-07 21:46:27 -07:00
rigelrozanski b5d847288d move original mock into server 2018-06-07 21:33:06 -07:00
rigelrozanski 40f5928898 changelog 2018-06-07 20:59:35 -07:00
Christopher Goes 34ec53a761
Update CHANGELOG.md, update x/auth to avoid base64 2018-06-08 01:50:59 +02:00
Christopher Goes 3fbee11ccc
Merge PR #1142: Export validators to genesis
* Validator export skeleton
* Update export command, add tests, update CHANGELOG
* Rename exportAppState to exportAppStateAndTMValidators
2018-06-06 18:38:13 +02:00
Fabian 5f409ce832 Merge PR #1086: Bech32Cosmos output/input for the LCD
* refactored bech32ization
* updated keys endpoints for bech32
* bech32 for sending and querying
* trying to change output of validator addresses
* fixed validator output
* linted
* fixed merge conflict
* added bech32 to staking endpoints
* removed some logging statements
* added GetAccPubKeyBech32Cosmos
* fixed cli tests
* updated swagger
* merged standard bech32 change
* renamed bech32cosmos to bech32
* bech32ify json output for key add
* readded changelog
* fixed changelog merge issue
* Update CHANGELOG.md
2018-06-06 06:53:04 +02:00
Adrian Brink af15f89531 Update changelog for 0.18.0 (#1149) 2018-06-06 06:34:19 +02:00
Ethan Buchman f3f2729b11 update for tm v0.19.9 2018-06-05 18:04:16 -07:00
rigelrozanski 605dfbbe54 changelog, update spec README 2018-06-05 09:23:23 -07:00
Jeremiah Andrews 91c8962740 changelog 2018-06-04 18:38:50 -07:00
rigelrozanski 0ef3259a39 revised use of EndBlock/BeginBlock, basecoin updated for staking/slashing 2018-06-01 14:24:48 -07:00
rigelrozanski 7ce9e000b6 update changelog, minor update 2018-06-01 00:53:54 -07:00
rigelrozanski 4150fe5ec9 update changelog 2018-05-31 15:02:24 -07:00
rigelrozanski 952aedc4f1 get rid of candidacy references 2018-05-31 14:57:09 -07:00
Christopher Goes 12a7c0373a
Merge pull request #1072 from ValarDragon/dev/tx_encoding
Change to go-wire UnmarshalJSON for bank transactions
2018-05-31 23:51:27 +02:00
ValarDragon 0371109039 Register crypto on amino codecs, update changelog 2018-05-31 12:55:21 -07:00
Ethan Buchman 36b3e530ab update tm to 0.17.4 2018-05-31 09:31:42 -04:00
Rigel 1c462013a9
Merge branch 'develop' into matt/stake-rest 2018-05-30 10:53:12 -04:00
Ethan Buchman 5b2a5c948c update to tm v0.19.6 2018-05-29 12:54:02 -04:00
ValarDragon 2d87563856 Change to go-wire UnmarshalJSON for bank transactions
The bank module now uses it's own codec to encode and decode Bank Msgs
into JSON.
2018-05-28 11:26:43 -07:00
Zaki Manian 4fd998c669
Merge branch 'develop' into bech32cosmos 2018-05-27 19:14:15 +02:00
Zaki Manian ca9af7462a Update change log 2018-05-27 14:51:19 +02:00
Matt Bell 5c1a7694e5 Merge branch 'develop' into matt/stake-rest 2018-05-27 16:02:33 +09:00
sunnya97 c057a71f5b changelog 2018-05-26 18:05:21 -07:00
Rigel ae82931b7c
Merge pull request #1049 from cosmos/std_to_auth
Move stuff from types to auth
2018-05-26 04:43:27 -04:00
rigelrozanski 92356b7d9b changelog update 2018-05-26 04:36:05 -04:00
Fabian 2efb637f81
Merge branch 'develop' into matt/stake-rest 2018-05-25 09:54:44 +02:00
Bill Ip 87a696e490 updated changelog 2018-05-25 09:33:08 +08:00
Christopher Goes 02bf73b94d
Rebase, fix changelog 2018-05-25 03:03:18 +02:00
Greg Szabo c920d9a69c
Updated CHANGELOG.md 2018-05-25 03:03:18 +02:00
Matt Bell ae9a9eaaa3 Updated changelog 2018-05-25 09:32:37 +09:00