Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('both passphrases should have the same address', done => {
expect(lisk.cryptography.getAddressFromPublicKey(publicKeys[0])).to.equal(
lisk.cryptography.getAddressFromPublicKey(publicKeys[1])
);
done();
});
random.account = function() {
var account = {
balance: '0',
};
account.passphrase = random.password();
account.secondPassphrase = random.password();
account.username = random.delegateName();
account.publicKey = lisk.cryptography.getKeys(account.passphrase).publicKey;
account.address = lisk.cryptography.getAddressFromPublicKey(
account.publicKey
);
account.secondPublicKey = lisk.cryptography.getKeys(
account.secondPassphrase
).publicKey;
return account;
};
random.account = function() {
var account = {
balance: '0',
};
account.passphrase = random.password();
account.secondPassphrase = random.password();
account.username = random.delegateName();
account.publicKey = lisk.cryptography.getKeys(account.passphrase).publicKey;
account.address = lisk.cryptography.getAddressFromPublicKey(
account.publicKey
);
account.secondPublicKey = lisk.cryptography.getKeys(
account.secondPassphrase
).publicKey;
return account;
};
).map(() => {
return `+${lisk.cryptography.getKeys(randomUtil.password()).publicKey}`;
});
return expect(() => {
describe('system test (type 0) - address collision', () => {
let library;
localCommon.beforeBlock('system_0_0_address_collision', lib => {
library = lib;
});
const collision = {
address: '13555181540209512417L',
passphrases: [
'merry field slogan sibling convince gold coffee town fold glad mix page',
'annual youth lift quote off olive uncle town chief poverty extend series',
],
};
const publicKeys = [
lisk.cryptography.getPrivateAndPublicKeyFromPassphrase(
collision.passphrases[0]
).publicKey,
lisk.cryptography.getPrivateAndPublicKeyFromPassphrase(
collision.passphrases[1]
).publicKey,
];
const firstTransaction = lisk.transaction.transfer({
amount: 10 * NORMALIZER,
passphrase: collision.passphrases[0],
recipientId: accountFixtures.genesis.address,
});
const secondTransaction = lisk.transaction.transfer({
amount: 10 * NORMALIZER,
passphrase: collision.passphrases[1],
const keysgroup = Array(...Array(10)).map(() => {
return `${lisk.cryptography.getKeys(randomUtil.password()).publicKey}`;
});
beforeEach(() => {
transactionMock = {
verifySignature: sinonSandbox.stub().returns(1),
};
accountMock = {
merge: sinonSandbox.mock().callsArg(2),
};
accountsMock = {
generateAddressByPublicKey: sinonSandbox
.stub()
.returns(lisk.cryptography.getKeys(randomUtil.password()).publicKey),
setAccountAndGet: sinonSandbox.stub().callsArg(1),
};
transaction = _.cloneDeep(validTransaction);
rawTransaction = _.cloneDeep(rawValidTransaction);
sender = _.cloneDeep(validSender);
dummyBlock = {
id: '9314232245035524467',
height: 1,
};
multisignature = new Multisignature(
modulesLoader.scope.schema,
modulesLoader.scope.network,
transactionMock,
accountMock,
modulesLoader.logger
);