account

package
v0.0.0-...-5fbb372 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright (C) 2018 go-gamc authors

This file is part of the go-gamc library.

the go-gamc library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

the go-gamc library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with the go-gamc library. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	DefaultAddressUnlockedDuratuion = time.Second * 60
)

Variables

View Source
var (
	ErrSaveDBError = errors.New("Failed to save datebase")
	ErrInitDBError = errors.New("Failure of database initialization")
)

Functions

This section is empty.

Types

type AccountManager

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

func NewAccountManager

func NewAccountManager(config *config.Config, db cdb.Storage) (*AccountManager, error)

func (*AccountManager) AddressIsValid

func (am *AccountManager) AddressIsValid(address string) (*core.Address, error)

func (*AccountManager) AddressManager

func (am *AccountManager) AddressManager() *address.AddressManager

func (*AccountManager) GetAllAddress

func (am *AccountManager) GetAllAddress() []*core.Address

func (*AccountManager) ImportAccount

func (am *AccountManager) ImportAccount(priKey, passphrase []byte) (*core.Address, error)

func (*AccountManager) Lock

func (am *AccountManager) Lock(address *core.Address) error

func (*AccountManager) NewAccount

func (am *AccountManager) NewAccount(passphrase []byte) (*core.Address, string, error)

return address,mnemonicWord

func (*AccountManager) Sign

func (am *AccountManager) Sign(address *core.Address, hash []byte) ([]byte, error)

func (*AccountManager) SignBlock

func (am *AccountManager) SignBlock(address *core.Address, block *core.Block) error

func (*AccountManager) UnLock

func (am *AccountManager) UnLock(address *core.Address, passphrase []byte, duratuion time.Duration) error

func (*AccountManager) UpdateAccount

func (am *AccountManager) UpdateAccount(address string, oldPassphrase, newPassphrase []byte) error

func (*AccountManager) Verify

func (am *AccountManager) Verify(pubKey []byte, message, sig []byte) bool

Jump to

Keyboard shortcuts

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