Skip to content

Commit a9f2339

Browse files
committed
fix: fixed KEY_NOT_PROVIDED issue
Signed-off-by: Logan Nguyen <[email protected]>
1 parent 289c7f1 commit a9f2339

File tree

1 file changed

+12
-29
lines changed

1 file changed

+12
-29
lines changed

packages/server/tests/acceptance/htsPrecompile/precompileCalls.spec.ts

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,6 @@ describe('@precompile-calls Tests for eth_call with HTS', async function () {
515515
];
516516
});
517517

518-
//TODO After adding the additional expects after getTokenKeyPublic in tokenManagementContract, the whole describe can be deleted. -> https://github.com/hiero-ledger/hiero-json-rpc-relay/issues/1131
519518
describe('Function with HederaTokenService.getTokenKey(token, keyType)', async () => {
520519
const keyTypes = {
521520
ADMIN: 1,
@@ -528,13 +527,9 @@ describe('@precompile-calls Tests for eth_call with HTS', async function () {
528527
};
529528

530529
it(`keyType = ADMIN`, async () => {
531-
const res = await htsImpl.getTokenKeyPublic.staticCall(tokenAddress, keyTypes['ADMIN']);
532-
expect(res).to.exist;
533-
expect(res.inheritAccountKey).to.eq(false);
534-
expect(res.contractId).to.eq(ZERO_HEX);
535-
expect(res.ed25519).to.eq(EMPTY_HEX);
536-
expect(res.ECDSA_secp256k1).to.eq(EMPTY_HEX);
537-
expect(res.delegatableContractId).to.eq(ZERO_HEX);
530+
await expect(htsImpl.getTokenKeyPublic.staticCall(tokenAddress, keyTypes['ADMIN'])).to.be.rejectedWith(
531+
'execution reverted',
532+
);
538533
});
539534

540535
it(`keyType = KYC`, async () => {
@@ -558,33 +553,21 @@ describe('@precompile-calls Tests for eth_call with HTS', async function () {
558553
});
559554

560555
it(`keyType = SUPPLY`, async () => {
561-
const res = await htsImpl.getTokenKeyPublic.staticCall(tokenAddress, keyTypes['SUPPLY']);
562-
expect(res).to.exist;
563-
expect(res.inheritAccountKey).to.eq(false);
564-
expect(res.contractId).to.eq(ZERO_HEX);
565-
expect(res.ed25519).to.eq(EMPTY_HEX);
566-
expect(res.ECDSA_secp256k1).to.eq(EMPTY_HEX);
567-
expect(res.delegatableContractId).to.eq(ZERO_HEX);
556+
await expect(htsImpl.getTokenKeyPublic.staticCall(tokenAddress, keyTypes['SUPPLY'])).to.be.rejectedWith(
557+
'execution reverted',
558+
);
568559
});
569560

570561
it(`keyType = FEE`, async () => {
571-
const res = await htsImpl.getTokenKeyPublic.staticCall(tokenAddress, keyTypes['FEE']);
572-
expect(res).to.exist;
573-
expect(res.inheritAccountKey).to.eq(false);
574-
expect(res.contractId).to.eq(ZERO_HEX);
575-
expect(res.ed25519).to.eq(EMPTY_HEX);
576-
expect(res.ECDSA_secp256k1).to.eq(EMPTY_HEX);
577-
expect(res.delegatableContractId).to.eq(ZERO_HEX);
562+
await expect(htsImpl.getTokenKeyPublic.staticCall(tokenAddress, keyTypes['FEE'])).to.be.rejectedWith(
563+
'execution reverted',
564+
);
578565
});
579566

580567
it(`keyType = PAUSE`, async () => {
581-
const res = await htsImpl.getTokenKeyPublic.staticCall(tokenAddress, keyTypes['PAUSE']);
582-
expect(res).to.exist;
583-
expect(res.inheritAccountKey).to.eq(false);
584-
expect(res.contractId).to.eq(ZERO_HEX);
585-
expect(res.ed25519).to.eq(EMPTY_HEX);
586-
expect(res.ECDSA_secp256k1).to.eq(EMPTY_HEX);
587-
expect(res.delegatableContractId).to.eq(ZERO_HEX);
568+
await expect(htsImpl.getTokenKeyPublic.staticCall(tokenAddress, keyTypes['PAUSE'])).to.be.rejectedWith(
569+
'execution reverted',
570+
);
588571
});
589572
});
590573
});

0 commit comments

Comments
 (0)