Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const output = require('codeceptjs').output;
const utils = require('../../utils');
const I = actor();
const count = Math.ceil(utils.TRS_POOL_LIMIT / 13); // T:2, SPP: 1, D 2, V: 2, UV: 2, M: 2, Dapp: 2 = 13 types of transactions
let all_trxs = {};
const accounts = utils.createAccounts(count);
const accounts_with_spp = utils.createAccounts(count);
const getAllTransactions = () => {
const transactions = Object.keys(all_trxs).map(transaction_type => {
const trxs = all_trxs[transaction_type];
if (!transaction_type.match('_signatures')) {
return trxs;
}
return [];
const chai = require('chai');
const elements = require('lisk-elements');
const output = require('codeceptjs').output;
const API = require('./api.js');
const {
config,
GENESIS_ACCOUNT,
ASGARD_FIXTURE,
seedNode,
networkIdentifier,
} = require('../fixtures');
const { TO_BEDDOWS, BLOCK_TIME, from } = require('../utils');
const users = {};
chai.config.truncateThreshold = 0;
/* eslint camelcase: ["error", {allow: ["codecept_helper"]}] */
const Helper = codecept_helper;
const output = require('codeceptjs').output;
const chai = require('chai');
const apiSchema = require('../api_schema');
const { TO_LISK, TO_BEDDOWS, from, sortBy, flattern } = require('../utils');
const LiskUtil = require('./lisk_util');
/* eslint camelcase: ["error", {allow: ["codecept_helper"]}] */
const Helper = codecept_helper;
const liskUtil = new LiskUtil();
chai.use(require('chai-json-schema'));
chai.use(require('chai-sorted'));
chai.use(require('chai-bignumber')());
const expect = chai.expect;
const otherFields = [
'username',
const output = require('codeceptjs').output;
const {
transaction: { utils },
} = require('lisk-elements');
const { TO_BEDDOWS, from } = require('../../utils');
const I = actor();
let account;
When('I create a lisk account', async () => {
try {
account = await I.createAccount();
const { passphrase, publicKey, address } = account;
expect(passphrase).to.be.a('string');
expect(passphrase.split(' ')).to.have.lengthOf(12);
expect(publicKey).to.be.a('string');
const dns = require('dns');
const output = require('codeceptjs').output;
const from = require('./from');
const liskTransactions = require('./lisk_transactions');
const { ASGARD_FIXTURE, GENESIS_ACCOUNT, config } = require('../fixtures');
const BLOCK_TIME = 10000;
const TRS_PER_BLOCK = 25;
const TRS_POOL_LIMIT = 1000;
const TRS_TYPE = {
TRANSFER: 0,
SECOND_PASSPHRASE: 1,
DELEGATE_REGISTRATION: 2,
VOTE: 3,
MULTI_SIGNATURE: 4,
const output = require('codeceptjs').output;
const { getFixtureUser } = require('../../utils');
const I = actor();
When('{string} register as a delegate', async userName => {
try {
const { username, address, passphrase } = getFixtureUser(
'username',
userName
);
await I.haveAccountRegisteredAsDelegate({
username,
address,
passphrase,
});
} catch (error) {
const output = require('codeceptjs').output;
const { getFixtureUser, TO_BEDDOWS } = require('../../utils');
const I = actor();
Then(
'{string} should be able to send {int}LSK tokens to {string}',
async (user1, amount, user2) => {
try {
const sender = getFixtureUser('username', user1);
const recipient = getFixtureUser('username', user2);
const transfer = await I.transfer({
recipientId: recipient.address,
amount: TO_BEDDOWS(amount),
passphrase: sender.passphrase,
});
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;
const output = require('codeceptjs').output;
const {
TO_BEDDOWS,
getFixtureUser,
from,
TRS_PER_BLOCK,
} = require('../../utils');
const I = actor();
Given('I have list of clients', async () => {
try {
const api = await I.call();
const inValidAddresses = api.peers.filter(
address => typeof address !== 'string'
);
const output = require('codeceptjs').output;
const elements = require('lisk-elements');
class API {
constructor(config) {
const { peers, httpPort } = config;
this.peers = peers;
this.httpPort = httpPort;
this.clients = this.createApiClients();
}
createApiClients() {
return this.peers.map(ip => {
const url = `http://${ip}:${this.httpPort}`;
const client = new elements.APIClient([url]);
return {