Skip to content

Commit 7ab7770

Browse files
committed
fix(tests): authorized sender for the no-pending-airdrops case
Signed-off-by: ValentinVPK <valentin.krumov@limechain.tech>
1 parent 248b7d9 commit 7ab7770

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

test/token-service/hrc-904/CancelAirdropContract.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ describe('HIP904Batch2 CancelAirdropContract Test Suite', function () {
1515
let erc721Contract;
1616
let signers;
1717
let owner;
18+
let senderWithoutAirdrops;
1819
let receiver;
1920
let contractAddresses;
2021

@@ -56,6 +57,15 @@ describe('HIP904Batch2 CancelAirdropContract Test Suite', function () {
5657
owner = ethers.getAddress(
5758
(await hapi.createAccountWithContractIdKey(contractAddresses)).address,
5859
);
60+
// A second contract-keyed account that never gets an airdrop. The cancel is
61+
// authorized against the sender before the pending airdrop is looked up, so
62+
// an ordinary signer here fails with INVALID_FULL_PREFIX_SIGNATURE_FOR_
63+
// PRECOMPILE (326) instead of the INVALID_PENDING_AIRDROP_ID the test is
64+
// after. (A never-created address still reaches 367 — there is no account to
65+
// authorize — which is why the invalid-sender test needs no such account.)
66+
senderWithoutAirdrops = ethers.getAddress(
67+
(await hapi.createAccountWithContractIdKey(contractAddresses)).address,
68+
);
5969

6070
await utils.setupToken(tokenCreateContract, owner, contractAddresses, hapi);
6171

@@ -200,7 +210,7 @@ describe('HIP904Batch2 CancelAirdropContract Test Suite', function () {
200210
});
201211

202212
it('should fail when sender has no pending airdrops', async function () {
203-
const sender = signers[1].address;
213+
const sender = senderWithoutAirdrops;
204214
const tokenAddress = await utils.setupToken(
205215
tokenCreateContract,
206216
owner,

0 commit comments

Comments
 (0)