We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f7f6295 commit 8e70ceaCopy full SHA for 8e70cea
eth/precompiles/blake2.py
@@ -1,4 +1,3 @@
1
-import blake2b
2
from eth_utils import (
3
ValidationError,
4
)
@@ -11,6 +10,11 @@
11
10
BaseComputation,
12
13
+try:
14
+ from blake2b import compress as blake2b_compress
15
+except ModuleNotFoundError:
16
+ from eth._utils.blake2.compression import blake2b_compress
17
+
18
GAS_COST_PER_ROUND = 1
19
20
@@ -25,5 +29,5 @@ def blake2b_fcompress(computation: BaseComputation) -> BaseComputation:
25
29
26
30
computation.consume_gas(gas_cost, reason=f"Blake2b Compress Precompile w/ {num_rounds} rounds")
27
31
28
- computation.output = blake2b.compress(*parameters)
32
+ computation.output = blake2b_compress(*parameters)
33
return computation
0 commit comments