update core code to use swapped BLS sig

pull/974/head
Rongjian Lan 6 years ago
parent b099073d6c
commit 9a749e487e
  1. 2
      README.md
  2. 4
      api/proto/discovery/pingpong_test.go
  3. 2
      go.mod
  4. 6
      internal/utils/utils_test.go

@ -37,7 +37,7 @@ cd mcl && make -j4 && cd ..
git clone git@github.com:harmony-one/bls.git
cd bls && make -j4 && cd ..
cd bls && make BLS_SWAP_G=1 -j4 && cd ..
git clone git@github.com:harmony-one/harmony.git

@ -20,8 +20,8 @@ var (
Port: "9999",
ConsensusPubKey: pubKey1,
}
e1 = "ping:Validator/1=>127.0.0.1:9999/[120 1 130 197 30 202 78 236 84 249 5 230 132 208 242 242 246 63 100 123 96 11 211 228 4 56 64 94 57 133 3 226 254 222 231 160 178 81 252 205 40 28 45 2 90 74 207 15 68 86 138 68 143 176 221 161 108 105 133 6 64 121 92 25 134 255 9 209 156 209 119 187 13 160 23 147 240 24 196 152 100 20 163 51 118 45 100 26 179 227 184 166 147 113 50 139]"
e3 = "ping:Client/1=>127.0.0.1:9999/[120 1 130 197 30 202 78 236 84 249 5 230 132 208 242 242 246 63 100 123 96 11 211 228 4 56 64 94 57 133 3 226 254 222 231 160 178 81 252 205 40 28 45 2 90 74 207 15 68 86 138 68 143 176 221 161 108 105 133 6 64 121 92 25 134 255 9 209 156 209 119 187 13 160 23 147 240 24 196 152 100 20 163 51 118 45 100 26 179 227 184 166 147 113 50 139]"
e1 = "ping:Validator/1=>127.0.0.1:9999/[243 115 129 181 183 47 198 209 163 18 215 155 77 104 111 72 137 195 176 68 51 235 192 7 86 203 82 136 233 41 255 250 49 53 101 89 110 5 249 216 141 233 10 129 171 124 49 151]"
e3 = "ping:Client/1=>127.0.0.1:9999/[243 115 129 181 183 47 198 209 163 18 215 155 77 104 111 72 137 195 176 68 51 235 192 7 86 203 82 136 233 41 255 250 49 53 101 89 110 5 249 216 141 233 10 129 171 124 49 151]"
pubKey2 = pki.GetBLSPrivateKeyFromInt(999).GetPublicKey()

@ -23,7 +23,7 @@ require (
github.com/gorilla/handlers v1.4.0
github.com/gorilla/mux v1.7.0
github.com/harmony-ek/gencodec v0.0.0-20190215044613-e6740dbdd846
github.com/harmony-one/bls v0.0.1
github.com/harmony-one/bls v0.0.2
github.com/hashicorp/golang-lru v0.5.1
github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365
github.com/ipfs/go-datastore v0.0.1

@ -216,18 +216,18 @@ func TestGetBlsAddress(t *testing.T) {
}{
{
pubKey1,
"0x8fAd8DAa0206a9a6710b05604a58e6EA1B3A160E",
"0x489e9EC9863A29B086Fb979cefCA02277FbE513d",
},
{
pubKey2,
"0x91B5B75ddeb29085BF0490bc562e93059Ad1c254",
"0x836a098a5E04015c2c331657a1B90DBCb154fb37",
},
}
for _, test := range tests {
result := GetBlsAddress(test.key)
if result.Hex() != test.expected {
t.Errorf("Hex Of %v is: %v, got: %v", test.key, test.expected, result)
t.Errorf("Hex Of %x is: %s, got: %s", test.key, test.expected, result.Hex())
}
}

Loading…
Cancel
Save