From 4ac9fcee51bcfaaf11d64657c313eeded4c251b2 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Tue, 18 Jun 2019 23:55:54 +0000 Subject: [PATCH] [misc] add scripts to generate additional account/blspubkey Signed-off-by: Leo Chen --- internal/genesis/genesis_test.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/internal/genesis/genesis_test.go b/internal/genesis/genesis_test.go index 48ca2b5ae..ce518b2f8 100644 --- a/internal/genesis/genesis_test.go +++ b/internal/genesis/genesis_test.go @@ -4,7 +4,6 @@ import ( "bufio" "fmt" "os" - "strings" "testing" ) @@ -28,12 +27,19 @@ func fileToLines(filePath string) (lines []string, err error) { } func testGenesisccounts(t *testing.T) { - lines, err := fileToLines("/home/ec2-user/tmp/alloneaccounts.txt") + ones, err := fileToLines("one-acc.txt") if err != nil { t.Fatal("ReadFile failed", err) } - for i, line := range lines { - fmt.Printf(" {Index: \"%v\", Address: \"%v\", BlsPublicKey: \"%v\"},\n", GenesisAccounts[i].Index, strings.Trim(line, " "), GenesisAccounts[i].BlsPublicKey) + bls, err := fileToLines("bls-pub.txt") + if err != nil { + t.Fatal("ReadFile failed", err) + } + + index := 404 + for i, one := range ones { + fmt.Printf(" {Index: \" %v \", Address: \"%v\", BlsPublicKey: \"%v\"},\n", index, one, bls[i]) + index++ } }