Documentation
¶
Index ¶
- Variables
- func GetSignBytes(toSign []byte, meta types.MsgMeta) (interface{}, []byte, error)
- func NewWallet(ks storage.KeyStore, mw storage.KeyMiddleware, filter ISignMsgFilter, ...) wallet_api.ILocalWallet
- func RegisterSupportedMsgTypes(msgType types.MsgType, p reflect.Type, fGetSignBytes FGetSignBytes, ...) (replaced bool)
- type FGetSignBytes
- type FParseObj
- type GetPwdFunc
- type ISignMsgFilter
- type SignFilter
- type SignMsg
- type Types
Constants ¶
This section is empty.
Variables ¶
View Source
var SupportedMsgTypes = map[types.MsgType]*Types{ types.MTDealProposal: {reflect.TypeOf(market.DealProposal{}), func(i interface{}) ([]byte, error) { return cborutil.Dump(i) }, nil}, types.MTClientDeal: {reflect.TypeOf(market.ClientDealProposal{}), func(in interface{}) ([]byte, error) { ni, err := cborutil.AsIpld(in) if err != nil { return nil, err } return ni.Cid().Bytes(), nil }, nil}, types.MTDrawRandomParam: {reflect.TypeOf(types2.DrawRandomParams{}), func(in interface{}) ([]byte, error) { param := in.(*types2.DrawRandomParams) return param.SignBytes() }, nil}, types.MTSignedVoucher: {reflect.TypeOf(paych.SignedVoucher{}), func(in interface{}) ([]byte, error) { return (in.(*paych.SignedVoucher)).SigningBytes() }, nil}, types.MTStorageAsk: {reflect.TypeOf(storagemarket.StorageAsk{}), func(in interface{}) ([]byte, error) { return cborutil.Dump(in) }, nil}, types.MTAskResponse: {Type: reflect.TypeOf(network.AskResponse{}), /* contains filtered or unexported fields */}, types.MTNetWorkResponse: {reflect.TypeOf(network.Response{}), func(in interface{}) ([]byte, error) { return cborutil.Dump(in) }, nil}, types.MTBlock: {reflect.TypeOf(types.BlockHeader{}), func(in interface{}) ([]byte, error) { return in.(*types.BlockHeader).SignatureData() }, nil}, types.MTChainMsg: {reflect.TypeOf(types.Message{}), func(in interface{}) ([]byte, error) { msg := in.(*types.Message) return msg.Cid().Bytes(), nil }, nil}, types.MTProviderDealState: { reflect.TypeOf(storagemarket.ProviderDealState{}), func(in interface{}) ([]byte, error) { return cborutil.Dump(in) }, nil, }, types.MTUnknown: {reflect.TypeOf([]byte{}), func(in interface{}) ([]byte, error) { msg, isok := in.([]byte) if !isok { return nil, fmt.Errorf("MTUnkown must be []byte") } return msg, nil }, func(in []byte, meta types.MsgMeta) (interface{}, error) { if meta.Type == types.MTUnknown { return in, nil } return nil, fmt.Errorf("un-expected MsgType:%s", meta.Type) }}, types.MTVerifyAddress: { Type: reflect.TypeOf([]byte{}), // contains filtered or unexported fields }, }
SupportedMsgTypes signature type factory
Functions ¶
func GetSignBytes ¶ added in v1.9.0
GetSignBytes Matches the type and returns the data that needs to be signed
func NewWallet ¶
func NewWallet(ks storage.KeyStore, mw storage.KeyMiddleware, filter ISignMsgFilter, bus EventBus.Bus, getPwd GetPwdFunc) wallet_api.ILocalWallet
func RegisterSupportedMsgTypes ¶ added in v1.9.0
Types ¶
type FGetSignBytes ¶ added in v1.9.0
type GetPwdFunc ¶ added in v1.2.0
type GetPwdFunc func() string
type ISignMsgFilter ¶ added in v1.9.0
type SignFilter ¶ added in v1.9.0
type SignFilter struct {
// contains filtered or unexported fields
}
func NewSignFilter ¶ added in v1.9.0
func NewSignFilter(cfg *config.SignFilter) *SignFilter
func (*SignFilter) CheckSignMsg ¶ added in v1.9.0
func (filter *SignFilter) CheckSignMsg(ctx context.Context, signMsg SignMsg) error
Click to show internal directories.
Click to hide internal directories.