Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added test coverage of CancelAirdrop.sol #1192

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"type": "int64[]"
}
],
"name": "cancelAirdrops",
"name": "cancelMultipleAirdrops",
"outputs": [
{
"internalType": "int64",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ contract CancelAirdrop is HederaTokenService {
// @param tokens Array of token addresses for the pending airdrops
// @param serials Array of serial numbers for NFT airdrops (use 0 for fungible tokens)
// @return responseCode The response code from the batch cancel operation (22 = success)
function cancelAirdrops(address[] memory senders, address[] memory receivers, address[] memory tokens, int64[] memory serials) public returns (int64 responseCode) {
function cancelMultipleAirdrops(address[] memory senders, address[] memory receivers, address[] memory tokens, int64[] memory serials) public returns (int64 responseCode) {
uint length = senders.length;
IHederaTokenService.PendingAirdrop[] memory pendingAirdrops = new IHederaTokenService.PendingAirdrop[](length);
for (uint i = 0; i < length; i++) {
Expand Down
12 changes: 12 additions & 0 deletions test/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,18 @@ const Contract = {
CancunOpcodes: 'CancunOpcodes',
KZGPointEvaluation: 'KZGPointEvaluation',
StateRegistry: 'StateRegistry',
Airdrop: 'Airdrop',
CancelAirdrop: 'CancelAirdrop',
AliasAccountUtility: 'AliasAccountUtility',
Airdrop: 'Airdrop',
CancelAirdrop: 'CancelAirdrop',
};

const CALL_EXCEPTION = 'CALL_EXCEPTION';
const CONTRACT_REVERT_EXECUTED_CODE = 3;
const GAS_LIMIT_1_000_000 = { gasLimit: 1_000_000 };
const GAS_LIMIT_2_000_000 = { gasLimit: 2_000_000 };
const GAS_LIMIT_5_000_000 = { gasLimit: 5_000_000 };
const GAS_LIMIT_10_000_000 = { gasLimit: 10_000_000 };
const GAS_LIMIT_800000 = { gasLimit: 800000 };
const GAS_LIMIT_8000000 = { gasLimit: 8000000 };
Expand All @@ -223,6 +229,8 @@ const HOUR = 60 * MINUTE;
const DAY = 24 * HOUR;
const WEEK = 7 * DAY;
const GWEI = 1e9;
const HTS_SYSTEM_CONTRACT_ADDRESS = '0.0.359';
const HAS_SYSTEM_CONTRACT_ADDRESS = '0.0.362';

module.exports = {
Events,
Expand All @@ -231,6 +239,8 @@ module.exports = {
CALL_EXCEPTION,
CONTRACT_REVERT_EXECUTED_CODE,
GAS_LIMIT_1_000_000,
GAS_LIMIT_2_000_000,
GAS_LIMIT_5_000_000,
GAS_LIMIT_10_000_000,
GAS_LIMIT_800000,
GAS_LIMIT_8000000,
Expand All @@ -245,4 +255,6 @@ module.exports = {
WEEK,
WEI,
GWEI,
HTS_SYSTEM_CONTRACT_ADDRESS,
HAS_SYSTEM_CONTRACT_ADDRESS,
};
Loading