Commit Graph

177 Commits

Author SHA1 Message Date
SaReN 919e906866
Minor Code Cleanup - gRPC queries (#6862)
* add missing RegisterQueryService

* Update generated proto files

* Update grpc tests for auth,bank

* Make format

* fix godoc

* Address suggestions

* Update godoc
2020-07-28 12:53:35 +00:00
Alessio Treglia e0a81d2cca
crypto: move ledger code to its own subfolder (#6817)
crypto -> crypto/ledger:
- crypto.LedgerShowAddress -> ledger.ShowAddress
- crypto.NewPrivKeyLedgerSecp256k1 - > ledger.NewPrivKeySecp256k1
- crypto.NewPrivKeyLedgerSecp256k1Unsafe -> ledger.NewPrivKeySecp256k1Unsafe

Closes: #6780
2020-07-22 18:51:12 +02:00
Alessio Treglia ba6a2f57c2
crypto/hd: update godoc for ComputerMastersFromSeed (#6694)
Closes: #5338
2020-07-12 09:17:59 -04:00
Alessio Treglia a940214a49
testutil cleanup and reorg (#6658)
Prepare migrating testing auxiliary functions from tests
to testutil.

Remove local duplicates on testutil.WriteToNewTempFile().

Always favor testutil.NewTestCaseDir() over ioutil.TempDir().

Add test cases for the testing auxiliary functions.
2020-07-09 14:21:20 +02:00
Aaron Craelius 2f44fbf2ab
Add support for protobuf TxGenerator and SIGN_MODE_DIRECT (#6385)
* Add TxWrapper, encoder, decoder and DirectModeHandler

* fix pkg name

* Update API and leave test TODO's

* Update TxWrapper API

* tests for tx wrapper (#6410)

* WIP: added test for direct mode handler

* updated code

* Add msg

* Update TxWrapper API

* Fix pubkey declaration

* Add pubkey for tests

* Fix SetFee

* Remove logs

* Avoid global var declaration for tests

* Add test for GetPubKeys

* Fix direct signing tests

* Add more test cases for GetSignBytes

* Revert SetFee API

* Remove logs

* Refactor tests

Co-authored-by: anilCSE <anil@vitwit.com>
Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>

* Refactoring

* Refactoring

* Integrate SignatureV2 API

* Fix wrapper tests

* Fix tests

* Linting and API tweaks

* Update API

* WIP on updating API

* Fix tests

* Update to new SigVerifiableTx

* Rename

* Update docs to reflect ADR 020

* proto-gen

* proto docs

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* Add tests

* Refactor and improving test coverage

* WIP on test coverage

* WIP on test coverage

* proto-gen

* Fix CompactBitArray.Size() bug

* Rename

* Remove Builder interface

* Address review comments

* Update x/auth/tx/sigs.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* Update x/auth/tx/encoder.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* Update x/auth/tx/encoder.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* Address review feedback

* Fix build issues

* Resolve conflicts

* Fix ValidateBasic test coverage

* Add test for malicious multisig

Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
Co-authored-by: anilCSE <anil@vitwit.com>
Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-06 17:03:45 +00:00
Cory 4e73e0f817
Update proto files & definitions in accordance with ADR023 (#6413)
* consolidate proto files into single directory, turn on PACKAGE_DIRECTORY_MATCH linting

* add third_party root for third party proto files

* move ibc proto files to top level folder, rename .proto files to types.proto as before

* update protocgen script, and run code generation

* move vesting proto definition to cosmos namespace, rename from types.proto in alignment with buf.build naming conventions

* update Makefile so proto dependencies are set with new structure when updated

* add comment for sed usage in makefile

* remove unused aliases of proto generated types

* add settings.json instructions to contributing.md for including protobuf paths

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
2020-06-18 10:04:26 -07:00
Aaron Craelius 60f7edfe3d
Add SignatureV2 infrastructure (#6373)
* Updte tx generator

* Add sigv2, PublicKeyCodec

* revert changes

* revert changes

* updates

* Updates

* Integrate multisig support

* Undo move

* remove func

* undo

* godocs

* godocs, cleanup

* Cleanup

* godocs, tests

* lint

* Re-enable VerifyBytes

* Address comments

* Fix imports

* Update crypto/types/multisig/multisignature.go

* Add test for MultiSignatureData

* Add nested multisig case

* Add test for AddSignatureV2

* Add changelog

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
2020-06-12 18:13:20 +00:00
Federico Kunze 0215b5c6cd
client: fix signing algorithm (#6405)
* crypto/keyring: fix signing algorithm

* client: tests

* minor fixes

* changelog

* address @alexanderbez comments

* Update crypto/keyring/keyring.go

* Update crypto/keyring/signing_algorithms.go

* Update crypto/keyring/keyring.go

* Update crypto/keyring/signing_algorithms.go

Co-authored-by: Alessio Treglia <alessio@tendermint.com>

* fix test

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-06-11 14:30:42 +00:00
Aaron Craelius 6740d27b55
Add PublicKeyCodec (#6372)
* Add PublicKeyCodec

* Add tests

* Remove cache codec

* Remove cache codec

* Revert proto changes

* Revert proto changes

* refactor and move docs

* Lint

* Apply suggestions from code review

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-06-09 19:41:28 +00:00
Aaron Craelius 81d647e505
Move codec.RegisterCrypto and codec.Cdc to new packages (#6330)
* Move codec.Cdc to legacy_global.Cdc

* Update CHANGELOG.md

* Updates

* nit

* Fix imports

* Updates

* Use cosmos multisig instead of tendermint multisig everywhere

* Fix tests

* Rename legacy_global -> legacy

* Add doc.go

* Linting, move all RegisterCrypto calls to crypto/codec

* Update crypto/codec/amino.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-06-04 10:38:24 +00:00
Aaron Craelius 850419fffd
Tx CLI proto module interface (#5989)
* WIP

* WIP

* WIP on removing x/auth dependency from client/tx

* Revert unneeded changes

* Simplify cli tx UX

* Wire up bank tx REST routes

* Fix assignment issue

* Wire up bank NewSendTxCmd

* fix lint

* revert file

* revert file

* fix simcli

* Refactor AccountRetriever

* Fix build

* Fix build

* Fix build

* Fix integration tests

* Fix tests

* Docs, linting

* Linting

* WIP on all modules

* Implement other module new tx cmd's

* Fix cmd's

* Refactor existing GetTxCmd

* Fix cmd

* Removing deprecated code

* Update ADR 020 & CHANGELOG

* Lint

* Lint

* Lint

* Lint

* Lint

* Lint

* Lint

* Fix client/tx tests

* Fix mocks

* Fix tests

* Lint fixes

* REST tx migration

* Wire up REST

* Linting

* Update CHANGELOG, docs

* Fix tests

* lint

* Address review feedback

* Update CHANGELOG.md

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>

* group vars

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-05-21 21:29:34 +00:00
Marko a201967fd1
multisig: add type and bitarray (#6241)
* add multisig and bitarray

* remove random message

* add changelog entry

* bring back the concrete type

* move changelog entry

* move bitarray to crypto/types

* fix build

* remove commented code

Co-authored-by: Aaron Craelius <aaron@regen.network>
2020-05-20 20:10:49 +00:00
Aaron Craelius 70767c87c4
Update x/gov to use Any (#6147)
* Update x/gov to use Any

* Fixes

* Remove MsgSubmitProposalLegacy

* Update CHANGELOG.md

* Add RegisterInterfaces for x/distribution, x/params, & x/upgrade

* Fix query JSON issue

* Fix gov tests

* Revert custom Any Equals

* Re-remove types

* Rename receivers

* Fix imports in gov

* Sort imports

* Make amino JSON signing work with Any

* Run proto-gen

* Create full amino wrapper

* Fix errors

* Fixes

* Fix tests

* Test fixes

* Fix tests

* Linting

* Update ADR 019 and CHANGELOG

* Updated ADR 019

* Extract Marshal/UnmarshalProposal

* fix error

* lint

* linting

* linting

* Update client/keys/parse.go

Co-authored-by: Marko <marbar3778@yahoo.com>

* linting

* Update docs/architecture/adr-019-protobuf-state-encoding.md

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>

* Update docs/architecture/adr-019-protobuf-state-encoding.md

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>

* Address review feedback

* Add godocs

* Fix errors

* fix errors

* revert file

* Address review feedback

* Address review feedback

* Stacktrace debug flag

* Fix tests

* Address review feedback

Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-05-19 20:17:29 +00:00
Federico Kunze 3dcdc582af
x/ibc-transfer: move ICS20 out from x/ibc (#6222)
* x/transfer: move ICS20 out from x/ibc

* rename to ibc-transfer
2020-05-15 20:36:47 +00:00
Aaron Craelius 40082b823f
Merge PR #6217: Add pub key proto definitions 2020-05-14 16:45:19 -04:00
Aaron Craelius 49ae8800d1
Merge PR #6214: Add Tx, SignDoc, etc. proto types from #6111 2020-05-14 15:27:48 -04:00
Marko bef3689245
linter: enable nolintlint (#6162)
* nolintlint enable

* remove space

* fix tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-05-08 08:46:12 +00:00
Marko 218ec99508
various linter fixes (#6106)
x/staking: Fix all linter warnings.

Fixed warnings across base packages.

New linters:
- unparam
- nolintlint

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-05-02 21:26:59 +02:00
Alessio Treglia 2879c0702c
x/ibc: fix missing return statement (#6099)
* enable the wsl linter

Fix various wsl-related warnings.

x/ibc/04-channel/keeper/handshake.go: fix missing return statement in ChanOpenTry().

* goimports -w files

* remove unknown linter references

* run make format

* Revert "run make format"

This reverts commit f810b62b9e4993f08506663d4e5f2ec2228a9863.

* run make format
2020-04-29 22:36:34 -04:00
Alessio Treglia aeee097b2f
spring cleanup (#5991)
* Make format

* Fix golangci-lint warnings

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-04-14 19:13:15 +00:00
Alessio Treglia a1feca39c2
Enter the new keyring interface (#5904)
crypto/keyring:

`Keybase` interface gives way to its successor: `Keyring`. `LegacyKeybase`
interface is added in order to guarantee limited backward compatibility with
the old `Keybase` interface for the sole purpose of migrating keys across
the new keyring backends.

The package no longer depends on the `github.com/types.Config`
singleton.

`SupportedAlgos` and `SupportedLedgerAlgos` methods have been removed.
The keyring just fails when trying to perform an action with an unsupported
algorithm.

crypto/ subdirs reorganization:

`crypto/keys/hd` was moved to `crypto/hd`, which now groups together
all HD wallets related types and utilities.

client/input:

* Removal of unnecessary `GetCheckPassword`, `PrintPrefixed` functions.
* `GetConfirmation`'s signature changed to take in a io.Writer for better integration
  with `cobra.Command` types.

client/context:

* In-memory keyring is allocated in the context when `--gen-only` flag is passed
  in. `GetFromFields` does no longer silently allocate a keyring, it takes one as
  argument.

Co-authored with @jgimeno

Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
2020-04-08 11:38:28 +02:00
Alessio Treglia f7c0578fea
crypto/keyring: drop password from keyWriter internal interface (#5899)
Add an extra test case to increase coverage.
2020-04-01 16:46:47 +02:00
Alessio Treglia 2a7a408d35
crypto/keyring: deprecate old keybase (#5889)
Remove the Update method from the Keybase interface.

Remove redundant lazy keybase implementation altogether.

Created LegacyKeybase interface to restrict capabilities to
only those required by keys commands that deal with
legacy keybase such as update and migrate.

Rename keyring.New() -> keyring.NewLegacy().

Rename client/keys.NewKeyBaseFromDir -> NewLegacyKeyBaseFromDir.

crypto/keyiring.NewInMemory() now returns a in-memory keyring.
BackendMemory is added yet not exposed via command line
--keyring-backend flag. keys add uses it when --dry-run flag
is on.
2020-03-30 20:30:50 +02:00
Alessio Treglia db76afe840
crypto/keyring: change addrKey to store chain-agnostic addresses (#5858)
Keyrings store keys by name and hexbytes representation
of address. This turns keyring internal storage more
chain-agnostic and types.Config independent.

Obsolete Keybase internal state representation is not affected.
2020-03-30 16:54:01 +02:00
Alessio Treglia 5db6d54825
merge crypto/keys/mintkey into crypto/ (#5880)
crypto/keys/mintkey provides only armoring functions.
It makes very little sense to keep it standalone and
under a name which does not really seem consistent with
the features it provides.
2020-03-27 10:24:19 +01:00
Federico Kunze 9cce836c08
crypto/keys: move keybase and keyring to crypto/keyring/ dir (#5866)
* crypto/keys: move keybase and keyring to crypto/keyring/ dir

* Update client/keys/root.go

* Update crypto/keyring/errors.go

* Update crypto/keyring/keybase.go

* Update crypto/keyring/options.go

* format

* changelog

* fix build

* format

* lint
2020-03-25 15:20:36 +00:00
Alessio Treglia de3f8806f6
crypto/keys: simplify pass keyring directory (#5852)
Store keys into $HOME/.password-store/keyring-appcli
instead of $HOME/.password-store/$HOME/.appcli/.
The latter is very user unfriendly.
2020-03-23 16:40:47 +01:00
Marko d657513741
lint: various linting fixs (#5825)
* lint: various linting fixs

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* more linting

* more linting fixes

* more errchecking

* comment out errcheck for now

* undo error check

* address some comments

* remore require error

* change delete to batch delete

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-03-20 19:24:18 +00:00
Alessio Treglia 75a375b6c6
crypto/keys: remove DecodeSignature from baseKeybase (#5844)
Keybase implementations should return errors when
signature generation is attempted with offline/multisig
keys since theyr lack private keys.

This is a change in Keyring/Keybase.Sign() methods
semantics that have been broken for long time.
2020-03-20 16:00:12 +01:00
Alessio Treglia 230a1e8ba3
crypto/keys: improve documentation (#5833)
* crypto/keys: improve documentation

Remove out of date crypto/keys README.md file.

Populate client keys commands help screen with
more information regarding keyring backends.

* Fix formatting

* Fix lint warning
2020-03-19 16:58:14 +00:00
Jonathan Gimeno a5899bace0
Remove CloseDB method from Keybase interface (#5820)
* remove old method closeDb from Keybase interface

* add changelog

* move to api breaking changes

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-03-18 16:19:22 +00:00
Alessio Treglia 3db39cda3c
Fix various linter warnings (#5824) 2020-03-18 12:59:08 +00:00
Alessio Treglia a84e02f390
crypto/keys/mintkey: fix errors handling in UnarmorPubKeyBytes (#5823)
Check error returned by internal call to unarmorBytes()
and handle accordingly.

Handle header's empty version field adequately.
2020-03-18 11:33:28 +01:00
Jonathan Gimeno 1c7da830c2
Revert changes for keybase encoding (#5814) 2020-03-17 01:36:05 +01:00
Jonathan Gimeno 2e42f9cb74
Favor marshal unmashal binare bare (#5799)
* change abci file to use BinaryBare

* change all calls to EncodeLengthPrefixed to BinaryBare in distribution keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in mint keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in auth keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in distribution keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in staking keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in staking keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in gov keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in slashing keeper store.

* update decoder test

* migrate decoder

* migrate gov simulation decoder

* migrate baseapp_test

* refactor QuerySubspace

* refactor coedc std codec

* migrate keybase

* migrate iavl store

* migrate root multi

* migrate ante basic

* migrate tx type to bare

* migrate auth client

* update auth types

* update decoder

* migrate supply decoder

* migrate stake encoding

* migrate staking simulation

* migrate genutil

* migrate simapp test helpers

* migrate docs

* upgrade changelog

* Update CHANGELOG.md

Co-Authored-By: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-03-13 19:58:43 +00:00
seungyeon-hwang 70e829949c
crypto: print an error message if the password input failed (#5739) 2020-03-03 13:32:52 +00: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
Alessio Treglia d7fd5b6a42
Replace defer with testing.T.Cleanup() (#5732) 2020-03-02 00:16:23 +00:00
Erik Grinaker a7f25ade03
Merge PR #5613: update to golangci-lint v1.23.3
Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com>
2020-02-05 11:32:45 -08:00
Alessio Treglia d0ff973386 Merge PR #5562: Remove KeyringServiceName from the sdk.Config struct 2020-01-23 13:47:11 -05:00
Alessio Treglia 1feb22c4f0
[keyring] support for kwallet, pass (#5560)
Add support for KDE Wallet service and the pass command line tool.
2020-01-23 16:48:00 +00:00
Alessio Treglia 415eab7a56
Create new generic keyring constructor: NewKeyring (#5547)
Remove other convenience constructors:
 * Remove NewKeyBaseFromHomeFlag
 * Remove NewKeyringFromDir
 * Remove NewKeyringFromHomeFlag
2020-01-22 17:54:56 +00:00
Alexander Bezobchuk c1991e31bd Merge PR #5527: Bump Tendermint Version to v0.33.0
* Bump Tendermint version to v0.33.0

* Deprecate old cmn package with new packages

* Update update DB APIs

* More DB updates

* Bump IAVL to v0.13.0

* Handle error returned by iavl.NewMutableTree

* Fix some IAVL stuffs

* Update IAVL

* More updates

* Passing tests

* Fix unit tests

Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com>
2020-01-16 13:46:51 -08:00
Alexander Bezobchuk c92a7389ff
Merge PR #5526: Fix migrate command 2020-01-15 12:29:36 -05:00
Sunny Aggarwal 7b6663d096 Merge PR #5522: fixed amino backward compat 2020-01-15 08:38:09 -05:00
Sunny Aggarwal f367087731 Merge PR #5439: Keybase: Multiple Signature Algorithms 2020-01-14 10:40:10 -05:00
Alexander Bezobchuk 869531ca92
Merge PR #5495: Replace Redundant Bech32 PubKey Functions 2020-01-09 09:04:28 -05:00
Austin Abell d7b0f4b9b4 apply options on newly added keyring types (#5404) 2019-12-13 11:21:49 +00:00
Austin Abell 0e28da23e7 Interchangable PrivKey implementations in keybase (#5278)
Allow for the keybase to be configured to override the implementation
of the key that is saved to the keybase.

Closes: #4941
2019-12-12 21:52:24 +00:00
Alessio Treglia 394860068d
keyring's encrypted file backend integration (#5355)
Client commands accept a new `--keyring-backend` option through which users can specify which backend should be used by the new key store:
- os: use OS default credentials storage (default).
- file: use encrypted file-based store.
- test: use password-less key store (highly insecure).
2019-12-11 09:45:26 +00:00
Alessio Treglia b9cb3e105d Merge PR #5345: Add dev docs for COSMOS_SDK_TEST_KEYRING 2019-11-30 09:32:08 -05:00
Alessio Treglia d4c831e63a Drop on-disk keybase in favor of keyring (#5180)
* Switch keys commands to keyring

* Replace NewKeybase with NewKeyring

* Fix delete test

* Purge dead code

* Override COSMOS_SDK_TEST_KEYRING envvar to switch to a test keyring

* s/unningOnServer/unningUnattended/

C'ing @tnachen

* Add deprecated warning, output looks like the following:

```
$ gaiacli keys update --help
Command "update" is deprecated, it takes no effect with the new keyring
based backend and is provided only for backward compatibility with the
legacy LevelDB based backend.
Refer to your operating system's manual to learn how to change your
keyring's password.

Change the password used to protect private key

Usage:
  gaiacli keys update <name> [flags]

Flags:
  -h, --help   help for update

Global Flags:
      --chain-id string   Chain ID of tendermint node
  -e, --encoding string   Binary encoding (hex|b64|btc) (default "hex")
      --home string       directory for config and data (default "/home/alessio/.gaiacli")
  -o, --output string     Output format (text|json) (default "text")
      --trace             print out full stack trace on errors
```

* Update multisign command

* Modify server.GenerateSaveCoinKey()

* GenerateSaveCoinKey more modifications

* Update docs

* Update upgrade module
2019-11-14 15:17:21 +01:00
Marko b9490f2d93 Merge PR #5203: Add more linters 2019-10-17 09:47:35 -04:00
Marko 9f3789157e Merge PR #5192: golangcI-lint updates & set static version to 1.19 2019-10-14 11:43:19 -04:00
Alessio Treglia ee404e96ab Merge PR #5164: Handle New{,Test}Keyring errors 2019-10-09 14:53:54 -04:00
Alessio Treglia 46cd6112e1 Merge PR #5104: Remove keyring lazy implementation 2019-09-30 12:16:53 -04:00
Alessio Treglia 3e6562ce45 Merge PR #5097: Add keys migrate command
Add new command to assist users migrate their keys from the legacy
on-disk keybase to the new OS keyring-based implementation.

Ref #4754
2019-09-30 11:49:12 -04:00
Alessio Treglia 2c96bbbaa8
Add support for github.com/99designs/keyring-backed keybases (#5029)
Introduce new Keybase implementation that can leverage
operating systems' built-in functionalities to securely store
secrets.

This chunk is extracted from @poldsam's original PR:
- #4754

Thanks: @alexanderbez
2019-09-21 09:54:14 -07:00
Federico Kunze eeb847c845 Merge #4209: NFT Module
* in sync with @okwme/cosmos-nft

* remove tmp tx

* structuring and minor changes

* supply and client files

* adding cli client

* complete cli/tx and rest.go

* cleanup and restructuring

* restructure rest folder

* minor updates on clients

* update querier

* encoding for clients and other changes

* genesis, invariants, and keeper updates

* update types

* make golangcibot happy

* renamed and removed bank keeper

* remove handlers for editmetadata, mint, burn, buy

* nft interface

* minor cleanup

* sort collections and nfts

* balance and find

* nft query and tx

* touch ups

* uint in place of int

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* little fixes:
- fix error to err to avoid collision
- error handling

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* module generalization changes

* fixes

* query with data

* minor updates and TODOs

* fix CLI tx

* golang bot fixes

* handlers and txs done

* update module generalization

* Added very basic tests which for some reason do not work

* fix test

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* fixed test, now we should fix implementation, seems to fail

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* fix test, create new struct instead of changing the old one

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* fix handler with new logic

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* let's make it compile

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* single failing test example, need to be fixed and extended

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* single failing test example, need to be fixed and extended

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* reverting work, still problems unmarshalling inside iterator from test

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* Setter in nft.go should return NFT instead of BaseNFT

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* remove TODOS

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* comment out broken tests, we want at least a green mark here

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* little fixes

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* hopefully no conflict

* minor changes for tests

* change nft id to string, refactors

* messy pause

* Changes Balances to OWners add all necessary functions, updated Keeper with UpdateNFT as as well as MintNFT and made sure they all update Owners

* pause dev to merge sdk master

* go.mod changes

* getting closer still need module.go

* builds!!!

* fix lint begin handler tests

* stableish

* re-order nft attributes, add back mint and burn msgs and handlers

* add errors to minting the same NFT and burning an NFT that doesnt exist

* first querier test

* add simulations for nft msgs

* handler tests check tags now (fixed a bug!)

* update simulation

* generic handler

* need to check if it compiles on another machine

* fix weird interface error

* add back cli

* wtfff

* codec error fixed, logs removed. still returning empty arrays of IDs

* Take empty input as yes answer

Closes: #4564

* Add pending log entry

* merged in master

* marshall errors

* build commands

* working!!!

* linting errors

* remove unused func

* pause

* fix burn error

* fix burn error

* tests for querier

* typo

* tests for NFT types

* module spec standard

* tests for Collection and Collections types

* merge w Fede

* tests for Owner Type

* added genesis tests and beefed up keeper, querier, handler & types tests

* linting errors deadcode

* DONT COVER test_common.go

* add msg type tests

* Update x/nft/internal/keeper/key.go

Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* Update x/nft/genesis.go

Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* Update x/nft/client/cli/query.go

Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* Apply suggestions from code review

* typo

* cleanup events

* split events

* more cleanup

* remove restrictions from default handlers

* not sure where these go mod changes came from

* sim generated changes

* make format

* add mint and burn sims

* move NFT interface to nft/exported

* make format

* NFT spec

* Updates

* more updates

* update specs readme

* fix sims

* rest additions

* rest additions

* fix invariant

* minimal nft without name, description or image

* sim

* fix sim

* fix sim

* fix Update methods

* nothing

* simplify update and remove

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* remove test on memory location

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* TEST to get logs, need to be removed

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* fix simulator editMetadata Msg type

* owner not found start with empty collection

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* artifacts on errors in case of failure, else, no artifacts

Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>

* add more invariant checks to handler_tests

* never forget to overwrite

* merge and update spec

* colins feedback

* code coverage test

* code coverage test

* code coverage test

* spelling

* clean up client

* testing code coverage

* testing code coverage

* testing code coverage

* testing code coverage

* testing code coverage

* Update docs/spec/nft/README.md

Co-Authored-By: frog power 4000 <rigel.rozanski@gmail.com>

* Apply suggestions from code review

Co-Authored-By: frog power 4000 <rigel.rozanski@gmail.com>

* minor changes

* integration tests and fixes

* minor golangCI fixes

* Update simapp/app.go

Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>
2019-08-26 12:54:45 -04:00
Marko 3a4f1fc4d4 Merge PR #4881: Linting Galore 2019-08-19 12:06:27 -04:00
Alexander Bezobchuk 861e4798ad
Merge PR #4836: Upgrade Tendermint and IAVL 2019-08-02 09:20:39 -04:00
Federico Kunze 7c70912263 Merge PR #4790: Fix multisig output 2019-07-31 11:47:18 -04:00
yys adf6ddd4a8 Merge PR #4716: Fix ledger custom coin type support bug 2019-07-29 11:01:53 -07:00
Austin Abell 3f519832a7 Merge PR #4687: Changed replace directive to specific revision of tendermint crypto 2019-07-09 15:04:30 -07:00
frog power 4000 5f9c3fdf88 Merge PR #4451: Client and Module Modularization 2019-06-05 19:26:16 -04:00
Alessio Treglia 85ebf5f72e
Implement private keys export/import symmetric functionalities (#4436)
Add Keybase's ExportPrivKey()/ImportPrivKey() API calls to export/import
ASCII-armored private keys. Relevant keys subcommands are provided as well.

Closes: #2020
2019-05-30 16:44:28 +01:00
Frank Yang 1db10b0033 Configurable Bip44 CoinType & HdPath for SDK users (#4300)
Closes: #4144
2019-05-30 13:46:38 +01:00
Alessio Treglia 71d71f2206
Remove gaia (#4347)
Gaia is removed from cosmos-sdk repository.

Few changes were required to make sure no packages depend on gaia subpackages.

CI config is amended accordingly.

Unnecessary targets are removed from Makefile.

Simulations run through a lightweight version of gaia renamed to simapp.

Closes: #4104
2019-05-18 10:42:24 +02:00
frog power 4000 5b7690e5e9
Merge PR #4346: report card minor fixes
* report card minor fixes

* fix
2019-05-16 21:32:20 -04:00
Alessio Treglia 06f7b2198a
Replace vet with golangci lint govet (#4277)
Drop go vet in favor of golangci-lint govet check.

Fix golangci-lint warnings.

Upgrade golangci-lint.
2019-05-06 17:50:05 +01:00
Juan Leni 1306a25e42 Adding support for Ledger Cosmos App v1.5 (#4227)
This PR adds support for the latest version of the Cosmos App (v.1.5).
The app is not been released yet by Ledger but the PR is backwards compatible.
We can later remove backwards compatibility and enforce v1.5 only.

When creating a new account, `gaiacli` now shows the account/index and address in the device and requires user confirmation.

Related PRs:
https://github.com/cosmos/ledger-cosmos-go/pull/3
https://github.com/cosmos/ledger-cosmos-go/pull/4
https://github.com/cosmos/ledger-cosmos-go/pull/5
https://github.com/cosmos/ledger-cosmos-go/pull/6

Changes in the app can be found here:
https://github.com/LedgerHQ/ledger-app-cosmos/pull/5
2019-04-30 09:58:21 +01:00
Alessio Treglia 3c88ddc2f5 Merge PR #4083: Replace gaiad --assert-invariants-blockly with --inv-check-period
* Remove old broken flag
* Support --inv-check-period which asserts invariants every nth period
2019-04-10 19:33:50 -04:00
Alessio Treglia 85021d4ca9
No packages must depend on cmd/gaia/ (#4048)
Preparation work for moving gaia out of the SDK.
2019-04-04 15:36:39 +01:00
Alessio Treglia 9556393aaf Merge PR #4005: Increase crypto coverage
Test LazyLeybase and crypto/keys/mintkey extensively
2019-03-29 09:49:00 -04:00
Juan Leni dcc3357ea3 Merge PR #3811: Migrate repo to organization 2019-03-06 12:37:27 +01:00
Alessio Treglia 3e82a8bbb8 Merge PR #3792: Use DBBackend set at compile time
* use DBBackend set at compile time

Closes: #3719

* Refresh changelog

* Tweak Makefile
2019-03-04 21:31:55 +01:00
Alexander Bezobchuk 47a44fb580 Merge PR #3748: Multisig Display UX Improvements 2019-03-01 13:29:33 -08:00
Alexander Bezobchuk d1573a17e2 Merge PR #3733: Update Client Keys Permissions to 0700 2019-02-26 11:36:25 -08:00
Juan Leni 3eb0acda88 Merge PR #3670: CLI support for showing bech32 addresses in Ledger devices 2019-02-25 12:34:39 +01:00
Christopher Goes bb1fd58b1e Address @alexanderbez comments 2019-02-13 17:26:14 +01:00
Christopher Goes d21ab4efc5 Add justification on security parameter choice 2019-02-13 15:36:03 +01:00
Christopher Goes abafd8bf9d Add Bcrypt benchmarks 2019-02-13 15:26:43 +01:00
Alessio Treglia fa2e9b8518 Merge PR #3619: Fix CI test failure 2019-02-12 13:45:44 +01:00
Alessio Treglia fe548c0829 Merge PR #3593: hide dbKeybase's constructor 2019-02-11 17:18:58 -08:00
Juan Leni 94dccf3842 Merge PR #3586: Fix keybase storage of ledger accounts 2019-02-11 09:02:47 -08:00
Alessio Treglia e7e3c32204 Merge PR #3553: Code cleanup, take #1
* add a bunch of tests, add DONTCOVER text tag

- Also fix flaky test (closes: #3559). Don't test values
  returned by queries since there's no way to query a
  specific height via REST.

* GetTempDir -> NewTestCaseDir
2019-02-08 22:45:41 +01:00
Juan Leni b5fdb83830 Merge PR #3517: Increasing test coverage in keys/client package 2019-02-08 12:45:23 -08:00
Juan Leni ba63eb1801 Merge PR #3557: Removing pkg/errors when not necessary 2019-02-08 11:37:46 -08:00
Alessio Treglia dff6d0e462 Merge PR #3551: Code cleanup, small coverage boost 2019-02-07 14:38:45 -08:00
Alessio Treglia 9a57ce0214 Merge PR #3514: don't lock keybase on lcd startup 2019-02-06 11:23:49 -08:00
Juan Leni 174ec0c809 Merge PR #3431: PrivKeyLedgerSecp256k1: lost connection 2019-02-05 10:21:04 -08:00
Juan Leni f5ada58780 Merge PR #3461: GaiaCLI - refactor/fix --account and --index 2019-02-05 08:22:56 -08:00
Alessio Treglia 24a1670cf0 Run make format 2018-12-10 14:27:25 +00:00
Alessio Treglia 079b1f0ffa Merge PR #2994: Change wrong password message
* change wrong password message

Closes: #2993

* Update PENDING.md
2018-12-04 17:23:10 +01:00
Alessio Treglia 956c2229bf Merge PR #2965: add --force to keys delete for unattended execution
* add --force to keys delete for unattended execution

Skip password check when --force is on and delete
keys unconditionally.

Closes: #2961

* Forcibly cleanup keys on fixtures initialization
2018-11-30 21:36:55 +01:00
Juan Leni 0473621570 Merge PR #2870: Upgrading ledger-cosmos-go dependency
* Upgrading dependencies
* Update dependency
2018-11-30 15:23:55 +01:00
Alessio Treglia a6bc60e4c6 Merge PR #2923: Prompt user for confirmation when deleting ledger and offline keys
* Force password to 'yes' when deleting ledger-offline keys
* Improve UX, better docs on removing offline/ledger keys
* Ask for confirmation on offline/ledger keys deletion
2018-11-29 21:55:23 +01:00
Alexander Bezobchuk 50926fffff Update to TM v0.26.0 - Part I (#2679)
* Update to TM v0.26.0
2018-11-04 18:28:38 -08:00
Christopher Goes 234262160e 'make format' 2018-10-24 15:37:06 +02:00
HaoyangLiu 9ee9e28439 Merge PR #2462: Add swagger-ui for gov, stake and slashing 2018-10-24 15:19:48 +02:00