Skip to content

Commit

Permalink
feat(tokenBurnTransaction): Implement TokenBurnTransaction E2E test…
Browse files Browse the repository at this point in the history
…s: TCK (#311)

Signed-off-by: Rob Walworth <robert.walworth@swirldslabs.com>
Co-authored-by: ivaylogarnev <ivaylo.garnev@limechain.tech>
  • Loading branch information
rwalworth and ivaylogarnev-limechain authored Jan 10, 2025
1 parent e29dedd commit 0496e18
Show file tree
Hide file tree
Showing 3 changed files with 1,126 additions and 13 deletions.
22 changes: 11 additions & 11 deletions docs/test-specifications/token-service/TokenBurnTransaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ https://docs.hedera.com/hedera/sdks-and-apis/rest-api

### Additional Notes

The tests contained in this specification will assume that a valid fungible token and a valid non-fungible token have already successfully created. The fungible token will have an initial supply of 9,223,372,036,854,775,807 (int64 max) and the non-fungible token will have three minted. <CREATED_FUNGIBLE_TOKEN_ID> will denote the ID of the created fungible token, <CREATED_FUNGIBLE_TOKEN_SUPPLY_KEY> will denote the supply key of the created fungible token as a DER-encoded hex string, and <CREATED_FUNGIBLE_TOKEN_ADMIN_KEY> will denote the admin key of the created fungible token as a DER-encoded hex string. <CREATED_NON_FUNGIBLE_TOKEN_ID> will denote the ID of the created non-fungible token, <CREATED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY> will denote the supply key of the created non-fungible token as a DER-encoded hex string, and <CREATED_NON_FUNGIBLE_TOKEN_ADMIN_KEY> will denote the admin key of the created non-fungible token as a DER-encoded hex string. <NFT_SERIAL_1>, <NFT_SERIAL_2>, and <NFT_SERIAL_3> will denote the serial numbers of the three minted NFTs.
The tests contained in this specification will assume that a valid fungible token and a valid non-fungible token have already successfully created. The fungible token will have an initial supply of 1,000,000 and the non-fungible token will have three minted. <CREATED_FUNGIBLE_TOKEN_ID> will denote the ID of the created fungible token, <CREATED_FUNGIBLE_TOKEN_SUPPLY_KEY> will denote the supply key of the created fungible token as a DER-encoded hex string, and <CREATED_FUNGIBLE_TOKEN_ADMIN_KEY> will denote the admin key of the created fungible token as a DER-encoded hex string. <CREATED_NON_FUNGIBLE_TOKEN_ID> will denote the ID of the created non-fungible token, <CREATED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY> will denote the supply key of the created non-fungible token as a DER-encoded hex string, and <CREATED_NON_FUNGIBLE_TOKEN_ADMIN_KEY> will denote the admin key of the created non-fungible token as a DER-encoded hex string. <NFT_SERIAL_1>, <NFT_SERIAL_2>, and <NFT_SERIAL_3> will denote the serial numbers of the three minted NFTs.

## Property Tests

Expand Down Expand Up @@ -150,16 +150,16 @@ The tests contained in this specification will assume that a valid fungible toke

- The list of NFT serial numbers to burn.

| Test no | Name | Input | Expected response | Implemented (Y/N) |
|---------|---------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|-------------------|
| 1 | Burns an NFT | tokenId=<CREATED_NON_FUNGIBLE_TOKEN_ID>, serialNumbers=[<NFT_SERIAL_1>], commonTransactionParams.signers=[<CREATED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn succeeds and the token's treasury account no longer contains the first NFT. | N |
| 2 | Burns 3 NFTs | tokenId=<CREATED_NON_FUNGIBLE_TOKEN_ID>, serialNumbers=[<NFT_SERIAL_1>, <NFT_SERIAL_2>, <NFT_SERIAL_3>], commonTransactionParams.signers=[<CREATED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn succeeds and the token's treasury account no longer contains any NFTs. | N |
| 3 | Burns 3 NFTs but one is already burned | tokenId=<CREATED_NON_FUNGIBLE_TOKEN_ID>, serialNumbers=[<NFT_SERIAL_1>, <NFT_SERIAL_2>, <BURNED_NFT_SERIAL_3>], commonTransactionParams.signers=[<CREATED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn fails with an INVALID_NFT_ID response code from the network. | N |
| 4 | Burns no NFTs | tokenId=<CREATED_NON_FUNGIBLE_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn succeeds and the token's treasury account contains all three NFTs. | N |
| 5 | Burns an NFT that doesn't exist | tokenId=<CREATED_NON_FUNGIBLE_TOKEN_ID>, serialNumbers=["12345678"], commonTransactionParams.signers=[<CREATED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn fails with an INVALID_TOKEN_NFT_SERIAL_NUMBER response code from the network. | N |
| 6 | Burns NFTs with the treasury account frozen | tokenId=<CREATED_NON_FUNGIBLE_TOKEN_ID>, serialNumbers=[<NFT_SERIAL_1>], commonTransactionParams.signers=[<CREATED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn fails with an ACCOUNT_FROZEN_FOR_TOKEN response code from the network. | N |
| 7 | Burns paused NFTs | tokenId=<PAUSED_FUNGIBLE_TOKEN_ID>, serialNumbers=[<NFT_SERIAL_1>], commonTransactionParams.signers=[<PAUSED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn fails with an TOKEN_IS_PAUSED response code from the network. | N |
| 8 | Burns fungible tokens with serial numbers | tokenId=<CREATED_FUNGIBLE_TOKEN_ID>, serialNumbers=[<NFT_SERIAL_1>], commonTransactionParams.signers=[<CREATED_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn succeeds and the token's treasury account contains the same NFTs. | N |
| Test no | Name | Input | Expected response | Implemented (Y/N) |
|---------|---------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|-------------------|
| 1 | Burns an NFT | tokenId=<CREATED_NON_FUNGIBLE_TOKEN_ID>, serialNumbers=[<NFT_SERIAL_1>], commonTransactionParams.signers=[<CREATED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn succeeds and the token's treasury account no longer contains the first NFT. | N |
| 2 | Burns 3 NFTs | tokenId=<CREATED_NON_FUNGIBLE_TOKEN_ID>, serialNumbers=[<NFT_SERIAL_1>, <NFT_SERIAL_2>, <NFT_SERIAL_3>], commonTransactionParams.signers=[<CREATED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn succeeds and the token's treasury account no longer contains any NFTs. | N |
| 3 | Burns 3 NFTs but one is already burned | tokenId=<CREATED_NON_FUNGIBLE_TOKEN_ID>, serialNumbers=[<NFT_SERIAL_1>, <NFT_SERIAL_2>, <BURNED_NFT_SERIAL_3>], commonTransactionParams.signers=[<CREATED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn fails with an INVALID_NFT_ID response code from the network. | N |
| 4 | Burns no NFTs | tokenId=<CREATED_NON_FUNGIBLE_TOKEN_ID>, commonTransactionParams.signers=[<CREATED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn fails with an INVALID_TOKEN_BURN_METADATA response code from the network. | N |
| 5 | Burns an NFT that doesn't exist | tokenId=<CREATED_NON_FUNGIBLE_TOKEN_ID>, serialNumbers=["12345678"], commonTransactionParams.signers=[<CREATED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn fails with an INVALID_NFT_ID response code from the network. | N |
| 6 | Burns NFTs with the treasury account frozen | tokenId=<CREATED_NON_FUNGIBLE_TOKEN_ID>, serialNumbers=[<NFT_SERIAL_1>], commonTransactionParams.signers=[<CREATED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn fails with an ACCOUNT_FROZEN_FOR_TOKEN response code from the network. | N |
| 7 | Burns paused NFTs | tokenId=<PAUSED_FUNGIBLE_TOKEN_ID>, serialNumbers=[<NFT_SERIAL_1>], commonTransactionParams.signers=[<PAUSED_NON_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn fails with an TOKEN_IS_PAUSED response code from the network. | N |
| 8 | Burns fungible tokens with serial numbers | tokenId=<CREATED_FUNGIBLE_TOKEN_ID>, serialNumbers=[<NFT_SERIAL_1>], commonTransactionParams.signers=[<CREATED_FUNGIBLE_TOKEN_SUPPLY_KEY>] | The token burn succeeds and the token's treasury account contains the same NFTs. | N |

#### JSON Request Example

Expand Down
Loading

0 comments on commit 0496e18

Please sign in to comment.