@@ -59,10 +59,8 @@ var allPrecompiles = map[libcommon.Address]PrecompiledContract{
5959 libcommon .BytesToAddress ([]byte {8 }): & bn256PairingIstanbul {},
6060 libcommon .BytesToAddress ([]byte {9 }): & blake2F {},
6161 libcommon .BytesToAddress ([]byte {10 }): & bls12381G1Add {},
62- libcommon .BytesToAddress ([]byte {11 }): & bls12381G1Mul {},
6362 libcommon .BytesToAddress ([]byte {12 }): & bls12381G1MultiExp {},
6463 libcommon .BytesToAddress ([]byte {13 }): & bls12381G2Add {},
65- libcommon .BytesToAddress ([]byte {14 }): & bls12381G2Mul {},
6664 libcommon .BytesToAddress ([]byte {15 }): & bls12381G2MultiExp {},
6765 libcommon .BytesToAddress ([]byte {16 }): & bls12381Pairing {},
6866 libcommon .BytesToAddress ([]byte {17 }): & bls12381MapFpToG1 {},
@@ -312,10 +310,8 @@ func benchJson(name, addr string, b *testing.B) {
312310}
313311
314312func TestPrecompiledBLS12381G1Add (t * testing.T ) { testJson ("blsG1Add" , "0a" , t ) }
315- func TestPrecompiledBLS12381G1Mul (t * testing.T ) { testJson ("blsG1Mul" , "0b" , t ) }
316313func TestPrecompiledBLS12381G1MultiExp (t * testing.T ) { testJson ("blsG1MultiExp" , "0c" , t ) }
317314func TestPrecompiledBLS12381G2Add (t * testing.T ) { testJson ("blsG2Add" , "0d" , t ) }
318- func TestPrecompiledBLS12381G2Mul (t * testing.T ) { testJson ("blsG2Mul" , "0e" , t ) }
319315func TestPrecompiledBLS12381G2MultiExp (t * testing.T ) { testJson ("blsG2MultiExp" , "0f" , t ) }
320316func TestPrecompiledBLS12381Pairing (t * testing.T ) { testJson ("blsPairing" , "10" , t ) }
321317func TestPrecompiledBLS12381MapG1 (t * testing.T ) { testJson ("blsMapG1" , "11" , t ) }
@@ -326,48 +322,20 @@ func BenchmarkPrecompiledBLS12381G1Add(b *testing.B) { benchJson("blsG1Add"
326322func BenchmarkPrecompiledBLS12381G1Mul (b * testing.B ) { benchJson ("blsG1Mul" , "0b" , b ) }
327323func BenchmarkPrecompiledBLS12381G1MultiExp (b * testing.B ) { benchJson ("blsG1MultiExp" , "0c" , b ) }
328324func BenchmarkPrecompiledBLS12381G2Add (b * testing.B ) { benchJson ("blsG2Add" , "0d" , b ) }
329- func BenchmarkPrecompiledBLS12381G2Mul (b * testing.B ) { benchJson ("blsG2Mul" , "0e" , b ) }
330325func BenchmarkPrecompiledBLS12381G2MultiExp (b * testing.B ) { benchJson ("blsG2MultiExp" , "0f" , b ) }
331326func BenchmarkPrecompiledBLS12381Pairing (b * testing.B ) { benchJson ("blsPairing" , "10" , b ) }
332327func BenchmarkPrecompiledBLS12381MapG1 (b * testing.B ) { benchJson ("blsMapG1" , "11" , b ) }
333328func BenchmarkPrecompiledBLS12381MapG2 (b * testing.B ) { benchJson ("blsMapG2" , "12" , b ) }
334329
335330// Failure tests
336331func TestPrecompiledBLS12381G1AddFail (t * testing.T ) { testJsonFail ("blsG1Add" , "0a" , t ) }
337- func TestPrecompiledBLS12381G1MulFail (t * testing.T ) { testJsonFail ("blsG1Mul" , "0b" , t ) }
338332func TestPrecompiledBLS12381G1MultiExpFail (t * testing.T ) { testJsonFail ("blsG1MultiExp" , "0c" , t ) }
339333func TestPrecompiledBLS12381G2AddFail (t * testing.T ) { testJsonFail ("blsG2Add" , "0d" , t ) }
340- func TestPrecompiledBLS12381G2MulFail (t * testing.T ) { testJsonFail ("blsG2Mul" , "0e" , t ) }
341334func TestPrecompiledBLS12381G2MultiExpFail (t * testing.T ) { testJsonFail ("blsG2MultiExp" , "0f" , t ) }
342335func TestPrecompiledBLS12381PairingFail (t * testing.T ) { testJsonFail ("blsPairing" , "10" , t ) }
343336func TestPrecompiledBLS12381MapG1Fail (t * testing.T ) { testJsonFail ("blsMapG1" , "11" , t ) }
344337func TestPrecompiledBLS12381MapG2Fail (t * testing.T ) { testJsonFail ("blsMapG2" , "12" , t ) }
345338
346- // Tests from https://github.com/ethereum/EIPs/tree/master/assets/eip-2537
347- func TestPrecompiledBLS12381G1AddEip (t * testing.T ) { testJson ("blsG1Add-eip" , "0a" , t ) }
348- func TestPrecompiledBLS12381G1MulEip (t * testing.T ) { testJson ("blsG1Mul-eip" , "0b" , t ) }
349- func TestPrecompiledBLS12381G1MultiExpEip (t * testing.T ) { testJson ("blsG1MultiExp-eip" , "0c" , t ) }
350- func TestPrecompiledBLS12381G2AddEip (t * testing.T ) { testJson ("blsG2Add-eip" , "0d" , t ) }
351- func TestPrecompiledBLS12381G2MulEip (t * testing.T ) { testJson ("blsG2Mul-eip" , "0e" , t ) }
352- func TestPrecompiledBLS12381G2MultiExpEip (t * testing.T ) { testJson ("blsG2MultiExp-eip" , "0f" , t ) }
353- func TestPrecompiledBLS12381PairingEip (t * testing.T ) { testJson ("blsPairing-eip" , "10" , t ) }
354- func TestPrecompiledBLS12381MapG1Eip (t * testing.T ) { testJson ("blsMapG1-eip" , "11" , t ) }
355- func TestPrecompiledBLS12381MapG2Eip (t * testing.T ) { testJson ("blsMapG2-eip" , "12" , t ) }
356-
357- func TestPrecompiledBLS12381G1AddFailEip (t * testing.T ) { testJsonFail ("blsG1Add-eip" , "0a" , t ) }
358- func TestPrecompiledBLS12381G1MulFailEip (t * testing.T ) { testJsonFail ("blsG1Mul-eip" , "0b" , t ) }
359- func TestPrecompiledBLS12381G1MultiExpFailEip (t * testing.T ) {
360- testJsonFail ("blsG1MultiExp-eip" , "0c" , t )
361- }
362- func TestPrecompiledBLS12381G2AddFailEip (t * testing.T ) { testJsonFail ("blsG2Add-eip" , "0d" , t ) }
363- func TestPrecompiledBLS12381G2MulFailEip (t * testing.T ) { testJsonFail ("blsG2Mul-eip" , "0e" , t ) }
364- func TestPrecompiledBLS12381G2MultiExpFailEip (t * testing.T ) {
365- testJsonFail ("blsG2MultiExp-eip" , "0f" , t )
366- }
367- func TestPrecompiledBLS12381PairingFailEip (t * testing.T ) { testJsonFail ("blsPairing-eip" , "10" , t ) }
368- func TestPrecompiledBLS12381MapG1FailEip (t * testing.T ) { testJsonFail ("blsMapG1-eip" , "11" , t ) }
369- func TestPrecompiledBLS12381MapG2FailEip (t * testing.T ) { testJsonFail ("blsMapG2-eip" , "12" , t ) }
370-
371339func loadJson (name string ) ([]precompiledTest , error ) {
372340 data , err := os .ReadFile (fmt .Sprintf ("testdata/precompiles/%v.json" , name ))
373341 if err != nil {
@@ -438,7 +406,7 @@ func BenchmarkPrecompiledP256Verify(b *testing.B) {
438406}
439407
440408func TestPrecompiledP256Verify (t * testing.T ) {
441- t .Parallel ()
409+ // t.Parallel()
442410
443411 testJson ("p256Verify" , "100" , t )
444412}
0 commit comments