Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let commands = args.map(item => {
let keypairs = generateKeypair.generateKeyPair();
let argsIroha = {
accountName: item.account,
domainId: context.domain,
publicKey: keypairs.publicKey,
verb: item.verb
};
return context.contract[contractID](context, argsIroha);
});
name += seed.charAt(Math.floor(Math.random() * seed.length));
}
if(accountNames.indexOf(name) < 0) {
return name;
}
else {
return generateName();
}
};
let promises = [];
for(let i = 0 ; i < number ; i++) {
let name = generateName();
let id = name + '@' + domain;
accountNames.push(name);
let keypairs = generateKeypair.generateKeyPair();
//client information
result.push({
name: name,
domain: domain,
id: id,
pubKey: keypairs.publicKey,
privKey: keypairs.privateKey
});
let commands = [{
fn: 'createAccount',
args: {accountName: name, domainId: domain, publicKey: keypairs.publicKey}
},
{
fn: 'appendRole',
args: {accountId: id, roleName: 'admin'}