Skip to content
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

docs: Add test specifications for TokenAssociateTransaction #264

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

Conversation

rwalworth
Copy link
Contributor

@rwalworth rwalworth commented Oct 30, 2024

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

Related Issue(s):

Fixes #133

Checklist

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

@rwalworth rwalworth added the documentation Improvements or additions to documentation label Oct 30, 2024
@rwalworth rwalworth self-assigned this Oct 30, 2024
@rwalworth rwalworth linked an issue Oct 30, 2024 that may be closed by this pull request
Copy link
Contributor

@ivaylogarnev-limechain ivaylogarnev-limechain left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +104 to +108
| 1 | Associates no tokens with an account | accountId=<CREATED_ACCOUNT_ID>, commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The token association succeeds and no associations are made. | N |
| 2 | Associates a token that doesn't exist with an account | accountId=<CREATED_ACCOUNT_ID>, tokenIds=["123.456.789"], commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The token association fails with an INVALID_TOKEN_ID response code from the network. | N |
| 3 | Associates a token that is deleted with an account | accountId=<CREATED_ACCOUNT_ID>, tokenIds=[<DELETED_TOKEN_ID>], commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The token association fails with an TOKEN_WAS_DELETED response code from the network. | N |
| 4 | Associates a token that is empty with an account | accountId=<CREATED_ACCOUNT_ID>, tokenIds=[""], commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The token association fails with an SDK internal error. | N |
| 5 | Associates a token twice with an account | accountId=<CREATED_ACCOUNT_ID>, tokenIds=[<CREATED_TOKEN_ID>, <CREATED_TOKEN_ID>], commonTransactionParams.signers=[<CREATED_ACCOUNT_PRIVATE_KEY>] | The token association fails with an TOKEN_ID_REPEATED_IN_TOKEN_LIST 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.

Would it be reasonable to add cases here for multiple tokens in a single transaction?
It is supposed to be possible to associate several tokens at a time, and it might be worth testing scenarios including, for example
3 valid tokens
2 valid tokens and one invalid token
3 tokens, two of which are the same ID
3 tokens, one of which is deleted.

I don't actually know the results for those scenarios (e.g. will the system associate the valid tokens, even if the list contains an invalid token, or will the entire transaction be rejected?); which suggests that testing them might be valuable.

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

Successfully merging this pull request may close these issues.

Document E2E tests: TokenAssociateTransaction
3 participants