Skip to content

docs: Add test specifications for TokenClaimTransaction #398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ivaylogarnev-limechain
Copy link
Contributor

Description:
This PR adds the test specifications for TokenClaimTransaction fields.

Related Issue(s):

Fixes #392

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: ivaylogarnev-limechain <[email protected]>
@lfdt-bot
Copy link
Contributor

lfdt-bot commented May 16, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)


| Parameter Name | Type | Required/Optional | Description/Notes |
|-------------------------|---------------------------------------------------------|-------------------|---------------------------------------------------------------------------------------------------------------------------------|
| accountId | string | required | The account ID that is claiming the airdrop. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending airdrops require a sender and a receiver account ID

| 9 | Claims an airdropped fungible token for an account without signing | accountId=<CREATED_ACCOUNT_ID>, tokenId=<CREATED_TOKEN_ID> | The claim fails with an INVALID_SIGNATURE response code from the network. | N |
| 10 | Claims an airdropped fungible token for an account that is frozen for the token | accountId=<CREATED_ACCOUNT_ID>, tokenId=<CREATED_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim fails with an ACCOUNT_FROZEN_FOR_TOKEN response code from the network. | N |
| 11 | Claims an airdropped paused fungible token for an account | accountId=<CREATED_ACCOUNT_ID>, tokenId=<CREATED_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim fails with a TOKEN_IS_PAUSED response code from the network. | N |
| 12 | Claims multiple airdropped fungible tokens for an account | accountId=<CREATED_ACCOUNT_ID>, tokenId=<CREATED_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim succeeds and the account has all airdrops of the token credited to its balance. | N |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this test only specifies one token? I think maybe the inputs to this function need to be looked at to allow for multiple airdrops to be added to the request

| 10 | Claims an airdropped fungible token for an account that is frozen for the token | accountId=<CREATED_ACCOUNT_ID>, tokenId=<CREATED_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim fails with an ACCOUNT_FROZEN_FOR_TOKEN response code from the network. | N |
| 11 | Claims an airdropped paused fungible token for an account | accountId=<CREATED_ACCOUNT_ID>, tokenId=<CREATED_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim fails with a TOKEN_IS_PAUSED response code from the network. | N |
| 12 | Claims multiple airdropped fungible tokens for an account | accountId=<CREATED_ACCOUNT_ID>, tokenId=<CREATED_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim succeeds and the account has all airdrops of the token credited to its balance. | N |
| 13 | Claims an airdropped fungible token with decimals for an account | accountId=<CREATED_ACCOUNT_ID>, tokenId=<CREATED_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim succeeds and the account has the amount airdropped credited to its balance with the correct decimal precision. | N |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need to specify decimals for an airdrop

| 12 | Claims multiple airdropped fungible tokens for an account | accountId=<CREATED_ACCOUNT_ID>, tokenId=<CREATED_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim succeeds and the account has all airdrops of the token credited to its balance. | N |
| 13 | Claims an airdropped fungible token with decimals for an account | accountId=<CREATED_ACCOUNT_ID>, tokenId=<CREATED_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim succeeds and the account has the amount airdropped credited to its balance with the correct decimal precision. | N |
| 14 | Claims an airdropped fungible token for an already associated account | accountId=<CREATED_ACCOUNT_ID>, tokenId=<CREATED_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim succeeds and the account has the amount airdropped credited to its balance. | N |
| 15 | Claims an airdropped fungible token for an unassociated account with automatic associations | accountId=<CREATED_ACCOUNT_ID>, tokenId=<CREATED_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim succeeds, the account is associated with the token, and has the amount airdropped credited to its balance. | N |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, for this test, you would need to try to send an airdrop to an account with no automatic associations to create the airdrop, then update the account to have associations and claim?


## Function Tests

### **ClaimFungibleToken:**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the SDKs only offer one setPendingAirdrops function in this class.

| 5 | Claims an airdropped token that doesn't exist for an account | accountId=<CREATED_ACCOUNT_ID>, tokenId="123.456.789", commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim fails with an INVALID_TOKEN_ID response code from the network. | N |
| 6 | Claims an airdropped token that is empty for an account | accountId=<CREATED_ACCOUNT_ID>, tokenId="", commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim fails with an SDK internal error. | N |
| 7 | Claims an airdropped token that is deleted for an account | accountId=<CREATED_ACCOUNT_ID>, tokenId=<DELETED_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim fails with a TOKEN_WAS_DELETED response code from the network. | N |
| 8 | Claims a non-airdropped fungible token for an account | accountId=<CREATED_ACCOUNT_ID>, tokenId=<CREATED_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The claim fails with a NO_REMAINING_AIRDROPS response code from the network. | N |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused by this test name. Is this just trying to claim an airdrop that doesn't exist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document E2E Tests: TokenAirdropClaimTransaction
3 participants