diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-02-07 18:47:34 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-02-13 20:00:07 +0800 |
commit | fad5eb0a87abfc12812647344a26de8a43830182 (patch) | |
tree | a679f37933a85edade15ee69b385b6705cc94043 /accounts/backend.go | |
parent | b3c0e9d3ccb0bb326646aea47dda391a9552b122 (diff) | |
download | go-tangerine-fad5eb0a87abfc12812647344a26de8a43830182.tar go-tangerine-fad5eb0a87abfc12812647344a26de8a43830182.tar.gz go-tangerine-fad5eb0a87abfc12812647344a26de8a43830182.tar.bz2 go-tangerine-fad5eb0a87abfc12812647344a26de8a43830182.tar.lz go-tangerine-fad5eb0a87abfc12812647344a26de8a43830182.tar.xz go-tangerine-fad5eb0a87abfc12812647344a26de8a43830182.tar.zst go-tangerine-fad5eb0a87abfc12812647344a26de8a43830182.zip |
accounts, cmd, eth, internal, miner, node: wallets and HD APIs
Diffstat (limited to 'accounts/backend.go')
-rw-r--r-- | accounts/backend.go | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/accounts/backend.go b/accounts/backend.go deleted file mode 100644 index 5f7ac0717..000000000 --- a/accounts/backend.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2017 The go-ethereum Authors -// This file is part of the go-ethereum library. -// -// The go-ethereum library is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser 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-ethereum 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 Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. - -package accounts - -import ( - "math/big" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" -) - -// Backend is an "account provider" that can specify a batch of accounts it can -// sign transactions with and upon request, do so. -type Backend interface { - // Accounts retrieves the list of signing accounts the backend is currently aware of. - Accounts() []Account - - // HasAddress reports whether an account with the given address is present. - HasAddress(addr common.Address) bool - - // SignHash requests the backend to sign the given hash. - // - // It looks up the account specified either solely via its address contained within, - // or optionally with the aid of any location metadata from the embedded URL field. - // - // If the backend requires additional authentication to sign the request (e.g. - // a password to decrypt the account, or a PIN code o verify the transaction), - // an AuthNeededError instance will be returned, containing infos for the user - // about which fields or actions are needed. The user may retry by providing - // the needed details via SignHashWithPassphrase, or by other means (e.g. unlock - // the account in a keystore). - SignHash(acc Account, hash []byte) ([]byte, error) - - // SignTx requests the backend to sign the given transaction. - // - // It looks up the account specified either solely via its address contained within, - // or optionally with the aid of any location metadata from the embedded URL field. - // - // If the backend requires additional authentication to sign the request (e.g. - // a password to decrypt the account, or a PIN code o verify the transaction), - // an AuthNeededError instance will be returned, containing infos for the user - // about which fields or actions are needed. The user may retry by providing - // the needed details via SignTxWithPassphrase, or by other means (e.g. unlock - // the account in a keystore). - SignTx(acc Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) - - // SignHashWithPassphrase requests the backend to sign the given transaction with - // the given passphrase as extra authentication information. - // - // It looks up the account specified either solely via its address contained within, - // or optionally with the aid of any location metadata from the embedded URL field. - SignHashWithPassphrase(acc Account, passphrase string, hash []byte) ([]byte, error) - - // SignTxWithPassphrase requests the backend to sign the given transaction, with the - // given passphrase as extra authentication information. - // - // It looks up the account specified either solely via its address contained within, - // or optionally with the aid of any location metadata from the embedded URL field. - SignTxWithPassphrase(acc Account, passphrase string, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) - - // TODO(karalabe,fjl): watching and caching needs the Go subscription system - // Watch requests the backend to send a notification to the specified channel whenever - // an new account appears or an existing one disappears. - //Watch(chan AccountEvent) error - - // Unwatch requests the backend stop sending notifications to the given channel. - //Unwatch(chan AccountEvent) error -} - -// TODO(karalabe,fjl): watching and caching needs the Go subscription system -// type AccountEvent struct { -// Account Account -// Added bool -// } |