aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-02-26 20:22:09 +0800
committerFelix Lange <fjl@twurst.com>2015-03-06 21:10:42 +0800
commitbc45e5c6de3052a4c853387dea0af5cd9207f1f7 (patch)
tree3230b89b3bf25eaf53e1b3b164cb72e89d8c4398 /core
parente64f727529287b7414af6d1f482ea5f318cbd2eb (diff)
downloaddexon-bc45e5c6de3052a4c853387dea0af5cd9207f1f7.tar.gz
dexon-bc45e5c6de3052a4c853387dea0af5cd9207f1f7.tar.zst
dexon-bc45e5c6de3052a4c853387dea0af5cd9207f1f7.zip
Integrate eth_accounts and eth_transact to use new account manager
* Add from to eth_transact / xeth.Transact and add static pass in lieu of integrating with native Mist window for user passphrase entry * Make eth_accounts return AccountManager.Accounts() * Add a Generate Key menu item in Mist
Diffstat (limited to 'core')
-rw-r--r--core/types/transaction.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/types/transaction.go b/core/types/transaction.go
index 7a1d6104e..7d34c86f4 100644
--- a/core/types/transaction.go
+++ b/core/types/transaction.go
@@ -129,6 +129,7 @@ func (tx *Transaction) sender() []byte {
return crypto.Sha3(pubkey[1:])[12:]
}
+// TODO: deprecate after new accounts & key stores are integrated
func (tx *Transaction) Sign(privk []byte) error {
sig := tx.Signature(privk)
@@ -140,6 +141,13 @@ func (tx *Transaction) Sign(privk []byte) error {
return nil
}
+func (tx *Transaction) SetSignatureValues(sig []byte) error {
+ tx.R = sig[:32]
+ tx.S = sig[32:64]
+ tx.V = uint64(sig[64] + 27)
+ return nil
+}
+
func (tx *Transaction) SignECDSA(key *ecdsa.PrivateKey) error {
return tx.Sign(crypto.FromECDSA(key))
}