hedera-mirror-node icon indicating copy to clipboard operation
hedera-mirror-node copied to clipboard

HIP-904 Add Acceptance tests for Token Airdrops

Open edwin-greene opened this issue 1 year ago • 0 comments

Problem

Add acceptance tests for the token feature for token airdrops.

Solution

Use an existing set of accounts and a token_id from the existing acceptance tests and add new tests that perform the following:

  • Send two airdrops, a fungible and nft airdrop to an account that has been associated with the tokens and verify that the airdrops are transferred to the account and that the two REST APIs do not list the airdrops. Verify that related endpoints for the account (/accounts/{id}/nfts, /accounts/{id}/tokens, and /tokens/{id}/nfts/{serial}) show the account as the owner of the tokens.
  • Send a fungible and nft airdrop to an account that has not been associated with the tokens and has no open slots for automatic associations and verify that the airdrops are listed by the two REST APIs. Verify that related endpoints for the account (/accounts/{id}/nfts, /accounts/{id}/tokens, and /tokens/{id}/nfts/{serial}) do not show the account as the owner of the tokens.
  • Cancel the pending airdrops and verify that they are no longer listed by the two REST APIs. Verify that the receiver does not own the tokens and that the sender does own them (/accounts/{receiver/senderId}/nfts, /accounts/{receiver/senderId}/tokens, and /tokens/{receiver/senderId}/nfts/{serial}).
  • Send a fungible and nft airdrop to an account that has not been associated with the tokens and has no open slots for automatic associations and verify that the airdrop is listed in the two REST APIs. Verify that related endpoints for the account (/accounts/{id}/nfts, /accounts/{id}/tokens, and /tokens/{id}/nfts/{serial}) do not show the account as the owner of the tokens.
  • Claim the airdrops and verify that they are no longer listed in the two REST APIs. Verify that related endpoints for the account (/accounts/{id}/nfts, /accounts/{id}/tokens, and /tokens/{id}/nfts/{serial}) show the account as the owner of the tokens.
  • Reject the tokens that were just claimed and verify that related endpoints for the account (/accounts/{id}/nfts, /accounts/{id}/tokens and /tokens/{id}/nfts/{serial}) do not show the account as the owner of the tokens. Verify that the tokens have been returned to their treasury account (/accounts/{treasury account id}/nfts, /accounts/{treasury account id}/tokens, and /tokens/{id}/nfts/{serial}).

Alternatives

No response

edwin-greene avatar May 10 '24 16:05 edwin-greene