How to use the iroha-helpers/lib/txHelper.js.default.createTxListFromArray function in iroha-helpers

To help you get started, we’ve selected a few iroha-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyperledger / caliper / packages / caliper-iroha / lib / iroha.js View on Github external
async function sendTransactions(txs, txClient, timeoutLimit){
    try{
        const hashes = txs.map(x => txHelper.hash(x));
        const txList = txHelper.createTxListFromArray(txs);
        let p = new Promise((resolve, reject) => {
            const timer = setTimeout(()=>{
                txClient.$channel.close();
                reject(new Error('Please check IP address OR your internet connection'));
            }, timeoutLimit);
            txClient.listTorii(txList, (err) => {
                clearTimeout(timer);
                if(err) {
                    return reject(err);
                }
                resolve();
            });
        });
        await p;
        return hashes;
    }catch(e){