From 2badfca7e8fc7ec24b689604c47afbbd9e5e7dc3 Mon Sep 17 00:00:00 2001 From: ehsan shariati Date: Sat, 4 Nov 2023 19:40:49 -0400 Subject: [PATCH] remove newline and space from read seed (#176) --- blockchain/keystore.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blockchain/keystore.go b/blockchain/keystore.go index 2a896bf4..f1465164 100644 --- a/blockchain/keystore.go +++ b/blockchain/keystore.go @@ -3,6 +3,7 @@ package blockchain import ( "context" "os" + "strings" ) // Implementations for this interface should be responsible for saving/loading a single key. @@ -45,5 +46,6 @@ func (s *SimpleKeyStorer) LoadKey(ctx context.Context) (string, error) { if err != nil { return "", err } - return string(data), nil + // Trim the whitespace characters from the beginning and end of the string + return strings.TrimSpace(string(data)), nil }