def apply_confirm(header, payload, state):
    confirm_payload = role_transaction_pb2.ConfirmAddRoleAdmin()
    confirm_payload.ParseFromString(payload.content)

    role_members_address = addresser.make_role_members_address(
        role_id=confirm_payload.role_id, user_id=confirm_payload.user_id)

    txn_signer_owners_address = addresser.make_role_owners_address(
        role_id=confirm_payload.role_id, user_id=header.signer_public_key)

    state_entries = validate_role_admin_or_owner(
        header=header,
        confirm=confirm_payload,
        txn_signer_rel_address=txn_signer_owners_address,
        state=state)

    handle_confirm_add(state_entries=state_entries,
                       header=header,
                       confirm=confirm_payload,
                       role_rel_address=role_members_address,
                       state=state)
예제 #2
0
def apply_confirm(header, payload, state):
    confirm = role_transaction_pb2.ConfirmAddRoleTask()
    confirm.ParseFromString(payload.content)

    txn_signer_task_owner_address = addresser.make_task_owners_address(
        confirm.task_id, header.signer_public_key)

    role_rel_address = addresser.make_role_tasks_address(
        role_id=confirm.role_id, task_id=confirm.task_id)

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

    handle_confirm_add(state_entries=state_entries,
                       header=header,
                       confirm=confirm,
                       role_rel_address=role_rel_address,
                       state=state,
                       rel_type='task_id')