-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: main
Are you sure you want to change the base?
docs: Add test specifications for TokenClaimTransaction
#398
Conversation
Signed-off-by: ivaylogarnev-limechain <[email protected]>
🎉 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. | |
There was a problem hiding this comment.
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 | |
There was a problem hiding this comment.
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 | |
There was a problem hiding this comment.
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 | |
There was a problem hiding this comment.
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:** |
There was a problem hiding this comment.
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 | |
There was a problem hiding this comment.
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?
Description:
This PR adds the test specifications for
TokenClaimTransaction
fields.Related Issue(s):
Fixes #392
Checklist