@ -180,8 +180,8 @@ Fatal: could not decrypt key with given password
func TestUnlockFlag ( t * testing . T ) {
func TestUnlockFlag ( t * testing . T ) {
datadir := tmpDatadirWithKeystore ( t )
datadir := tmpDatadirWithKeystore ( t )
geth := runGeth ( t ,
geth := runGeth ( t ,
"--datadir" , datadir , "-- nat" , "none" , "--nodiscover" , "--maxpeers" , "0" , "--port" , "0" ,
"--nat" , "none" , "--nodiscover" , "--maxpeers" , "0" , "--port" , "0" , "--nousb" , "--cache" , "256" , "--ipcdisable " ,
"--unlock" , "f466859ead1932d743d622cb74fc058882e8648a" ,
"--datadir" , datadir , "-- unlock" , "f466859ead1932d743d622cb74fc058882e8648a" ,
"js" , "testdata/empty.js" )
"js" , "testdata/empty.js" )
geth . Expect ( `
geth . Expect ( `
Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 1 / 3
Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 1 / 3
@ -204,8 +204,8 @@ Password: {{.InputLine "foobar"}}
func TestUnlockFlagWrongPassword ( t * testing . T ) {
func TestUnlockFlagWrongPassword ( t * testing . T ) {
datadir := tmpDatadirWithKeystore ( t )
datadir := tmpDatadirWithKeystore ( t )
geth := runGeth ( t ,
geth := runGeth ( t ,
"--datadir" , datadir , "-- nat" , "none" , "--nodiscover" , "--maxpeers" , "0" , "--port" , "0" ,
"--nat" , "none" , "--nodiscover" , "--maxpeers" , "0" , "--port" , "0" , "--nousb" , "--cache" , "128" , "--ipcdisable " ,
"--unlock" , "f466859ead1932d743d622cb74fc058882e8648a" )
"--datadir" , datadir , "-- unlock" , "f466859ead1932d743d622cb74fc058882e8648a" )
defer geth . ExpectExit ( )
defer geth . ExpectExit ( )
geth . Expect ( `
geth . Expect ( `
Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 1 / 3
Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 1 / 3
@ -223,9 +223,8 @@ Fatal: Failed to unlock account f466859ead1932d743d622cb74fc058882e8648a (could
func TestUnlockFlagMultiIndex ( t * testing . T ) {
func TestUnlockFlagMultiIndex ( t * testing . T ) {
datadir := tmpDatadirWithKeystore ( t )
datadir := tmpDatadirWithKeystore ( t )
geth := runGeth ( t ,
geth := runGeth ( t ,
"--datadir" , datadir , "--nat" , "none" , "--nodiscover" , "--maxpeers" , "0" , "--port" , "0" ,
"--nat" , "none" , "--nodiscover" , "--maxpeers" , "0" , "--port" , "0" , "--nousb" , "--cache" , "128" , "--ipcdisable" ,
"--unlock" , "0,2" ,
"--datadir" , datadir , "--unlock" , "0,2" , "js" , "testdata/empty.js" )
"js" , "testdata/empty.js" )
geth . Expect ( `
geth . Expect ( `
Unlocking account 0 | Attempt 1 / 3
Unlocking account 0 | Attempt 1 / 3
! ! Unsupported terminal , password will be echoed .
! ! Unsupported terminal , password will be echoed .
@ -250,8 +249,8 @@ Password: {{.InputLine "foobar"}}
func TestUnlockFlagPasswordFile ( t * testing . T ) {
func TestUnlockFlagPasswordFile ( t * testing . T ) {
datadir := tmpDatadirWithKeystore ( t )
datadir := tmpDatadirWithKeystore ( t )
geth := runGeth ( t ,
geth := runGeth ( t ,
"--datadir" , datadir , "-- nat" , "none" , "--nodiscover" , "--maxpeers" , "0" , "--port" , "0" ,
"--nat" , "none" , "--nodiscover" , "--maxpeers" , "0" , "--port" , "0" , "--nousb" , "--cache" , "128" , "--ipcdisable " ,
"--password" , "testdata/passwords.txt" , "--unlock" , "0,2" ,
"--datadir" , datadir , "-- password" , "testdata/passwords.txt" , "--unlock" , "0,2" ,
"js" , "testdata/empty.js" )
"js" , "testdata/empty.js" )
geth . ExpectExit ( )
geth . ExpectExit ( )
@ -270,8 +269,8 @@ func TestUnlockFlagPasswordFile(t *testing.T) {
func TestUnlockFlagPasswordFileWrongPassword ( t * testing . T ) {
func TestUnlockFlagPasswordFileWrongPassword ( t * testing . T ) {
datadir := tmpDatadirWithKeystore ( t )
datadir := tmpDatadirWithKeystore ( t )
geth := runGeth ( t ,
geth := runGeth ( t ,
"--datadir" , datadir , "-- nat" , "none" , "--nodiscover" , "--maxpeers" , "0" , "--port" , "0" ,
"--nat" , "none" , "--nodiscover" , "--maxpeers" , "0" , "--port" , "0" , "--nousb" , "--cache" , "128" , "--ipcdisable " ,
"--password" , "testdata/wrong-passwords.txt" , "--unlock" , "0,2" )
"--datadir" , datadir , "-- password" , "testdata/wrong-passwords.txt" , "--unlock" , "0,2" )
defer geth . ExpectExit ( )
defer geth . ExpectExit ( )
geth . Expect ( `
geth . Expect ( `
Fatal : Failed to unlock account 0 ( could not decrypt key with given password )
Fatal : Failed to unlock account 0 ( could not decrypt key with given password )
@ -281,8 +280,8 @@ Fatal: Failed to unlock account 0 (could not decrypt key with given password)
func TestUnlockFlagAmbiguous ( t * testing . T ) {
func TestUnlockFlagAmbiguous ( t * testing . T ) {
store := filepath . Join ( ".." , ".." , "accounts" , "keystore" , "testdata" , "dupes" )
store := filepath . Join ( ".." , ".." , "accounts" , "keystore" , "testdata" , "dupes" )
geth := runGeth ( t ,
geth := runGeth ( t ,
"--keystore" , store , "-- nat" , "none" , "--nodiscover" , "--maxpeers" , "0" , "--port" , "0" ,
"--nat" , "none" , "--nodiscover" , "--maxpeers" , "0" , "--port" , "0" , "--nousb" , "--cache" , "128" , "--ipcdisable " ,
"--unlock" , "f466859ead1932d743d622cb74fc058882e8648a" ,
"--keystore" , store , "-- unlock" , "f466859ead1932d743d622cb74fc058882e8648a" ,
"js" , "testdata/empty.js" )
"js" , "testdata/empty.js" )
defer geth . ExpectExit ( )
defer geth . ExpectExit ( )
@ -319,8 +318,8 @@ In order to avoid this warning, you need to remove the following duplicate key f
func TestUnlockFlagAmbiguousWrongPassword ( t * testing . T ) {
func TestUnlockFlagAmbiguousWrongPassword ( t * testing . T ) {
store := filepath . Join ( ".." , ".." , "accounts" , "keystore" , "testdata" , "dupes" )
store := filepath . Join ( ".." , ".." , "accounts" , "keystore" , "testdata" , "dupes" )
geth := runGeth ( t ,
geth := runGeth ( t ,
"--keystore" , store , "-- nat" , "none" , "--nodiscover" , "--maxpeers" , "0" , "--port" , "0" ,
"--nat" , "none" , "--nodiscover" , "--maxpeers" , "0" , "--port" , "0" , "--nousb" , "--cache" , "128" , "--ipcdisable " ,
"--unlock" , "f466859ead1932d743d622cb74fc058882e8648a" )
"--keystore" , store , "-- unlock" , "f466859ead1932d743d622cb74fc058882e8648a" )
defer geth . ExpectExit ( )
defer geth . ExpectExit ( )
// Helper for the expect template, returns absolute keystore path.
// Helper for the expect template, returns absolute keystore path.