From bc45e5c6de3052a4c853387dea0af5cd9207f1f7 Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Thu, 26 Feb 2015 13:22:09 +0100 Subject: 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 --- core/types/transaction.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core') 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)) } -- cgit From d66f93cecdbae6a88bfb710e0d95d62340bf2460 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Sat, 7 Mar 2015 12:38:33 +0100 Subject: accounts, core, eth, xeth: use account manager for everything The account manager is now responsible for picking the default account and the coinbase. --- core/manager.go | 2 -- 1 file changed, 2 deletions(-) (limited to 'core') diff --git a/core/manager.go b/core/manager.go index bb039d063..29f786653 100644 --- a/core/manager.go +++ b/core/manager.go @@ -1,7 +1,6 @@ package core import ( - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/p2p" @@ -14,7 +13,6 @@ type Backend interface { PeerCount() int IsListening() bool Peers() []*p2p.Peer - KeyManager() *crypto.KeyManager Db() ethutil.Database EventMux() *event.TypeMux } -- cgit From 2ee88a220ac22a814def1d568f80d7f29ede7095 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 9 Mar 2015 18:05:56 +0100 Subject: core: remove Hash method from Message interface This will simplify the next commmit. Hash was only used for logging. --- core/state_transition.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/state_transition.go b/core/state_transition.go index 00e383f3f..c487f8514 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -3,6 +3,7 @@ package core import ( "fmt" "math/big" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/state" @@ -44,8 +45,6 @@ type StateTransition struct { } type Message interface { - Hash() []byte - From() []byte To() []byte @@ -152,7 +151,7 @@ func (self *StateTransition) preCheck() (err error) { } func (self *StateTransition) TransitionState() (ret []byte, err error) { - statelogger.Debugf("(~) %x\n", self.msg.Hash()) + // statelogger.Debugf("(~) %x\n", self.msg.Hash()) // XXX Transactions after this point are considered valid. if err = self.preCheck(); err != nil { -- cgit From 80985f97da8174576ee227909035a364af2fd6c9 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 10 Mar 2015 02:35:46 +0100 Subject: cmd/evm, core, ethdb, state, tests/helper: remove ReadConfig calls --- core/chain_manager_test.go | 2 -- core/helper_test.go | 2 -- 2 files changed, 4 deletions(-) (limited to 'core') diff --git a/core/chain_manager_test.go b/core/chain_manager_test.go index e78c2e980..91822f9e2 100644 --- a/core/chain_manager_test.go +++ b/core/chain_manager_test.go @@ -12,14 +12,12 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/rlp" ) func init() { runtime.GOMAXPROCS(runtime.NumCPU()) - ethutil.ReadConfig("/tmp/ethtest", "/tmp/ethtest", "ETH") } // Test fork of length N starting from block i diff --git a/core/helper_test.go b/core/helper_test.go index 473576e3f..36d9e70a8 100644 --- a/core/helper_test.go +++ b/core/helper_test.go @@ -62,8 +62,6 @@ func (tm *TestManager) Db() ethutil.Database { } func NewTestManager() *TestManager { - ethutil.ReadConfig(".ethtest", "/tmp/ethtest", "ETH") - db, err := ethdb.NewMemDatabase() if err != nil { fmt.Println("Could not create mem-db, failing") -- cgit