Change default keystore dir
This commit is contained in:
		@@ -68,7 +68,7 @@ func testJEthRE(t *testing.T) (string, *testjethre, *eth.Ethereum) {
 | 
				
			|||||||
	// set up mock genesis with balance on the testAddress
 | 
						// set up mock genesis with balance on the testAddress
 | 
				
			||||||
	core.GenesisData = []byte(testGenesis)
 | 
						core.GenesisData = []byte(testGenesis)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ks := crypto.NewKeyStorePassphrase(filepath.Join(tmp, "keys"))
 | 
						ks := crypto.NewKeyStorePassphrase(filepath.Join(tmp, "keystore"))
 | 
				
			||||||
	am := accounts.NewManager(ks)
 | 
						am := accounts.NewManager(ks)
 | 
				
			||||||
	ethereum, err := eth.New(ð.Config{
 | 
						ethereum, err := eth.New(ð.Config{
 | 
				
			||||||
		DataDir:        tmp,
 | 
							DataDir:        tmp,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -346,7 +346,7 @@ func GetChain(ctx *cli.Context) (*core.ChainManager, common.Database, common.Dat
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func GetAccountManager(ctx *cli.Context) *accounts.Manager {
 | 
					func GetAccountManager(ctx *cli.Context) *accounts.Manager {
 | 
				
			||||||
	dataDir := ctx.GlobalString(DataDirFlag.Name)
 | 
						dataDir := ctx.GlobalString(DataDirFlag.Name)
 | 
				
			||||||
	ks := crypto.NewKeyStorePassphrase(filepath.Join(dataDir, "keys"))
 | 
						ks := crypto.NewKeyStorePassphrase(filepath.Join(dataDir, "keystore"))
 | 
				
			||||||
	return accounts.NewManager(ks)
 | 
						return accounts.NewManager(ks)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -104,13 +104,13 @@ func testEth(t *testing.T) (ethereum *eth.Ethereum, err error) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	os.RemoveAll("/tmp/eth-natspec/")
 | 
						os.RemoveAll("/tmp/eth-natspec/")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = os.MkdirAll("/tmp/eth-natspec/keys", os.ModePerm)
 | 
						err = os.MkdirAll("/tmp/eth-natspec/keystore", os.ModePerm)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		panic(err)
 | 
							panic(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// create a testAddress
 | 
						// create a testAddress
 | 
				
			||||||
	ks := crypto.NewKeyStorePassphrase("/tmp/eth-natspec/keys")
 | 
						ks := crypto.NewKeyStorePassphrase("/tmp/eth-natspec/keystore")
 | 
				
			||||||
	am := accounts.NewManager(ks)
 | 
						am := accounts.NewManager(ks)
 | 
				
			||||||
	testAccount, err := am.NewAccount("password")
 | 
						testAccount, err := am.NewAccount("password")
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -181,7 +181,7 @@ func Decrypt(prv *ecdsa.PrivateKey, ct []byte) ([]byte, error) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Used only by block tests.
 | 
					// Used only by block tests.
 | 
				
			||||||
func ImportBlockTestKey(privKeyBytes []byte) error {
 | 
					func ImportBlockTestKey(privKeyBytes []byte) error {
 | 
				
			||||||
	ks := NewKeyStorePassphrase(common.DefaultDataDir() + "/keys")
 | 
						ks := NewKeyStorePassphrase(common.DefaultDataDir() + "/keystore")
 | 
				
			||||||
	ecKey := ToECDSA(privKeyBytes)
 | 
						ecKey := ToECDSA(privKeyBytes)
 | 
				
			||||||
	key := &Key{
 | 
						key := &Key{
 | 
				
			||||||
		Id:         uuid.NewRandom(),
 | 
							Id:         uuid.NewRandom(),
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -99,7 +99,7 @@ func runBlockTest(name string, test *BlockTest, t *testing.T) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func testEthConfig() *eth.Config {
 | 
					func testEthConfig() *eth.Config {
 | 
				
			||||||
	ks := crypto.NewKeyStorePassphrase(filepath.Join(common.DefaultDataDir(), "keys"))
 | 
						ks := crypto.NewKeyStorePassphrase(filepath.Join(common.DefaultDataDir(), "keystore"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return ð.Config{
 | 
						return ð.Config{
 | 
				
			||||||
		DataDir:        common.DefaultDataDir(),
 | 
							DataDir:        common.DefaultDataDir(),
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user