Skip to content

Fix broken integration tests in credential_flow.rs — wrong arg count, missing course setup #175

Description

@DeFiVC

What

Multiple integration tests in tests/integration/credential_flow.rs have compilation errors and logical bugs that would cause unexpected panics.

Why

  1. credential_client.get_credentials_for(learner) is called with 1 argument but the function requires 3: (learner, start, limit).
  2. Several tests (test_public_verification, test_multiple_course_credentials, test_credential_metadata_uri, test_credential_has_issuance_timestamp) mint credentials without ever creating courses first. The credential-nft contract calls tracker.course_exists(course_id) which returns false, causing unexpected panics.

Scope

  • Fix get_credentials_for call to include start and limit arguments
  • Add proper course creation and completion steps before each mint_credential call
  • Ensure all tests compile and pass

Technical Context

  • File: tests/integration/credential_flow.rs
  • The credential-nft mint function verifies course existence via the progress-tracker contract
  • Tests need a full flow: create course → enroll → complete modules/quizzes → mint credential

Acceptance Criteria

  • All test functions compile
  • get_credentials_for calls include correct argument count
  • Each test sets up necessary course data before minting credentials
  • Tests pass with cargo test

Metadata

Metadata

Assignees

No one assigned

    Labels

    highSignificant functionality broken, no workaround, affects multiple users

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions