* WIP on protobuf keys
* Use Type() and Bytes() in sr25519 pub key Equals
* Add tests
* Add few more tests
* Update other pub/priv key types Equals
* Fix PrivKey's Sign method
* Rename variables in tests
* Fix infinite recursive calls
* Use tm ed25519 keys
* Add Sign and VerifySignature tests
* Remove ed25519 and sr25519 references
* proto linting
* Add proto crypto file
* Implement some of the new multisig proto type methods
* Add tests for MultisigThresholdPubKey
* Add tests for pubkey pb/amino conversion functions
* Move crypto types.go and register new proto pubkeys
* Add missing pointer ref
* Address review comments
* panic in MultisigThresholdPubKey VerifySignature
* Use internal crypto.PubKey in multisig
* Add tests for MultisigThresholdPubKey VerifyMultisignature
* Only keep LegacyAminoMultisigThresholdPubKey and move to proto keys to v1
* Remove conversion functions and introduce internal PubKey type
* Start removal of old PubKeyMultisigThreshold references
* Remove old secp256k1 PubKey and PrivKey
* Uncomment test case
* Fix linting issues
* More linting
* Revert tests keys values
* Add Amino overrides to proto keys
* Add pubkey test
* Fix tests
* Use threshold isntead of K
* Standardize Type
* Revert standardize types commit
* Add comment
* Simplify proto names
* Fixed merge issues
* Uncomment tests
* Remove old multisig
* Add amino marshal for multisig
* Fix lint
* Correctly register amino
* One test left!
* Remove old struct
* Fix test
* Fix test
* Unpack into tmcrypto
* Remove old threshold pubkey tests
* Fix register amino
* Fix lint
* Use sdk crypto PubKey in multisig UnpackInterfaces
* Potential fix?
* Use anil's suggestion
Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
* WIP on protobuf keys
* Use Type() and Bytes() in sr25519 pub key Equals
* Add tests
* Add few more tests
* Update other pub/priv key types Equals
* Fix PrivKey's Sign method
* Rename variables in tests
* Fix infinite recursive calls
* Use tm ed25519 keys
* Add Sign and VerifySignature tests
* Remove ed25519 and sr25519 references
* proto linting
* Add proto crypto file
* Implement some of the new multisig proto type methods
* Add tests for MultisigThresholdPubKey
* Add tests for pubkey pb/amino conversion functions
* Move crypto types.go and register new proto pubkeys
* Add missing pointer ref
* Address review comments
* panic in MultisigThresholdPubKey VerifySignature
* Use internal crypto.PubKey in multisig
* Add tests for MultisigThresholdPubKey VerifyMultisignature
* Only keep LegacyAminoMultisigThresholdPubKey and move to proto keys to v1
* Remove conversion functions and introduce internal PubKey type
* Remove old secp256k1 PubKey and PrivKey
* Uncomment test case
* Fix linting issues
* More linting
* Revert tests keys values
* Add Amino overrides to proto keys
* Add pubkey test
* Fix tests
* Use threshold isntead of K
* Standardize Type
* Revert standardize types commit
* Add comment
* Simplify proto names
* Add comment about multisig codec
Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* create base proto package, move ValAddresses to staking
* move tx, crypto, query proto packages into base; mark module level packages as beta
* new cosmos/base/abci.proto file, refactor some message names
* add comments to TxResponse
* refactor RegisterInterface calls to new proto package names
* fix bug in merge commit
* move missing module proto packages to beta, move cosmos.kv to cosmos.base.kv
* add tx.proto files, holding proto messages for module Msgs
* rm old generated pb.go files
* cosmos/base/base.proto -> cosmos/base/coin.proto
* mark genutil proto package as beta
* Fix conflicts
* Restructure proto files
* Re put signing
* Fix test
* Update slashing genesis
* Ignore confio proto files
* Fix interface register
* Make proto-gen
* Fix lint
* Put tx service into tx.v1beta1
* Use v1beta1 in interface registry
* Remove to cosmos.base.store
* Remove extra confio in buf
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
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.
* 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>
x/staking: Fix all linter warnings.
Fixed warnings across base packages.
New linters:
- unparam
- nolintlint
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
* 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
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>
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.
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.
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.
* 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>
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.
* 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