Skip to content

Harden StarkNet campaign client typing and failure coverage #58

Description

@pragmaticAweds

Context

The non-mock Cairo/StarkNet campaign client still uses several any casts for transaction execution and receipt event parsing. It also has only mock-client coverage today. The production client should have focused tests around required environment variables, transaction hash extraction, event campaign ID parsing, and RPC failure handling.

Scope

  • Replace broad any usage in StarkNet receipt and execution handling with narrow local types
  • Extract and test campaign-created event parsing behavior
  • Add tests for missing required Cairo/StarkNet environment variables
  • Add tests for missing transaction hash in contract execution result
  • Add tests for fallback campaign ID behavior when no campaign-created event key is configured
  • Ensure retry behavior is exercised with mocked provider/account calls where practical

Out of Scope

  • Changing the Cairo contract interface
  • Live testnet integration tests
  • Campaign service business-rule changes

Acceptance Criteria

  • Production StarkNet client behavior is covered without requiring live RPC access
  • Receipt parsing does not depend on unbounded any types
  • Missing config and malformed execution results fail with clear errors
  • bun run type-check passes
  • bun run test passes
  • bun run lint passes

Suggested Files or Packages

  • src/services/cairo/campaignFactory.starknet.ts
  • src/services/cairo/campaignFactory.client.ts
  • src/__tests__/

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions