[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" "bufio"
"fmt" "fmt"
"os" "os"
"strings"
"testing" "testing"
) )
@ -28,12 +27,19 @@ func fileToLines(filePath string) (lines []string, err error) {
} }
func testGenesisccounts(t *testing.T) { func testGenesisccounts(t *testing.T) {
lines, err := fileToLines("/home/ec2-user/tmp/alloneaccounts.txt") ones, err := fileToLines("one-acc.txt")
if err != nil { if err != nil {
t.Fatal("ReadFile failed", err) t.Fatal("ReadFile failed", err)
} }
for i, line := range lines { bls, err := fileToLines("bls-pub.txt")
fmt.Printf(" {Index: \"%v\", Address: \"%v\", BlsPublicKey: \"%v\"},\n", GenesisAccounts[i].Index, strings.Trim(line, " "), GenesisAccounts[i].BlsPublicKey) 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