[misc] add scripts to generate additional account/blspubkey

Signed-off-by: Leo Chen <leo@harmony.one>
pull/1094/head
Leo Chen 6 years ago
parent e6bc05a9c0
commit 4ac9fcee51
  1. 14
      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++
}
}

Loading…
Cancel
Save