Skip to content

Commit

Permalink
Merge pull request #58 from etherspot/PRO-2580
Browse files Browse the repository at this point in the history
Added sponsor and gasless transaction test cases
  • Loading branch information
Jineshdarjee authored Aug 20, 2024
2 parents ad1084b + 69c094d commit fcbeafb
Show file tree
Hide file tree
Showing 34 changed files with 5,664 additions and 235 deletions.
10 changes: 2 additions & 8 deletions .env
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
## PrimeSDK IDs
## SDK IDs
PRIVATE_KEY=private_key
PROJECT_KEY=project_key
PROJECT_KEY_TESTNET=project_key_testnet
API_KEY=api_key
INCORRECT_API_KEY=incorrect_api_key
INVALID_API_KEY=invalid_api_key
BUNDLER_API_KEY=bundler_api_key
DATA_API_KEY=data_api_key

## Database Details
DB_HOST=db_host
DB_USER=db_user
DB_PASSWORD=db_password
DB_DATABASE=bd_database
DATA_API_KEY=data_api_key
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"test-testnet-swap-sepolia": "mocha --timeout 600000 --spec test/specs/testnet/version/version.spec.js --spec test/specs/testnet/swap/sepolia.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-testnet-swap": "mocha --timeout 600000 --spec test/specs/testnet/version/version.spec.js --spec test/specs/testnet/swap/*.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-testnet-paymaster-sepolia": "mocha --timeout 600000 --spec test/specs/testnet/version/version.spec.js --spec test/specs/testnet/paymaster/sepolia.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-testnet-paymaster-amoy": "mocha --timeout 600000 --spec test/specs/testnet/version/version.spec.js --spec test/specs/testnet/paymaster/amoy.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-testnet-paymaster": "mocha --timeout 600000 --spec test/specs/testnet/version/version.spec.js --spec test/specs/testnet/paymaster/*.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-testnet-listandrates-sepolia": "mocha --timeout 600000 --spec test/specs/testnet/version/version.spec.js --spec test/specs/testnet/listAndRates/sepolia.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
"test-testnet-listandrates": "mocha --timeout 600000 --spec test/specs/testnet/version/version.spec.js --spec test/specs/testnet/listAndRates/*.spec.js --reporter mochawesome --reporter-options charts=true,code=false,showHooks=always",
Expand Down
12 changes: 10 additions & 2 deletions test/data/testData.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"shortTimeout": 1000,
"mediumTimeout": 5000,
"longTimeout": 10000,
"retry": 5,
"retry": 3,
"eoaAddress": "0xa5494Ed2eB09F37b4b0526a8e4789565c226C84f",
"sender": "0xE05FB316eB8C4ba7288D43c1bd87BE8a8d16761C",
"incorrectSender": "0xF00FB316eB8C44a7288D43c11d87BE8a8dD6761C",
Expand Down Expand Up @@ -85,7 +85,7 @@
"tokenAddress_sepoliaUSDC": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
"incorrectTokenAddress_sepoliaUSDC": "0x11714B196Cb017B01d741Fbc6116a912379C1238",
"invalidTokenAddress_sepoliaUSDC": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C723",
"providerNetwork_sepolia": "https://sepolia-bundler.etherspot.io",
"providerNetwork_sepolia": "https://testnet-rpc.etherspot.io/v1/11155111",
"invalidProviderNetwork_sepolia": "http://sepolia-bundler.etherspot.io",
"otherProviderNetwork_sepolia": "https://arbitrumsepolia-bundler.etherspot.io",
"tokenAddress_sparknetUSDC": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
Expand All @@ -94,6 +94,12 @@
"providerNetwork_sparknet": "https://fusetestnet-bundler.etherspot.io",
"invalidProviderNetwork_sparknet": "http://fusetestnet-bundler.etherspot.io",
"otherProviderNetwork_sparknet": "https://mumbai-bundler.etherspot.io",
"tokenAddress_amoyLink": "0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582",
"incorrectTokenAddress_amoyLink": "0x11714B196Cb017B01d741Fbc6116a912379C1238",
"invalidTokenAddress_amoyLink": "0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e758",
"providerNetwork_amoy": "https://testnet-rpc.etherspot.io/v1/80002",
"invalidProviderNetwork_amoy": "http://testnet-rpc.etherspot.io/v1/80002",
"otherProviderNetwork_amoy": "https://testnet-rpc.etherspot.io/v1/11155111",
"incorrect_hash": "0x3df9fe91b29f4b2bf1b148baf2f9E207e98137F8318ccf39eDc930d1ceA551df",
"invalid_hash": "0x3df9fe91b29f4b2bf1b148baf2f9E207e98137F8z18ccf39eDc930d1ceA551df",
"arbitrum_chainid": 42161,
Expand All @@ -105,6 +111,7 @@
"goerli_chainid": 5,
"sepolia_chainid": 11155111,
"sparknet_chainid": 123,
"amoy_chainid": 80002,
"invalid_arbitrum_chainid": 42656,
"invalid_matic_chainid": 19,
"invalid_optimism_chainid": 158,
Expand All @@ -113,6 +120,7 @@
"invalid_goerli_chainid": 6,
"invalid_sepolia_chainid": 11155155,
"invalid_sparknet_chainid": 124,
"invalid_amoy_chainid": 80009,
"minimum_token_balance": 0.001,
"minimum_native_balance": 0.001,
"exchange_offer_value": "10000000000",
Expand Down
8 changes: 6 additions & 2 deletions test/specs/loadAndPerformance/arka/mumbai.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let mumbaiTestNetSdk;

/* eslint-disable prettier/prettier */
describe('Performance testing of Arka Endpoints with Mumbai Network', function () {
it('SMOKE: Validate the Whitelist endpoint of Arka on Mumbai Network', async function () {
it.only('SMOKE: Validate the Whitelist endpoint of Arka on Mumbai Network', async function () {
var test = this;
const randomAddress = ethers.Wallet.createRandom();
const addresses = [randomAddress.address];
Expand All @@ -25,7 +25,11 @@ describe('Performance testing of Arka Endpoints with Mumbai Network', function (
'Content-Type': 'application/json',
},
body: JSON.stringify({
params: [addresses, data.mumbai_chainid_testnet, process.env.API_KEY],
params: [
'0xE05FB316eB8C4ba7288D43c1bd87BE8a8d16761C',
'80002',
process.env.API_KEY,
],
}),
});
if (!response.ok) {
Expand Down
25 changes: 25 additions & 0 deletions test/specs/mainnet/connext/arbitrum.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -280,6 +281,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -340,6 +342,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -477,6 +480,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -507,6 +511,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -545,6 +550,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -582,6 +588,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -620,6 +627,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -658,6 +666,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -695,6 +704,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -733,6 +743,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -768,6 +779,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -803,6 +815,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -841,6 +854,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -879,6 +893,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -916,6 +931,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -952,6 +968,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -988,6 +1005,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -1026,6 +1044,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -1061,6 +1080,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -1095,6 +1115,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -1129,6 +1150,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -1164,6 +1186,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -1197,6 +1220,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});

Expand Down Expand Up @@ -1231,6 +1255,7 @@ describe('The PrimeSDK, Validate the connext endpoints with arbitrum network on
}, data.retry); // Retry this async test up to 5 times
} else {
console.warn(message.connext_insufficientBalance);
test.skip();
}
});
});
Loading

0 comments on commit fcbeafb

Please sign in to comment.