Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async castVotes(params, blocksToWait) {
const trx = elements.transaction.castVotes({
...params,
networkIdentifier,
});
await from(this.broadcastAndValidateTransactionAndWait(trx, blocksToWait));
}
const trxs = transfers.map(t => elements.transaction.transfer(t));
accounts.map(a => {
const options = createDappOptions();
return elements.transaction.createDapp({
...filterByKey(a, defaultFilter),
options,
});
});
const output = require('codeceptjs').output;
const { constants } = require('lisk-elements').transaction;
const I = actor();
let results = [];
When('I request for node constants', async () => {
try {
const api = await I.call();
results = await Promise.all(
api.peers.map(address => api.getNodeConstants(address))
);
} catch (error) {
output.error(error);
throw error;
}
return accounts.map(account => {
const signature = elements.transaction.createSignatureObject({
transaction,
passphrase: account.passphrase,
networkIdentifier,
}).signature;
return {
transactionId: transaction.id,
publicKey: account.publicKey,
signature,
};
});
}
async (userName, amount) => {
try {
const { passphrase } = getFixtureUser('username', userName);
const { address } = await I.createAccount();
multisignatureTrx = elements.transaction.transfer({
recipientId: address,
amount: TO_BEDDOWS(amount),
passphrase,
});
response = await from(
I.broadcastAndValidateTransaction(multisignatureTrx)
);
} catch (error) {
output.error(error);
throw error;
}
}
);