-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Abstract
accounts.Key
and geth keystore
- Loading branch information
Pedro Pombeiro
committed
Dec 20, 2019
1 parent
b99af53
commit 7963987
Showing
34 changed files
with
1,146 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// +build !nimbus | ||
|
||
package account | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/accounts" | ||
"github.com/status-im/status-go/account/generator" | ||
) | ||
|
||
// GethManager represents account manager interface. | ||
type GethManager struct { | ||
Manager | ||
|
||
manager *accounts.Manager | ||
} | ||
|
||
// NewManager returns new node account manager. | ||
func NewManager() *GethManager { | ||
m := &GethManager{} | ||
m.accountsGenerator = generator.New(m) | ||
return m | ||
} | ||
|
||
// InitKeystore sets key manager and key store. | ||
func (m *GethManager) InitKeystore(keydir string) error { | ||
m.mu.Lock() | ||
defer m.mu.Unlock() | ||
|
||
var err error | ||
m.manager, err = makeAccountManager(keydir) | ||
if err != nil { | ||
return err | ||
} | ||
m.keystore, err = makeKeyStore(m.manager) | ||
return err | ||
} | ||
|
||
func (m *GethManager) GetManager() *accounts.Manager { | ||
m.mu.RLock() | ||
defer m.mu.RUnlock() | ||
return m.manager | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// +build nimbus | ||
|
||
package account | ||
|
||
import ( | ||
"github.com/status-im/status-go/account/generator" | ||
) | ||
|
||
// NewManager returns new node account manager. | ||
func NewManager() *Manager { | ||
m := &Manager{} | ||
m.accountsGenerator = generator.New(m) | ||
return m | ||
} | ||
|
||
// InitKeystore sets key manager and key store. | ||
func (m *Manager) InitKeystore(keydir string) error { | ||
m.mu.Lock() | ||
defer m.mu.Unlock() | ||
|
||
// TODO: Wire with the Nimbus keystore | ||
manager, err := makeAccountManager(keydir) | ||
if err != nil { | ||
return err | ||
} | ||
m.keystore, err = makeKeyStore(manager) | ||
return err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.