Commit Graph

72 Commits

Author SHA1 Message Date
Jae Kwon
6325441861 txBld -> txBldr 2018-09-07 10:15:49 -07:00
Jae Kwon
acd125029d x/auth/client/context -> x/auth/client/txbuilder 2018-09-07 10:04:58 -07:00
Alessio Treglia
54b3b5c028
sed -i 's/txCtx/txBld/g' 2018-09-07 14:39:23 +01:00
Alessio Treglia
3b6da7af18
TxContext -> TxBuilder 2018-09-07 14:36:21 +01:00
Alessio Treglia
86395809cb
Implement generate-only option for commands that create txs
The new CLI flag builds an unsigned transaction and writes it to STDOUT.
Likewise, REST clients can now append generate_only=true to a request's
query arguments list and expect a JSON response carrying the unsigned
transaction.

Closes: #966
2018-09-04 02:32:05 +02:00
Alexander Bezobchuk
2d92803b9f Merge PR #2040: Refactor Validator Account Types/Bech32 Prefixing
* Add new account bech32 prefixes with godocs

* Restructure spacing of existing account code

* Update account godocs

* More account godoc updates + new tm pub/addr helpers

* Update validator type to use new account types/bech32 prefixes

* Fix account documentation errors

* Update Bech32 prefix for consensus nodes

* Update Bech32 spec doc

* Fix account type tests

* Add missing account consensus functions, clear up godocs, and fix tests

* Add to TestRandBech32PubkeyConsistency check

* Update initialization of validator public keys

* Update query signing info command

* Implement new ConsAddress type with associated unit tests

* [WIP] Update stake and slashing parameters

* Update all calls to MustBech32ifyValPub

* [WIP] Validator operator API updates

* [WIP] Fix and update unit tests

* Fix gov logs (helping to debug failing tests)

* Fix gov tally

* Fix all broken x/ unit tests

* Update gaia app genesis address logic

* Fix linting errors

* Fix broken LCD tests

* Fix broken CLI tests

* Implement command to get validator address and pubkey from key name

* Add support for getting validator key information via REST endpoint

* Update PENDING log

* Update docs

* Revert GaiaGenTx.PubKey bech32 prefix

* Fix broken docs and cli tests

* Update genesis to use correct Bech32 (cons) prefix for pubkeys

* Update docs and unit tests to reflect new cosmos account bech32 prefix

* minor formatting
2018-08-31 00:06:44 -04:00
Matthew Slipper
c6d692e27f Merge PR #2172: Use cobra.NoArgs where appropriate
Closes #885.
2018-08-28 12:59:42 -04:00
Federico Kunze
cfb5acca6e Merge PR #2099: Query staking Pool and Params 2018-08-21 17:32:54 +02:00
Ethan Buchman
af73b885e7 Merge branch 'develop' into bucky/merge-master 2018-08-19 16:24:45 -04:00
Alessio Treglia
187bc1972a Merge PR #1950: Validator.Owner -> .Operator
* Rename --address-validator flag to --validator

See #1901

* Update PENDING.md

* Rename Validator.Owner -> Validator.Operator

See #1901
2018-08-16 16:47:59 -04:00
Rigel
422dfa3de9
Merge pr #2051: smol compile bug 2018-08-15 18:35:17 -04:00
Alessio Treglia
4fbaee205f Merge pull request #1997: Handle unmarshalling failures gracefully in x/stake commands
* Handle panic gracefully when unbond begin fails

See #1831

* Handle failure to query delegation gracefully.

Closes #1907

* Update PENDING.md

* Reuse stake's error functions

* New ErrBadValidatorAddr error

UnmarshalValidator() checks the address length first;
it does not make sense to attempt unmarshalling if the
address is wrong.

* New ErrBadDelegationAddr error

* Introduce ErrBad{Redelegation,UnbondingDelegation}Addr custom errors to replace errors.New() calls

* Replace ErrBadUnbondingDelegationAddr with ErrBadDelegationAddr to avoid duplication

Thanks: @melekes for pointing this out

* Use sdk.AddrLen instead of hardcoded address length

* s/triple/tuple/ ## mention PR id in PENDING.md
2018-08-15 15:49:06 -04:00
Federico Kunze
c9358ec198 R4R: Fix repeated cmds in CLI for staking (v.0.24.0 release) (#2043)
* Cherry picked commits

* Update CHANGELOG.md
2018-08-15 16:59:46 +02:00
Rigel
d9dc061b4f
Merge pull request #1819: rational -> decimal
* changelog

* ...

* decimal func working

* decimal complete, untested

* fixing tests

* decimal compile errors resolved

* test compile errors

* precision multiplier test

* 1% laptop battery

* fixed TestNewDecFromStr

* equalities working

* fix bankers round chop

* ...

* working, some decimal issues resolved

* fix rounding error

* rounding works

* decimal works

* ...

* deleted rational

* rational conversion working

* revert changelog

* code compiles (not tests)

* went through all NewDec, made sure they were converted from NewRat properly

* test debugging

* all testing bugs besides the json marshalling fixed

* json unmarshal

* lint

* document update

* fix lcd test

* cli test fix

* mostly undo Dece -> Rate

* val comments

* Efficiency improvements

This now caches all of the precision multipliers (as they were all
used in non-mutative functions), and caches the precisionInt calculation.
(Now it just copies the already calculated value)

* Cache another precisionInt() call.

* Improve banker rounding efficiency

* remove defer, make negation in-place.

* chris val comments

* bez comments

* Aditya comments

* ...

* val comments

* rebasing start

* ...

* compiling

* tests pass

* cli fix

* anton, cwgoes, val comments

* val and jae comments

* type

* undo reuse quo
2018-08-14 20:15:02 -04:00
Alexander Bezobchuk
12c2c236c2 Merge PR #1741: CoreContext Refactor 2018-08-06 20:11:30 +02:00
Aditya
74e06d8b96 Merge PR #1841: Must specify amount flag
* Removed default value for staking. Must now specify amount flag or it will error
* add to pending and better error msg
2018-07-26 23:41:24 +02:00
rigelrozanski
07705444fd do-not-modify in defaults for edit-validator cli 2018-07-26 13:41:34 -04:00
Sunny Aggarwal
29bdd663c2 fixed donotmodify bug 2018-07-25 16:05:43 -07:00
Rigel
d6cd0d4acc Merge PR #1818: CLI keybase-sig -> identity 2018-07-25 20:43:13 +02:00
Rigel
d2f70ec8af Merge PR #1748: CLI use --from consistently 2018-07-19 08:53:12 +02:00
Aditya
b195c556e2 Merge pull request #1600: Friend can create validator and delegate on behalf of genesis validator
* Added msg and handling for surrogate create validator

* changelog and error fix

* fix changelog

* Remove unnecessary msg by combining into CreateValidator

* Refactor

* Appease linter

* Added onbehalfof functionality in client

* fmt

* Added gaia onbehalfof test

* Update test for onbehalfof validator creation

* fix test

* Fix flag error

* Add app test

* fmt

* Fixed signer for onbehalfof createvalidator

* Fix error msg

* Simplify test

* fmt
2018-07-10 20:16:37 -04:00
Rigel
f0a6ade1a6
Merge branch 'develop' into rigel/fix-unbond-percent 2018-07-10 00:13:39 -04:00
rigelrozanski
96d660593a fix cli delegations unmarshalling 2018-07-10 00:07:01 -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
sunnya97
7ac220beb6 asdf 2018-07-09 00:59:51 -07:00
ValarDragon
c708c799fd Add print-response flag 2018-07-05 22:19:50 -07:00
ValarDragon
2197a9598b Merge branch 'dev/add_async_flag' of github.com:cosmos/cosmos-sdk into dev/add_async_flag 2018-07-05 20:19:39 -07:00
ValarDragon
8857b69d02 Use async flag directly from context 2018-07-05 20:15:40 -07:00
Dev Ojha
be9ae47b0a
Merge branch 'develop' into dev/add_async_flag 2018-07-05 20:06:52 -07:00
ValarDragon
27a31cae44 add Async to context 2018-07-05 20:05:17 -07:00
ValarDragon
6f94dd64c0 cli: Add async flag to all broadcasting txs
closes #1436
2018-07-05 19:15:37 -07:00
ValarDragon
8fc6e68511 stake/client: Fix panic on if validator doesn't exist
Closes #1505
2018-07-05 18:24:02 -07:00
Ethan Buchman
84ecd1e043
Merge pull request #1339 from forbole/develop
Update testnet readme and use Bech32-encoded delegator address
2018-07-05 16:59:04 -04:00
rigelrozanski
aed3a87366 address cwgoes comments 2018-07-04 17:07:06 -04:00
rigelrozanski
a2f7b582df validators smaller values stored 2018-07-04 01:32:49 -04:00
rigelrozanski
04921b9ebd ubd and red more limited values 2018-07-04 00:29:02 -04:00
rigelrozanski
199c1e81eb delegations new key format ported 2018-07-03 23:44:54 -04:00
Rigel
f50c7be976
Merge branch 'develop' into rigel/stake-spec-compliance 2018-07-03 13:37:59 -04:00
Ethan Buchman
d388036454 Merge PR #1520: various fixes for test_cli
* various fixes for test_cli
* linting
2018-07-03 06:33:53 +02:00
Rigel
2a2f5db450
Merge branch 'develop' into rigel/stake-spec-compliance 2018-07-02 21:03:46 -04:00
rigelrozanski
ab4661f88b bug somewhere here 2018-07-02 18:16:47 -04:00
Ethan Buchman
f78f30c67a update for tm v0.22.0. tmlibs->tendermint/libs 2018-07-02 16:34:06 -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
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
Rigel
50733f5c22
Merge branch 'develop' into develop 2018-06-27 19:22:48 -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
Sherry Ma
1a67dc5d7c
Changed decode delegator address function
In delegation query, the function to decode the address of delegator should be using Bech32 but not Hex
2018-06-22 18:37:15 +08: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