Documentation
¶
Index ¶
- Constants
- Variables
- type CashecError
- type CommitteeKeyString
- type CommitteePublicKey
- func (pubKey *CommitteePublicKey) Bytes() ([]byte, error)
- func (pubKey *CommitteePublicKey) CheckSanityData() bool
- func (pubKey *CommitteePublicKey) FromBase58(keyString string) error
- func (pubKey *CommitteePublicKey) FromBytes(keyBytes []byte) error
- func (pubKey *CommitteePublicKey) FromString(keyString string) error
- func (pubKey *CommitteePublicKey) GetIncKeyBase58() string
- func (pubKey *CommitteePublicKey) GetMiningKey(schemeName string) ([]byte, error)
- func (pubKey *CommitteePublicKey) GetMiningKeyBase58(schemeName string) string
- func (pubKey *CommitteePublicKey) GetNormalKey() []byte
- func (committeePublicKey *CommitteePublicKey) IsEqual(target CommitteePublicKey) bool
- func (pubKey *CommitteePublicKey) IsEqualMiningPubKey(consensusName string, k *CommitteePublicKey) bool
- func (committeePublicKey *CommitteePublicKey) IsValid(target CommitteePublicKey) bool
- func (pubKey *CommitteePublicKey) RawBytes() ([]byte, error)
- func (pubKey *CommitteePublicKey) ToBase58() (string, error)
- type KeySet
Constants ¶
View Source
const ( InvalidPrivateKeyErr = iota B58DecodePubKeyErr B58DecodeSigErr B58ValidateErr InvalidDataValidateErr SignDataB58Err InvalidDataSignErr InvalidVerificationKeyErr DecodeFromStringErr SignError JSONError )
Variables ¶
View Source
var ErrCodeMessage = map[int]struct { Code int Message string }{ InvalidPrivateKeyErr: {-201, "Private key is invalid"}, B58DecodePubKeyErr: {-202, "Base58 decode pub key error"}, B58DecodeSigErr: {-203, "Base58 decode signature error"}, B58ValidateErr: {-204, "Base58 validate data error"}, InvalidDataValidateErr: {-205, "Validated base58 data is invalid"}, SignDataB58Err: {-206, "Signing B58 data error"}, InvalidDataSignErr: {-207, "Signed data is invalid"}, InvalidVerificationKeyErr: {-208, "Verification key is invalid"}, DecodeFromStringErr: {-209, "Decode key set from string error"}, SignError: {-210, "Can not sign data"}, JSONError: {-211, "JSON Marshal, Unmarshal error"}, }
View Source
var GetMiningKeyBase58Cache, _ = lru.New(2000)
View Source
var ToBase58Cache, _ = lru.New(2000)
Functions ¶
This section is empty.
Types ¶
type CashecError ¶
func NewCashecError ¶
func NewCashecError(key int, err error) *CashecError
func (CashecError) Error ¶
func (e CashecError) Error() string
func (CashecError) GetCode ¶
func (e CashecError) GetCode() int
type CommitteeKeyString ¶
type CommitteePublicKey ¶
func NewCommitteeKeyFromSeed ¶
func NewCommitteeKeyFromSeed(seed, incPubKey []byte) (CommitteePublicKey, error)
func NewCommitteePublicKey ¶
func NewCommitteePublicKey() *CommitteePublicKey
func (*CommitteePublicKey) Bytes ¶
func (pubKey *CommitteePublicKey) Bytes() ([]byte, error)
func (*CommitteePublicKey) CheckSanityData ¶
func (pubKey *CommitteePublicKey) CheckSanityData() bool
func (*CommitteePublicKey) FromBase58 ¶
func (pubKey *CommitteePublicKey) FromBase58(keyString string) error
func (*CommitteePublicKey) FromBytes ¶
func (pubKey *CommitteePublicKey) FromBytes(keyBytes []byte) error
func (*CommitteePublicKey) FromString ¶
func (pubKey *CommitteePublicKey) FromString(keyString string) error
func (*CommitteePublicKey) GetIncKeyBase58 ¶
func (pubKey *CommitteePublicKey) GetIncKeyBase58() string
func (*CommitteePublicKey) GetMiningKey ¶
func (pubKey *CommitteePublicKey) GetMiningKey(schemeName string) ([]byte, error)
func (*CommitteePublicKey) GetMiningKeyBase58 ¶
func (pubKey *CommitteePublicKey) GetMiningKeyBase58(schemeName string) string
func (*CommitteePublicKey) GetNormalKey ¶
func (pubKey *CommitteePublicKey) GetNormalKey() []byte
func (*CommitteePublicKey) IsEqual ¶
func (committeePublicKey *CommitteePublicKey) IsEqual(target CommitteePublicKey) bool
func (*CommitteePublicKey) IsEqualMiningPubKey ¶
func (pubKey *CommitteePublicKey) IsEqualMiningPubKey(consensusName string, k *CommitteePublicKey) bool
func (*CommitteePublicKey) IsValid ¶
func (committeePublicKey *CommitteePublicKey) IsValid(target CommitteePublicKey) bool
func (*CommitteePublicKey) RawBytes ¶
func (pubKey *CommitteePublicKey) RawBytes() ([]byte, error)
func (*CommitteePublicKey) ToBase58 ¶
func (pubKey *CommitteePublicKey) ToBase58() (string, error)
type KeySet ¶
type KeySet struct { PrivateKey privacy.PrivateKey PaymentAddress privacy.PaymentAddress ReadonlyKey privacy.ViewingKey }
KeySet is real raw data of wallet account, which user can use to - spend and check double spend coin with private key - receive coin with payment address - read tx data with readonly key
func (*KeySet) GenerateKey ¶
GenerateKey generates key set from seed in byte array
func (*KeySet) InitFromPrivateKey ¶
func (keySet *KeySet) InitFromPrivateKey(privateKey *privacy.PrivateKey) error
InitFromPrivateKey receives private key in PrivateKey type, and regenerates payment address and readonly key returns error if private key is invalid
func (*KeySet) InitFromPrivateKeyByte ¶
InitFromPrivateKeyByte receives private key in bytes array, and regenerates payment address and readonly key returns error if private key is invalid
Click to show internal directories.
Click to hide internal directories.