accounts: undo API-change to account manager

This commit is contained in:
Martin Holst Swende 2024-11-07 14:45:36 +01:00
parent 5a8c4ffbd4
commit afa22478dd
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0
5 changed files with 10 additions and 7 deletions

View file

@ -52,9 +52,14 @@ type Manager struct {
lock sync.RWMutex lock sync.RWMutex
} }
// Config is a legacy struct which is not used
type Config struct {
InsecureUnlockAllowed bool // Unused legacy-parameter
}
// NewManager creates a generic account manager to sign transaction via various // NewManager creates a generic account manager to sign transaction via various
// supported backends. // supported backends.
func NewManager(backends ...Backend) *Manager { func NewManager(config *Config, backends ...Backend) *Manager {
// Retrieve the initial list of wallets from the backends and sort by URL // Retrieve the initial list of wallets from the backends and sort by URL
var wallets []Wallet var wallets []Wallet
for _, backend := range backends { for _, backend := range backends {

View file

@ -193,7 +193,7 @@ nodes.
// makeAccountManager creates an account manager with backends // makeAccountManager creates an account manager with backends
func makeAccountManager(ctx *cli.Context) *accounts.Manager { func makeAccountManager(ctx *cli.Context) *accounts.Manager {
cfg := loadBaseConfig(ctx) cfg := loadBaseConfig(ctx)
am := accounts.NewManager() am := accounts.NewManager(nil)
keydir, isEphemeral, err := cfg.Node.GetKeyStoreDir() keydir, isEphemeral, err := cfg.Node.GetKeyStoreDir()
if err != nil { if err != nil {
utils.Fatalf("Failed to get the keystore directory: %v", err) utils.Fatalf("Failed to get the keystore directory: %v", err)

View file

@ -416,7 +416,7 @@ func allBlobTxs(addr common.Address, config *params.ChainConfig) []txData {
func newTestAccountManager(t *testing.T) (*accounts.Manager, accounts.Account) { func newTestAccountManager(t *testing.T) (*accounts.Manager, accounts.Account) {
var ( var (
dir = t.TempDir() dir = t.TempDir()
am = accounts.NewManager() am = accounts.NewManager(nil)
b = keystore.NewKeyStore(dir, 2, 1) b = keystore.NewKeyStore(dir, 2, 1)
testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
) )

View file

@ -130,7 +130,7 @@ func New(conf *Config) (*Node, error) {
node.keyDirTemp = isEphem node.keyDirTemp = isEphem
// Creates an empty AccountManager with no backends. Callers (e.g. cmd/geth) // Creates an empty AccountManager with no backends. Callers (e.g. cmd/geth)
// are required to add the backends later on. // are required to add the backends later on.
node.accman = accounts.NewManager() node.accman = accounts.NewManager(nil)
// Initialize the p2p server. This creates the node key and discovery databases. // Initialize the p2p server. This creates the node key and discovery databases.
node.server.Config.PrivateKey = node.config.NodeKey() node.server.Config.PrivateKey = node.config.NodeKey()

View file

@ -184,9 +184,7 @@ func StartClefAccountManager(ksLocation string, nousb, lightKDF bool, scpath str
} }
} }
} }
return accounts.NewManager(nil, backends...)
// Clef doesn't allow insecure http account unlock.
return accounts.NewManager(backends...)
} }
// MetadataFromContext extracts Metadata from a given context.Context // MetadataFromContext extracts Metadata from a given context.Context