Commit Graph

6165 Commits

Author SHA1 Message Date
seungyeon-hwang 70e829949c
crypto: print an error message if the password input failed (#5739) 2020-03-03 13:32:52 +00:00
Alexander Bezobchuk e45feae647
Merge PR #5738: Migrate Gov module to Simapp 2020-03-02 14:53:41 -05:00
Jonathan Gimeno c0fd5cbda0
Merge branch 'master' into jonathan/4875-gov-use-simapp 2020-03-02 19:58:48 +01:00
Jonathan Gimeno eba38af83d end of gov refactoring 2020-03-02 19:56:29 +01:00
Jonathan Gimeno e266c40ce1 refactor vote test 2020-03-02 19:50:39 +01:00
Jonathan Gimeno 894b2e5897 refactor old tally test 2020-03-02 19:46:39 +01:00
Jonathan Gimeno 275b78f1c3 add TestTallyJailedValidator to simapp 2020-03-02 19:25:05 +01:00
Jonathan Gimeno 7d3430673e add tally test TestTallyDelgatorMultipleInherit 2020-03-02 19:17:31 +01:00
Jonathan Gimeno 8d4d10d27f refactor TestTallyDelgatorMultipleOverride to use simapp 2020-03-02 18:52:45 +01:00
Jonathan Gimeno 73e1e3a354 refactor TestTallyDelgatorInherit to use simapp 2020-03-02 18:49:14 +01:00
Jonathan Gimeno 9f251885f1 migreate TestTallyDelgatorOverride to simapp 2020-03-02 18:08:40 +01:00
Jonathan Gimeno 46a70d58fa migrate TestTallyOnlyValidatorsNonVoter to simapp 2020-03-02 18:01:10 +01:00
Jonathan Gimeno 759181c2cc migrate TestTallyOnlyValidatorsAbstainFails into simapp 2020-03-02 17:59:24 +01:00
Jonathan Gimeno b83755fc1d migrate TestTallyOnlyValidatorsAbstainPasses to simapp 2020-03-02 17:57:39 +01:00
Jonathan Gimeno c3b18dfb2f migrate TestTallyOnlyValidatorsVetoed test 2020-03-02 17:55:31 +01:00
Alexander Bezobchuk 214cd2e648
Merge pull request #5735: crypto: cleanup, more testing 2020-03-02 11:39:25 -05:00
Jonathan Gimeno 84b7fe5bfa migrate TestTallyOnlyValidators51Yes to use simapp 2020-03-02 16:53:06 +01:00
Jonathan Gimeno 1cf4a7e330 migrate TestTallyOnlyValidators51No to use simapp 2020-03-02 16:50:39 +01:00
Jonathan Gimeno 88e3a22fc4 migrate TestTallyOnlyValidatorsAllYes to simapp 2020-03-02 16:47:06 +01:00
Jonathan Gimeno e24734f72e migrate TestTallyNoQuorum to use simapp 2020-03-02 16:41:41 +01:00
Jonathan Gimeno 8c0d32c8a8 migrate TestTallyNoOneVotes to use simapp 2020-03-02 16:38:24 +01:00
Jonathan Gimeno 80bfd0d2dc migrate TestQueries to new test simapp 2020-03-02 16:22:36 +01:00
Jonathan Gimeno 2c231e2fa0 TestGetProposalsFiltered migrate to simapp 2020-03-02 16:10:19 +01:00
Jonathan Gimeno 00396145d5 migrate TestActivateVotingPeriod to simapp 2020-03-02 16:07:23 +01:00
Jonathan Gimeno eedd2b2341 migrate part of proposal to simapp 2020-03-02 16:04:49 +01:00
Jonathan Gimeno 2afd22f37e migrate TestProposalQueues to use simapp 2020-03-02 15:59:55 +01:00
Jonathan Gimeno 0c938123d9 migrate TestIncrementProposalNumber to simap 2020-03-02 15:56:26 +01:00
Jonathan Gimeno 3fa47df519 migrate test TestDeposits from gov to simapp 2020-03-02 15:52:43 +01:00
Alessio Treglia 9bd603ae88
crypto: cleanup, more testing
crypto.LedgerShowAddress() is a ledger specific function
and should takes acc address prefix instead of depending
on a sdk.Config singleton.

crypto/keys/mintkey:
- decryptPrivKey() return error instead of os.Exit()ing.
- encryptPrivKey() should panic instead of os.Exit() when
  bcrypt.GenerateFromPassword() call fails so that the
  caller is given a chance to recover().

crypto/keys:
- SignWithLedger() does not need to be method of
  baseKeybase. Method receiver is unused.
- ledgerInfo objecta may be pointers, type switch
  should handle both to avoid panics.
- keyringKeybase should not provide Update() at all.

More test cases are added to increase package crypto
and subpackages overall coverage.
2020-03-02 11:09:52 +00:00
Alexander Bezobchuk f403cda2ce
Merge PR #5734: Tweak mergify config 2020-03-01 20:51:45 -05:00
Alexander Bezobchuk 75e45b0926
Merge branch 'master' into alessio/mergify-approvers-no-greater-than-1 2020-03-01 19:33:43 -05:00
Alessio Treglia e0d029388d
fix DiffKVStores(), store/types gets 100% coverage (#5730)
* fix DiffKVStores(), store/types gets 100% coverage

DiffKVStores() used to return duplicated entries
in some cases.

Add test cases, aiming to reach 100% coverage for
store package.

Remove duplicate Cp function from the store package.
Same functionality is provided by types.CopyBytes().

* More test cases

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-03-02 00:27:03 +00:00
Alexander Bezobchuk 8de2fe92ee
Merge branch 'master' into alessio/mergify-approvers-no-greater-than-1 2020-03-01 19:17:28 -05:00
Alessio Treglia d7fd5b6a42
Replace defer with testing.T.Cleanup() (#5732) 2020-03-02 00:16:23 +00:00
Alessio Treglia 8fd85e16a5
Tweak mergify config
Set minimum approvers number to be strictly greater than 1.
2020-03-01 16:18:22 +00:00
Alessio Treglia 2ae25caa74
linter fixes (#5733)
* make .golangcy.yml work with Goland's Golint plugin

Explicitly disable all linters. Whitelist of enabled
plugins is already provided.

This would enable Goland users to user Golint plugin.

* fix deadcode warnings

* fix gocritic error

unslice: could simplify pkBytes[:] to pkBytes
2020-03-01 15:38:57 +00:00
Alessio Treglia 5f14dc2e42
Increase coverage across the store package (#5727) 2020-02-28 23:05:28 +00:00
Alexander Bezobchuk 7d6fc7ee25
Merge PR #5709: Add granularity options to pruning state 2020-02-28 13:45:59 -08:00
Alexander Bezobchuk db855fba07
Merge branch 'master' into jonathan/5684-prune-syncable 2020-02-28 12:45:59 -08:00
Alexander Bezobchuk e3580896ab
Migrate Keeper staking tests to use simapp (#5683)
* use simapp into keeper

* refactor TestHistoricalInfo to use simapp

* refactor historical info test

* temporal commit on querier test, it passes

* commit end of day refactoring

* rename and temp commit

* fix test query validators

* make TestQueryDelegations pass with simapp :D

* rename function

* make TestQueryRedelegations pass with simapp

* finish keeper refactor for querier in staking using simapp

* refactor delegation test TestUnbondDelegation to use simapp

* make all test pass temporary

* avoid usage of historicals

* refactor creation of the simapp

* refactor creation of simapp

* comment before creating new way to generate accounts

* make TestDelegation pass with generated accounts

* refactor to use accounts

* refactor test unbondingdelegationsmax entries

* refactor TestUndelegateSelfDelegationBelowMinSelfDelegation to use simapp

* update TestUndelegate from unbonding validator and fix bug

* refactor TestUndelegateFromUnbondedValidator to use simapp

* TestUnbondingAllDelegationFromValidator to use simapp

* refactor TestGetRedelegationsFromSrcValidator to use simapp

* refactor TestRedelegation to use simapp

* refactor TestRedelegateToSameValidator to use simapp

* refacotr TestRedelegationMaxEntries to use simapp

* refactor delegation test

* refactor TestRedelegateFromUnbondingValidator to use simapp

* finish refactor delegation test

* refactor and remove unused code

* migrate revocation of old slash test

* fix TestSlashUnbondingDelegation test to use simapp

* refactor TestSlashRedelegation to use simapp

* refactor TestSlashAtFutureHeight test

* test TestSlashAtNegativeHeight migrated to simapp

* migrated two tests from slash_test to use simapp

* refactor TestSlashWithRedelegation

* end refactoring slash_test

* refactor first test validation to simapp

* refacor TestUpdateValidatorByPowerIndex to use simapp

* refactor TestUpdateBondedValidatorsDecreaseCliff to simapp

* refactor TestSlashToZeroPowerRemoved

* TestValidatorBasics

* refactro TestGetValidatorSortingUnmixed to simapp

* refactor TestGetValidatorSortingMixed test to simap

* refctor TestGetValidatorsEdgeCases to use simapp

* make test TestValidatorBondHeight pass

* refactor TestFullValidatorSetPowerChange test

* end refactoring validator_test

* clean code

* move methods

* rename

* rename commont test

* git remove unused vars

* refactor ordering functions

* refactor old genesis_test to use simapp

* refactor TestValidatorByPowerIndex

* refactor TestDuplicatesMsgCreateValidator

* refactor TestInvalidPubKeyTypeMsgCreateValidator

* temporary commit

* refactor TestLegacyValidatorDelegations to use simapp

* refactor TestIncrementsMsgDelegate

* refactor next

* refactor TestEditValidatorIncreaseMinSelfDelegationBeyondCurrentBond

* refactor TestIncrementsMsgUnbond

* refator TestMultipleMsgCreateValidator

* refactor TestMultipleMsgDelegate

* refactor TestJailValidator

* refactor TestUnbondingPeriod and TestValidatorQueue

* refactor TestUnbondingFromUnbondingValidator and TestRedelegationPeriod

* refactor TestTransitiveRedelegation and TestMultipleRedelegationAtSameTime

* refactor TestMultipleRedelegationAtUniqueTimes and TestMultipleUnbondingDelegationAtSameTime

* refactor TestMultipleUnbondingDelegationAtUniqueTimes and TestUnbondingWhenExcessValidators

* end refactor handler_test

* remove test_common

* remove create test public keys

* fix based on PR comments

* use prealloc array for ConvertAddrsToValAddrs

* fix lint errors

* fix lint errors 2

* remove duplicated func

* rename function names

* Update simapp/test_helpers.go

* Update x/staking/keeper/keeper.go

* Update simapp/test_helpers.go

* Update simapp/test_helpers.go

* add last touches to the PR

* edit text

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>
2020-02-28 12:45:24 -08:00
Alessio Treglia 52c6e5e322
Merge branch 'master' into jonathan/4875-staking-test-use-simapp 2020-02-28 20:30:27 +00:00
Alessio Treglia 7080949f4e
Update CODEOWNERS as per @jaekwon's directives (#5728) 2020-02-28 18:27:42 +00:00
Alessio Treglia d094183895
Increase code coverage of version up to 100% (#5726) 2020-02-28 18:14:01 +00:00
Jonathan Gimeno f090da2100 edit text 2020-02-28 19:07:10 +01:00
Jonathan Gimeno f8442bb46f add last touches to the PR 2020-02-28 19:06:03 +01:00
Alexander Bezobchuk 2b688a0121
Merge branch 'master' into jonathan/4875-staking-test-use-simapp 2020-02-28 09:59:39 -08:00
Alexander Bezobchuk 19546f2197
Update simapp/test_helpers.go 2020-02-28 09:59:26 -08:00
Alexander Bezobchuk 03af49bda2
Update simapp/test_helpers.go 2020-02-28 09:59:17 -08:00
Alexander Bezobchuk 9aa2088c23
Update x/staking/keeper/keeper.go 2020-02-28 09:59:06 -08:00
Alexander Bezobchuk 256e5fc863
Update simapp/test_helpers.go 2020-02-28 09:58:55 -08:00