Skip to content

[P3] Add a success-path unit test for ContractService.getTotalRaisedOnChain #1152

Description

@cyber-punk112

Description

ContractService.getTotalRaisedOnChain(poolId) in src/contract/contract.service.ts parses a bigint (or bigint-like) value out of a simulated contract call. contract.service.spec.ts's describe('getTotalRaisedOnChain', ...) block only exercises the "returns 0n on RPC error" branch, never the branch where simulateTransaction succeeds and a real value is returned and converted to bigint.

Deliverables

  • Add a test that stubs service['rpcServer'].simulateTransaction to resolve with a mock retval, and asserts getTotalRaisedOnChain returns the expected bigint
  • npm run build passes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MediumbackendNestJS server workgood first issueGood for newcomersphase-2Phase 2 beginner-friendly backlog: cleanup, tests, docs, polish

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions