From 9a79042155bf3496d750b6073ad33801e8b85c2a Mon Sep 17 00:00:00 2001 From: Rongjian Lan Date: Wed, 15 Aug 2018 15:03:40 -0700 Subject: [PATCH] Add util to lookup private key from address (for benchmark) --- client/utils.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 client/utils.go diff --git a/client/utils.go b/client/utils.go new file mode 100644 index 000000000..af45ed881 --- /dev/null +++ b/client/utils.go @@ -0,0 +1,12 @@ +package client + +import "github.com/simple-rules/harmony-benchmark/crypto/pki" + +var AddressToIntPriKeyMap map[[20]byte]int // For convenience, we use int as the secret seed for generating private key + +func init() { + AddressToIntPriKeyMap := make(map[[20]byte]int) + for i := 0; i < 10000; i++ { + AddressToIntPriKeyMap[pki.GetAddressFromInt(i)] = i + } +}