Description
ContractService.getDonorCountOnChain(poolId) in src/contract/contract.service.ts parses a Soroban simulation result via scValToNative(retVal). contract.service.spec.ts's describe('getDonorCountOnChain', ...) block only tests the "returns 0 on RPC error" path — the success path, where simulateTransaction resolves with a real retval and the count is correctly extracted, is entirely untested.
Deliverables
Description
ContractService.getDonorCountOnChain(poolId)insrc/contract/contract.service.tsparses a Soroban simulation result viascValToNative(retVal).contract.service.spec.ts'sdescribe('getDonorCountOnChain', ...)block only tests the "returns 0 on RPC error" path — the success path, wheresimulateTransactionresolves with a realretvaland the count is correctly extracted, is entirely untested.Deliverables
service['rpcServer'].simulateTransaction(viajest.spyOn, following the pattern already used forservice['mapError']in the same file) to resolve with a mockresult.result.retval, and assertsgetDonorCountOnChainreturns the expected number