Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* Copyright © 2018 Lisk Foundation
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*/
'use strict';
var lisk = require('lisk-elements').default;
var accountFixtures = require('../../../fixtures/accounts');
var randomUtil = require('../../../common/utils/random');
var localCommon = require('../../common');
const { NORMALIZER } = global.constants;
describe('system test (type 2) - double delegate registrations', () => {
var library;
localCommon.beforeBlock('system_2_2_delegates_2', lib => {
library = lib;
});
var i = 0;
var t = 0;
/* eslint-disable no-loop-func */
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*/
'use strict';
var randomstring = require('randomstring');
var lisk = require('lisk-elements').default;
var Bignum = require('../../../helpers/bignum.js');
var accountFixtures = require('../../fixtures/accounts');
var random = {};
// Returns a random number between min (inclusive) and max (exclusive)
random.number = function(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
};
// Returns a random username of 16 characters
random.username = function() {
var randomLetter = randomstring.generate({
length: 1,
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*/
'use strict';
const async = require('async');
const elements = require('lisk-elements').default;
const Promise = require('bluebird');
const ed = require('../../helpers/ed.js');
const slots = require('../../helpers/slots');
const Bignum = require('../../helpers/bignum.js');
const accountsFixtures = require('../fixtures/accounts');
const randomUtil = require('../common/utils/random');
const QueriesHelper = require('../common/integration/sql/queriesHelper.js');
const localCommon = require('./common');
const { REWARDS, ACTIVE_DELEGATES } = global.constants;
describe('rounds', () => {
let library;
let Queries;
let generateDelegateListPromise;
let addTransactionsAndForgePromise;
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*/
'use strict';
var Promise = require('bluebird');
var lisk = require('lisk-elements').default;
var accountFixtures = require('../../../fixtures/accounts');
var constants = require('../../../../helpers/constants');
var randomUtil = require('../../../common/utils/random');
var waitFor = require('../../../common/utils/wait_for');
var createSignatureObject = require('../../../common/helpers/api')
.createSignatureObject;
var sendSignaturePromise = require('../../../common/helpers/api')
.sendSignaturePromise;
var sendTransactionPromise = require('../../../common/helpers/api')
.sendTransactionPromise;
var confirmTransactionsOnAllNodes = require('../common/stress')
.confirmTransactionsOnAllNodes;
var broadcastingDisabled = process.env.BROADCASTING_DISABLED === 'true';
module.exports = function(params) {
* Copyright © 2018 Lisk Foundation
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*/
'use strict';
const lisk = require('lisk-elements').default;
const accountFixtures = require('../../../fixtures/accounts');
const randomUtil = require('../../../common/utils/random');
const transactionTypes = require('../../../../helpers/transaction_types.js');
const localCommon = require('../../common');
const { NORMALIZER } = global.constants;
describe('system test (type 1) - checking validated second signature registrations against other transaction types', () => {
let library;
const account = randomUtil.account();
const creditTransaction = lisk.transaction.transfer({
amount: 1000 * NORMALIZER,
passphrase: accountFixtures.genesis.passphrase,
recipientId: account.address,
});
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*/
'use strict';
require('../../functional.js');
var Promise = require('bluebird');
var lisk = require('lisk-elements').default;
var phases = require('../../../common/phases');
var accountFixtures = require('../../../fixtures/accounts');
var randomUtil = require('../../../common/utils/random');
var waitFor = require('../../../common/utils/wait_for');
var elements = require('../../../common/utils/elements');
var apiHelpers = require('../../../common/helpers/api');
var errorCodes = require('../../../../helpers/api_codes');
var common = require('./common');
const {
FEES,
NORMALIZER,
ACTIVE_DELEGATES,
MAX_VOTES_PER_TRANSACTION,
} = global.constants;
var sendTransactionPromise = apiHelpers.sendTransactionPromise;
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*/
'use strict';
require('../../functional.js');
const Promise = require('bluebird');
const lisk = require('lisk-elements').default;
const genesisDelegates = require('../../../data/genesis_delegates.json');
const accountFixtures = require('../../../fixtures/accounts');
const slots = require('../../../../helpers/slots');
const randomUtil = require('../../../common/utils/random');
const waitFor = require('../../../common/utils/wait_for');
const SwaggerEndpoint = require('../../../common/swagger_spec');
const apiHelpers = require('../../../common/helpers/api');
const Bignum = require('../../../../helpers/bignum.js');
Promise.promisify(waitFor.newRound);
const { FEES } = global.constants;
const expectSwaggerParamError = apiHelpers.expectSwaggerParamError;
describe('GET /delegates', () => {
const delegatesEndpoint = new SwaggerEndpoint('GET /delegates');
const validDelegate = genesisDelegates.delegates[0];
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*/
'use strict';
require('../../functional.js');
var lisk = require('lisk-elements').default;
var phases = require('../../../common/phases');
var Scenarios = require('../../../common/scenarios');
var accountFixtures = require('../../../fixtures/accounts');
var apiCodes = require('../../../../helpers/api_codes');
var randomUtil = require('../../../common/utils/random');
var waitFor = require('../../../common/utils/wait_for');
var elements = require('../../../common/utils/elements');
var swaggerEndpoint = require('../../../common/swagger_spec');
var apiHelpers = require('../../../common/helpers/api');
var errorCodes = require('../../../../helpers/api_codes');
var common = require('./common');
const { FEES, MULTISIG_CONSTRAINTS } = global.constants;
var sendTransactionPromise = apiHelpers.sendTransactionPromise;
describe('POST /api/transactions (type 4) register multisignature', () => {
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*/
'use strict';
require('../../functional.js');
var Promise = require('bluebird');
var lisk = require('lisk-elements').default;
var accountFixtures = require('../../../fixtures/accounts');
var randomUtil = require('../../../common/utils/random');
var waitFor = require('../../../common/utils/wait_for');
var swaggerEndpoint = require('../../../common/swagger_spec');
var apiHelpers = require('../../../common/helpers/api');
const { NORMALIZER } = global.constants;
var expectSwaggerParamError = apiHelpers.expectSwaggerParamError;
describe('GET /dapps', () => {
var dappsEndpoint = new swaggerEndpoint('GET /dapps');
var transactionsToWaitFor = [];
var account = randomUtil.account();
var dapp1 = randomUtil.application();
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*/
'use strict';
require('../../../functional.js');
var Promise = require('bluebird');
var lisk = require('lisk-elements').default;
var apiHelpers = require('../../../../common/helpers/api');
var randomUtil = require('../../../../common/utils/random');
var swaggerEndpoint = require('../../../../common/swagger_spec');
var accountFixtures = require('../../../../fixtures/accounts');
const { NORMALIZER } = global.constants;
var expectSwaggerParamError = apiHelpers.expectSwaggerParamError;
var sendTransactionPromise = apiHelpers.sendTransactionPromise;
describe('GET /api/node', () => {
describe('/transactions', () => {
describe('/unconfirmed', () => {
var UnconfirmedEndpoint = new swaggerEndpoint(
'GET /node/transactions/{state}'
).addParameters({ state: 'unconfirmed' });