示例#1
0
文件: base.py 项目: 9nix00/py-evm
 def validate_gaslimit(self, header):
     parent_header = self.get_block_header_by_hash(header.parent_hash)
     low_bound, high_bound = compute_gas_limit_bounds(parent_header)
     if header.gas_limit < low_bound:
         raise ValidationError(
             "The gas limit on block {0} is too low: {1}. It must be at least {2}".format(
                 encode_hex(header.hash), header.gas_limit, low_bound))
     elif header.gas_limit > high_bound:
         raise ValidationError(
             "The gas limit on block {0} is too high: {1}. It must be at most {2}".format(
                 encode_hex(header.hash), header.gas_limit, high_bound))
示例#2
0
文件: chain.py 项目: firefox0x/py-evm
 def validate_gaslimit(self, header):
     parent_header = self.get_block_header_by_hash(header.parent_hash)
     low_bound, high_bound = compute_gas_limit_bounds(parent_header)
     if header.gas_limit < low_bound:
         raise ValidationError(
             "The gas limit on block {0} is too low: {1}. It must be at least {2}".format(
                 encode_hex(header.hash), header.gas_limit, low_bound))
     elif header.gas_limit > high_bound:
         raise ValidationError(
             "The gas limit on block {0} is too high: {1}. It must be at most {2}".format(
                 encode_hex(header.hash), header.gas_limit, high_bound))