[node.sh] fix a race condition in bls loader test

pull/3219/head
Jacky Wang 4 years ago
parent e519e0e62a
commit dd62845f09
No known key found for this signature in database
GPG Key ID: 1085CE5F4FF5842C
  1. 9
      cmd/harmony/blsloader/kms.go

@ -226,8 +226,9 @@ func (provider *promptACProvider) prompt(hint string) (string, error) {
timedOut = time.After(provider.timeout)
)
cs := console
go func() {
res, err = provider.threadedPrompt(hint)
res, err = provider.threadedPrompt(cs, hint)
close(finished)
}()
@ -241,9 +242,9 @@ func (provider *promptACProvider) prompt(hint string) (string, error) {
}
}
func (provider *promptACProvider) threadedPrompt(hint string) (string, error) {
console.print(hint)
return console.readPassword()
func (provider *promptACProvider) threadedPrompt(cs consoleItf, hint string) (string, error) {
cs.print(hint)
return cs.readPassword()
}
func kmsClientWithConfig(config *AwsConfig) (*kms.KMS, error) {

Loading…
Cancel
Save