Exemplo n.º 1
0
    def import_block(
        self,
        block: BaseBeaconBlock,
        state: BeaconState,
        check_proposer_signature: bool = True,
    ) -> Tuple[BeaconState, BaseBeaconBlock]:
        state = self.state_transition.apply_state_transition(
            state,
            block=block,
            check_proposer_signature=check_proposer_signature)

        block = block.copy(state_root=state.hash_tree_root)

        return state, block
Exemplo n.º 2
0
    def import_block(
        self,
        block: BaseBeaconBlock,
        check_proposer_signature: bool = False
    ) -> Tuple[BeaconState, BaseBeaconBlock]:
        state = self.state_transition.apply_state_transition(
            self.state,
            block,
            check_proposer_signature,
        )

        block = block.copy(state_root=state.root, )

        return state, block