• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hicommonwealth / commonwealth / 18717258828

22 Oct 2025 01:09PM UTC coverage: 37.183% (-0.04%) from 37.226%
18717258828

push

github

web-flow
Add claim tx dates (#13119)

* Add claim tx dates

* add finalized

* txn validation

* Remove commented import

---------

Co-authored-by: rotorsoft <rotorsoft@outlook.com>
Co-authored-by: timolegros <timothee@ualberta.ca>

1995 of 5785 branches covered (34.49%)

Branch coverage included in aggregate %.

0 of 11 new or added lines in 3 files covered. (0.0%)

2 existing lines in 2 files now uncovered.

3501 of 8996 relevant lines covered (38.92%)

44.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/libs/model/src/aggregates/token-allocation/UpdateClaimTransactionHash.command.ts
1
import { type Command } from '@hicommonwealth/core';
2
import * as schemas from '@hicommonwealth/schemas';
3
import { QueryTypes } from 'sequelize';
4
import { models } from '../../database';
5
import { validateClaimTxnHash } from '../../utils/validateClaimTxnHash';
6

7
export function UpdateClaimTransactionHash(): Command<
8
  typeof schemas.UpdateClaimTransactionHash
9
> {
10
  return {
×
11
    ...schemas.UpdateClaimTransactionHash,
12
    auth: [],
13
    secure: true,
14
    body: async ({ payload, actor }) => {
15
      const { transaction_hash } = payload;
×
16

NEW
17
      const txnAt = await validateClaimTxnHash(transaction_hash);
×
18

UNCOV
19
      const [, updated] = await models.sequelize.query(
×
20
        `
21
          UPDATE "ClaimAddresses"
22
          SET 
23
            magna_claim_tx_hash = :transaction_hash,
24
            magna_claim_tx_at = :transaction_at
25
          WHERE
26
            user_id = :user_id
27
            AND magna_claimed_at IS NOT NULL
28
            AND magna_claim_data IS NOT NULL
29
            AND magna_claim_tx_hash IS NULL;
30
        `,
31
        {
32
          type: QueryTypes.UPDATE,
33
          replacements: {
34
            user_id: actor.user.id,
35
            transaction_hash,
36
            transaction_at: txnAt,
37
          },
38
        },
39
      );
40

41
      return updated > 0;
×
42
    },
43
  };
44
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc