diff --git a/src/services/chains/index.test.ts b/src/services/chains/index.test.ts index b86c50ad3..f995eef98 100644 --- a/src/services/chains/index.test.ts +++ b/src/services/chains/index.test.ts @@ -470,25 +470,6 @@ function getTransactionDetailTestCases() { // assert.notEqual(transactionInfo.hash, txHash); // }); - it('should return transaction detail for normal transfer on goerli', async () => { - // https://goerli.etherscan.io/tx/0x43cb1c61a81f007abd3de766a6029ffe62d0324268d7781469a3d7879d487cb1 - - const amount = 0.117; - const transactionInfo = await getTransactionInfoFromNetwork({ - txHash: - '0x43cb1c61a81f007abd3de766a6029ffe62d0324268d7781469a3d7879d487cb1', - symbol: 'ETH', - networkId: NETWORK_IDS.GOERLI, - fromAddress: '0xc18c3cc1cf44e72dedfcbae981ef1ab32256ee60', - toAddress: '0x2d2b642c7407ebce201ed80711124fffd1777331', - amount, - timestamp: 1661114988, - }); - assert.isOk(transactionInfo); - assert.equal(transactionInfo.currency, 'ETH'); - assert.equal(transactionInfo.amount, amount); - }); - // TODO: Rewrite this test for goerli or delete // it('should return transaction detail for UNI token transfer on ropsten', async () => { // // https://ropsten.etherscan.io/tx/0xba3c2627c9d3dd963455648b4f9d7239e8b5c80d0aa85ac354d2b762d99e4441 diff --git a/src/services/donationService.test.ts b/src/services/donationService.test.ts index e67fc31d7..60892acec 100644 --- a/src/services/donationService.test.ts +++ b/src/services/donationService.test.ts @@ -86,61 +86,6 @@ function sendSegmentEventForDonationTestCases() { } function syncDonationStatusWithBlockchainNetworkTestCases() { - it('should verify a goerli donation and update donor.totalDonated and projectOwner.totalReceived', async () => { - // https://goerli.etherscan.io/tx/0x43cb1c61a81f007abd3de766a6029ffe62d0324268d7781469a3d7879d487cb1 - - const transactionInfo = { - txHash: - '0x43cb1c61a81f007abd3de766a6029ffe62d0324268d7781469a3d7879d487cb1', - networkId: NETWORK_IDS.GOERLI, - amount: 0.117, - fromAddress: '0xc18c3cc1cf44e72dedfcbae981ef1ab32256ee60', - toAddress: '0x2d2b642c7407ebce201ed80711124fffd1777331', - currency: 'ETH', - timestamp: 1661114988, - }; - const user = await saveUserDirectlyToDb(transactionInfo.fromAddress); - const projectOwner = await saveUserDirectlyToDb( - generateRandomEtheriumAddress(), - ); - const project = await saveProjectDirectlyToDb( - { - ...createProjectData(), - walletAddress: transactionInfo.toAddress, - }, - projectOwner, - ); - const donation = await saveDonationDirectlyToDb( - { - amount: transactionInfo.amount, - transactionNetworkId: transactionInfo.networkId, - transactionId: transactionInfo.txHash, - currency: transactionInfo.currency, - fromWalletAddress: transactionInfo.fromAddress, - toWalletAddress: transactionInfo.toAddress, - valueUsd: 100, - anonymous: false, - createdAt: new Date(transactionInfo.timestamp), - status: DONATION_STATUS.PENDING, - }, - user.id, - project.id, - ); - const updateDonation = await syncDonationStatusWithBlockchainNetwork({ - donationId: donation.id, - }); - assert.isOk(updateDonation); - assert.equal(updateDonation.id, donation.id); - assert.isTrue(updateDonation.segmentNotified); - assert.equal(updateDonation.status, DONATION_STATUS.VERIFIED); - - const donor = await findUserById(user.id); - assert.equal(donor?.totalDonated, 100); - - const updatedProjectOwner = await findUserById(projectOwner.id); - assert.equal(updatedProjectOwner?.totalReceived, 100); - }); - it('should verify a Polygon donation', async () => { // https://polygonscan.com/tx/0x16f122ad45705dfa41bb323c3164b6d840cbb0e9fa8b8e58bd7435370f8bbfc8 diff --git a/src/services/donationService.ts b/src/services/donationService.ts index 43d1c8fe7..6fd930fe8 100644 --- a/src/services/donationService.ts +++ b/src/services/donationService.ts @@ -419,7 +419,7 @@ export const syncDonationStatusWithBlockchainNetwork = async (params: { totalDonated: donationStats?.totalDonated, donationsCount: donationStats?.donationsCount, lastDonationDate: donationStats?.lastDonationDate, - GIVbacksRound: donation.powerRound, + GIVbacksRound: donation.powerRound + 1, // powerRound is 1 behind givbacks round QFRound: donation.qfRound?.name, donationChain: NETWORKS_IDS_TO_NAME[donation.transactionNetworkId], });