laconicd-deprecated/crypto/keys/codec.go
Austin Abell cfac906f92
Ethermint key generation (#78)
* WIP setting up Ethereum key CLI commands

* Functional key gen and showing Ethereum address

* Cleaned up changes

* WIP setting up Ethereum key CLI commands

* Functional key gen and showing Ethereum address

* Cleaned up changes

* Changed address to cosmos specific address

* Remove default bech32 prefixes and add basic add command test

* Changed Private key type to slice of bytes for compatibility and storability

* switch back to using cosmos crypto Keybase interfaces

* Changed key output to ethereum addressing instead of bitcoin and key generation to allow seeding from mnemonic and bip39 password

* Updated show command and added test

* Remove prefix requirement for showing keys and added existing keys commands to CLI temporarily

* Removed unnecessary duplicate code

* Readd prefixes for accounts temporarily

* Fix linting issue

* Remove TODO for setting PK to specific length of bytes (all functions use slice)

* Cleaned up descriptions to remove multi-sigs
2019-08-11 10:42:46 -04:00

26 lines
817 B
Go

package keys
import (
cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys/hd"
emintCrypto "github.com/cosmos/ethermint/crypto"
cosmosKeys "github.com/cosmos/cosmos-sdk/crypto/keys"
)
var cdc *codec.Codec
func init() {
cdc = codec.New()
cryptoAmino.RegisterAmino(cdc)
cdc.RegisterInterface((*cosmosKeys.Info)(nil), nil)
emintCrypto.RegisterCodec(cdc)
cdc.RegisterConcrete(hd.BIP44Params{}, "crypto/keys/hd/BIP44Params", nil)
cdc.RegisterConcrete(localInfo{}, "crypto/keys/localInfo", nil)
cdc.RegisterConcrete(ledgerInfo{}, "crypto/keys/ledgerInfo", nil)
cdc.RegisterConcrete(offlineInfo{}, "crypto/keys/offlineInfo", nil)
// cdc.RegisterConcrete(multiInfo{}, "crypto/keys/multiInfo", nil)
cdc.Seal()
}