Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def pyspec_transition(pre_state, pre_block):
yaml = YAML(typ='base')
loaded = yaml.load(Path('min.config.bak'))
config_data = dict()
for k, v in loaded.items():
if v.startswith("0x"):
config_data[k] = bytes.fromhex(v[2:])
else:
config_data[k] = int(v)
spec.apply_constants_preset(config_data)
spec_pre_state = decoder.translate_value(pre_state, spec.BeaconState)
spec_pre_block = decoder.translate_value(pre_block, spec.BeaconBlock)
spec_post_block = spec.state_transition(
spec_pre_state, spec_pre_block, False
)
return spec_post_block
def pyspec_transition(pre_state, pre_block):
yaml = YAML(typ='base')
loaded = yaml.load(Path('min.config.bak'))
config_data = dict()
for k, v in loaded.items():
if v.startswith("0x"):
config_data[k] = bytes.fromhex(v[2:])
else:
config_data[k] = int(v)
spec.apply_constants_preset(config_data)
spec_pre_state = decoder.translate_value(pre_state, spec.BeaconState)
spec_pre_block = decoder.translate_value(pre_block, spec.BeaconBlock)
spec_post_block = spec.state_transition(
spec_pre_state, spec_pre_block, False
)
return spec_post_block
def pyspec_transition(pre_state, pre_block):
yaml = YAML(typ='base')
loaded = yaml.load(Path('min.config.bak'))
config_data = dict()
for k, v in loaded.items():
if v.startswith("0x"):
config_data[k] = bytes.fromhex(v[2:])
else:
config_data[k] = int(v)
spec.apply_constants_preset(config_data)
spec_pre_state = decoder.translate_value(pre_state, spec.BeaconState)
spec_pre_block = decoder.translate_value(pre_block, spec.BeaconBlock)
spec_post_block = spec.state_transition(
spec_pre_state, spec_pre_block, False
)
return spec_post_block
def pyspec_transition(pre_state, pre_block):
yaml = YAML(typ='base')
loaded = yaml.load(Path('min.config.bak'))
config_data = dict()
for k, v in loaded.items():
if v.startswith("0x"):
config_data[k] = bytes.fromhex(v[2:])
else:
config_data[k] = int(v)
spec.apply_constants_preset(config_data)
spec_pre_state = decoder.translate_value(pre_state, spec.BeaconState)
spec_pre_block = decoder.translate_value(pre_block, spec.BeaconBlock)
spec_post_block = spec.state_transition(
spec_pre_state, spec_pre_block, False
)
return spec_post_block