* 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
* remove old method closeDb from Keybase interface
* add changelog
* move to api breaking changes
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
* 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>
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.
* 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>
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).
* 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
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
* 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>
Add Keybase's ExportPrivKey()/ImportPrivKey() API calls to export/import
ASCII-armored private keys. Relevant keys subcommands are provided as well.
Closes: #2020
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
* 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