Commit Graph

334 Commits

Author SHA1 Message Date
Christopher Goes a6dd96db4d Merge branch 'develop' into cwgoes/a-random-walk-down-proof-of-stake 2018-07-17 02:23:10 +02:00
Dev Ojha 4b688992ba Merge pull request #1691: Table driven test indexes
* types: Switch table driven test error messages to new format

Make table driven tests in /types follow the format described in #1664

* typos / lower case errors

* lower case, not sentences

* lower case, not sentences
2018-07-16 14:42:28 -04:00
Christopher Goes 405bb538fc Merge branch 'master' into cwgoes/a-random-walk-down-proof-of-stake 2018-07-14 02:09:41 +02:00
Rigel 3231daa4d8 remove global shares (#1644)
* wip removing pool shares

* remove PoolShares/Tokens entirely

* worked through stake/type compile error

* work through a bunch of keeper errors

* worked through compile errors

* debugging tests

* resolve compilation error

* resolved types errors

* ...

* move inflation to pool type

* ...

* stumped problem

* Calculate newly issued shares, remove unnecessary pool arg from exchange rate calculation

* Rounding changed

* Update x/slashing tests for sdk.Rat BondedTokens

* testing fixes

* resolved test fixes

* cwgoes comments, changelog, lint

* cli bugfixes

* ..

* cli fixed

* spec update

* 'make format'

* cwgoes comments

* Increase test_cover parallelism
2018-07-13 21:46:14 +01:00
Jeremiah Andrews 43b9cc6df0 Merge PR #1533: Pruning Cleanup 2018-07-13 03:20:26 +02:00
Alexander Bezobchuk 5983a07fb6 Merge PR #1599: Implementation of TraceKVStore 2018-07-13 01:58:51 +02:00
Ethan Buchman c6827dfb43 fix post merge 2018-07-10 21:40:24 -04:00
Christopher Goes 940cfa98af Invariants & random Msgs in progress 2018-07-11 02:36:50 +02:00
Ethan Buchman 3f44589861 Merge branch 'develop' 2018-07-10 20:31:05 -04:00
Christopher Goes 5a56c3f03d
Merge PR #1575: ready-for-review: sdk.AccAddress natively bech32 2018-07-10 04:18:23 +02:00
ValarDragon 17b5370c22 Continue fixing gocyclo errors 2018-07-09 16:08:35 -07:00
Sunny Aggarwal 896cd333f0 address comments 2018-07-09 16:06:05 -07:00
ValarDragon 0c5358c267 Continue reducing code complexity:
* Adds a Min function to Int, and uses that in the slash function
* Adds a getHeight helper function to iavlstore
* Adds a splitPath function to baseapp
* Changes cyclo param from 10 to 11
2018-07-09 15:29:16 -07:00
sunnya97 7ac220beb6 asdf 2018-07-09 00:59:51 -07:00
Sunny Aggarwal 50ed0fa1ae asdf 2018-07-09 00:35:28 -07:00
sunnya97 e894fbe4b6 in progress 2018-07-09 00:30:37 -07:00
ValarDragon 611e4faa3a gaiad: Genesis txs now use bech32 encoding of address and pubkey
* `gaiad init gen-tx` makes the outputted file use bech32, with acct prefix
* `gaiad init --gen-txs` only reads bech32 with acct prefixes

The reason for using the account prefix is that in principle you could
have genesis transactions for non-validators.

Closes #1475
2018-07-07 14:23:19 -07:00
Liamsi b7f902fba5 sort *all* GetSignBytes:
- call MustSortJSON before return JSON bytes to guarantee alphabetic
ordering

- moved SortJSON and MustSortJSON to types package to avoid cyclic
package dep
2018-07-06 01:12:57 +01:00
rigelrozanski aed3a87366 address cwgoes comments 2018-07-04 17:07:06 -04:00
Yukai Tu f1194019cd Merge PR #1534: Check new rat decimal string length 2018-07-04 05:29:05 +02:00
Ethan Buchman a6dc81defa minor cleanup of feeKeeper 2018-07-03 00:08:00 -04:00
Ethan Buchman 673086f621
Merge branch 'develop' into davekaj/set-fee-collection-keeper 2018-07-02 20:43:33 -04:00
Ethan Buchman f78f30c67a update for tm v0.22.0. tmlibs->tendermint/libs 2018-07-02 16:34:06 -04:00
Dev Ojha 6a864923fa types: Rename rational.Evaluate to rational.Round (#1487)
* rational.Evaluate -> rational.RoundInt64
	* rational.EvaluateInt -> rational.RoundInt

This done to improve clarity of the code.

Closes #1485
2018-07-02 11:57:33 -04:00
Christopher Goes 3654579ea7
Merge PR #1278: Slashing v2
Implement semifinal Gaia slashing spec (#1263), less #1348, #1378, and #1440 which are TBD.
2018-06-30 05:34:55 +02:00
Dev Ojha 955a0c9af7 Switch asserts to require (#1483)
* meta: Switch the majority of asserts to require

Switch most assert statements to require, to ease debugging.
Closes #1418

* Fix imports
2018-06-30 03:10:15 +02: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
David Kajpust 0a76035398 fee collection now works in gaia 2018-06-29 09:37:14 -04:00
Ethan Buchman a88b6b9c97
Merge pull request #1376 from cosmos/bucky/docs-core
docs via example apps
2018-06-29 02:07:06 -04: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
Ethan Buchman e8946e9b36 fixes from review 2018-06-28 19:06:37 -04: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
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 3dc2387124 Merge PR #1404: Add more context for errors when no address is provided 2018-06-27 19:39:57 +02:00
Ethan Buchman b3b075cc12 finish docs for app1 2018-06-27 07:15:30 -04: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
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
Jae Kwon 7487f67346 Use new tmlibs/common.Error for sdk.Error 2018-06-25 16:44:09 -04: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
Joon ec6acda6a4 Merge PR #1331: Remove TxBytes from NewContext 2018-06-22 03:03:05 +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
Joon 3fa68249eb Merge PR #1254: Add prefixstore and lib refactor
* Merge pull request #1254: add prefixstore and lib refactor
add prefixstore
refactor lib
fix test
fix linter
in progress
in progress
add test for prefixstore
add KVStoreGetter, PrefixStoreGetter
move PrefixStoreGetter to types/
add tests
KVStore.Prefix(string) -> KVStore.Prefix([]byte)
fix mock
apply requests
pass lint, add test
apply requests
* Remove unnecessarily 'valid' boolean
2018-06-21 23:33:36 +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
Ethan Buchman c4a70f683c Merge branch 'aditya/guide' into develop 2018-06-16 17:46:59 -07:00
Ethan Buchman a77ac582a3 note on iterators 2018-06-16 17:45:48 -07: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