Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/platform-test-suite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Run test suite
Usage: test <seed> [options]

<seed> can be IP or IP:port (or pass via DAPI_SEED env)
Set DAPI_ADDRESSES="ip:port" to bypass SML discovery and connect only to the given node(s)

Options:
-s=a,b,c --scope=a,b,c - test scope to run
Expand Down Expand Up @@ -78,6 +79,7 @@ Run test suite
Usage: test <seed> [options]

<seed> can be IP or IP:port (or pass via DAPI_SEED env)
Set DAPI_ADDRESSES="ip:port" to bypass SML discovery and connect only to the given node(s)

Options:
-s=a,b,c --scope=a,b,c - test scope to run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ let faucetClient;
*/
async function createClientWithFundedWallet(amount, HDPrivateKey = undefined) {
const useFaucetWalletStorage = process.env.FAUCET_WALLET_USE_STORAGE === 'true';
const seeds = getDAPISeeds();

const dapiAddresses = (process.env.DAPI_ADDRESSES || '')
.split(',')
.map((address) => address.trim())
.filter(Boolean);

const clientOpts = {
seeds,
network: process.env.NETWORK,
timeout: 25000,
apps: {
Expand All @@ -33,6 +36,12 @@ async function createClientWithFundedWallet(amount, HDPrivateKey = undefined) {
},
};

if (dapiAddresses.length > 0) {
clientOpts.dapiAddresses = dapiAddresses;
} else {
clientOpts.seeds = getDAPISeeds();
}

if (!faucetClient || (faucetClient && useFaucetWalletStorage)) {
faucetClient = createFaucetClient();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ const { contractId } = require('@dashevo/dpns-contract/lib/systemIds');
const getDAPISeeds = require('./getDAPISeeds');

function createClientWithoutWallet() {
const dapiAddresses = (process.env.DAPI_ADDRESSES || '')
.split(',')
.map((address) => address.trim())
.filter(Boolean);

return new Dash.Client({
seeds: getDAPISeeds(),
...(dapiAddresses.length > 0
? { dapiAddresses }
: { seeds: getDAPISeeds() }),
network: process.env.NETWORK,
timeout: 25000,
apps: {
Expand Down
9 changes: 7 additions & 2 deletions packages/platform-test-suite/lib/test/createFaucetClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ const getDAPISeeds = require('./getDAPISeeds');
let faucetClient;

function createFaucetClient() {
const seeds = getDAPISeeds();
const dapiAddresses = (process.env.DAPI_ADDRESSES || '')
.split(',')
.map((address) => address.trim())
.filter(Boolean);

const clientOpts = {
seeds,
...(dapiAddresses.length > 0
? { dapiAddresses }
: { seeds: getDAPISeeds() }),
network: process.env.NETWORK,
apps: {
dpns: {
Expand Down