コード例 #1
0
def apply_confirm(header, payload, state):
    confirm = role_transaction_pb2.ConfirmAddRoleTask()
    confirm.ParseFromString(payload.content)

    txn_signer_task_owner_address = addresser.task.owner.address(
        confirm.task_id, header.signer_public_key)

    role_rel_address = addresser.role.task.address(confirm.role_id,
                                                   confirm.task_id)

    state_entries = role_validator.validate_role_task(
        header,
        confirm,
        txn_signer_rel_address=txn_signer_task_owner_address,
        state=state,
    )

    state_change.confirm_role_action(
        state_entries=state_entries,
        header=header,
        confirm=confirm,
        role_rel_address=role_rel_address,
        state=state,
        rel_type="task_id",
    )
コード例 #2
0
def apply_reject(header, payload, state):
    reject = role_transaction_pb2.RejectAddRoleTask()
    reject.ParseFromString(payload.content)

    txn_signer_task_owner_address = addresser.task.owner.address(
        reject.task_id, header.signer_public_key)

    state_entries = role_validator.validate_role_task(
        header,
        reject,
        txn_signer_rel_address=txn_signer_task_owner_address,
        state=state,
    )

    state_change.reject_role_action(
        state_entries=state_entries,
        header=header,
        reject=reject,
        state=state,
        rel_type="task_id",
    )