Skip to content

fix: parametrize NFT serial in TokenReject.rejectTokens - #135

Merged
natanasow merged 2 commits into
hiero-ledger:mainfrom
ValentinVPK:123-tokenreject-parametrize-nft-serial
Aug 19, 2026
Merged

fix: parametrize NFT serial in TokenReject.rejectTokens#135
natanasow merged 2 commits into
hiero-ledger:mainfrom
ValentinVPK:123-tokenreject-parametrize-nft-serial

Conversation

@ValentinVPK

Copy link
Copy Markdown
Contributor

Description:

TokenReject.rejectTokens hardcoded nftId.serial = 1, so the example could only ever reject serial #1 of each NFT collection — any other serial was unreachable, and the limitation was invisible to the test suite (it only ever minted one fresh NFT, which is always serial 1).

  • Add an int64[] serials parameter to rejectTokens and use nftId.serial = serials[i] (mirroring cancelMultipleAirdrops / claimMultipleAirdrops)
  • Update the existing test call sites to pass the new serials array
  • Add a regression test that mints two NFTs and rejects serial #2, so the missing-serial limitation cannot silently return
  • Fix two mintNFTToAddress calls in the test that were missing await (they returned Promises and "worked" only because the reject was hardcoded to serial 1)

Related issue(s):

Fixes #123

Notes for reviewer:

This is a breaking ABI changerejectTokens gains a parameter, so its selector changes. That's inherent to the fix (the serial must be caller-supplied). The serials array is expected to be parallel to nftAddresses; there's no explicit length guard, matching the sibling multi-airdrop helpers (out-of-bounds already reverts at the EVM level).

Verified: npx hardhat compile clean (64 files); the rewritten test passes Prettier and ESLint. The regression test asserts the second minted serial is 2 (setupNft creates a fresh collection and does not pre-mint, so sequential mints yield 1 then 2) and rejects serial #2 — which the previous hardcoded-1 code could not do. The acceptance suite runs against a live Hedera node (solo), so runtime confirmation is via CI, not local.

Signed-off-by: ValentinVPK <valentin.krumov@limechain.tech>
@ValentinVPK
ValentinVPK requested review from a team as code owners July 31, 2026 12:59
@ValentinVPK
ValentinVPK requested a review from rbarker-dev July 31, 2026 12:59
@ValentinVPK ValentinVPK self-assigned this Jul 31, 2026
@ValentinVPK ValentinVPK added the enhancement New feature or request label Jul 31, 2026
@ValentinVPK ValentinVPK added this to the 0.2.0 milestone Jul 31, 2026
@natanasow
natanasow merged commit 0e0a7f1 into hiero-ledger:main Aug 19, 2026
22 of 23 checks passed
@swirlds-automation

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TokenReject example hardcodes nftId.serial = 1, so it can only reject serial #1 of each collection

3 participants