mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-26 09:15:17 +00:00
Refactor shard_state_transition
This commit is contained in:
parent
7fb9226ec6
commit
f1e4b3c88b
@ -72,14 +72,13 @@ The post-state corresponding to a pre-state `shard_state` and a signed block `si
|
|||||||
def shard_state_transition(shard_state: ShardState,
|
def shard_state_transition(shard_state: ShardState,
|
||||||
signed_block: SignedShardBlock,
|
signed_block: SignedShardBlock,
|
||||||
beacon_parent_state: BeaconState,
|
beacon_parent_state: BeaconState,
|
||||||
validate_result: bool = True) -> ShardState:
|
validate_result: bool = True) -> None:
|
||||||
assert verify_shard_block_message(beacon_parent_state, shard_state, signed_block.message)
|
assert verify_shard_block_message(beacon_parent_state, shard_state, signed_block.message)
|
||||||
|
|
||||||
if validate_result:
|
if validate_result:
|
||||||
assert verify_shard_block_signature(beacon_parent_state, signed_block)
|
assert verify_shard_block_signature(beacon_parent_state, signed_block)
|
||||||
|
|
||||||
process_shard_block(shard_state, signed_block.message)
|
process_shard_block(shard_state, signed_block.message)
|
||||||
return shard_state
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
Loading…
x
Reference in New Issue
Block a user