signhelper

package
v0.0.0-...-2f68b9a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or or http://www.opensource.org/licenses/mit-license.php

Index

Constants

This section is empty.

Variables

View Source
var (
	ModeLog                  = "签名助手"
	ErrNilAccountManager     = errors.New("account manager is nil")
	ErrNilKeyStore           = errors.New("key store is nil")
	ErrKeyStoreCount         = errors.New("key stores is empty")
	ErrKeyStoreReflect       = errors.New("reflect key stores failed")
	ErrIllegalSignAccount    = errors.New("sign account is illegal")
	ErrReader                = errors.New("auth reader is nil")
	ErrGetAccountAndPassword = errors.New("get account and password  error")
)

Functions

This section is empty.

Types

type AuthReader

type AuthReader interface {
	GetSignAccountPassword(signAccounts []common.Address) (common.Address, string, error)
	GetA2AccountsFromA0Account(a0Account common.Address, blockHash common.Hash) ([]common.Address, error)
	GetA0AccountFromAnyAccount(account common.Address, blockHash common.Hash) (common.Address, common.Address, error)
	GetA2AccountsFromA0AccountAtSignHeight(a0Account common.Address, blockHash common.Hash, signHeight uint64) ([]common.Address, error)
	GetA0AccountFromAnyAccountAtSignHeight(account common.Address, blockHash common.Hash, signHeight uint64) (common.Address, common.Address, error)
}

type MatrixEth

type MatrixEth interface {
	BlockChain() *core.BlockChain
}

type SignHelper

type SignHelper struct {
	// contains filtered or unexported fields
}

func NewSignHelper

func NewSignHelper() *SignHelper

func (*SignHelper) SetAccountManager

func (sh *SignHelper) SetAccountManager(am *accounts.Manager) error

func (*SignHelper) SetAuthReader

func (sh *SignHelper) SetAuthReader(reader AuthReader) error

func (*SignHelper) SignHashWithValidate

func (sh *SignHelper) SignHashWithValidate(hash []byte, validate bool, blkHash common.Hash) (common.Signature, error)

func (*SignHelper) SignHashWithValidateByAccount

func (sh *SignHelper) SignHashWithValidateByAccount(hash []byte, validate bool, account common.Address) (common.Signature, error)

func (*SignHelper) SignHashWithValidateByReader

func (sh *SignHelper) SignHashWithValidateByReader(reader AuthReader, hash []byte, validate bool, blkHash common.Hash) (common.Signature, error)

func (*SignHelper) SignTx

func (sh *SignHelper) SignTx(tx types.SelfTransaction, chainID *big.Int, blkHash common.Hash, signHeight uint64, usingEntrust bool) (types.SelfTransaction, error)

func (*SignHelper) SignVrf

func (sh *SignHelper) SignVrf(msg []byte, blkHash common.Hash) ([]byte, []byte, []byte, error)

func (*SignHelper) SignVrfByAccount

func (sh *SignHelper) SignVrfByAccount(msg []byte, account common.Address) ([]byte, []byte, []byte, error)

func (*SignHelper) VerifySignWithValidateByReader

func (sh *SignHelper) VerifySignWithValidateByReader(reader AuthReader, signHash []byte, sig []byte, blkHash common.Hash) (common.Address, common.Address, bool, error)

func (*SignHelper) VerifySignWithValidateDependHash

func (sh *SignHelper) VerifySignWithValidateDependHash(signHash []byte, sig []byte, blkHash common.Hash) (common.Address, common.Address, bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL