()
| 80 | } |
| 81 | |
| 82 | func getkey() (key *keystore.Key, err error) { |
| 83 | //Check if there is a keystore |
| 84 | password := "" |
| 85 | key, err = onchain.ReadEthKey(dosPath, password) |
| 86 | if err != nil && err.Error() == "No Account" { |
| 87 | return |
| 88 | } |
| 89 | //Get password from env variable |
| 90 | password = os.Getenv("PASSPHRASE") |
| 91 | if len(password) == 0 { |
| 92 | //Get password from terminal |
| 93 | password = getPassword("Enter password :") |
| 94 | } |
| 95 | key, err = onchain.ReadEthKey(dosPath, password) |
| 96 | |
| 97 | return |
| 98 | } |
| 99 | |
| 100 | func getPassword(s string) (p string) { |
| 101 | fmt.Print(s) |
nothing calls this directly
no test coverage detected