Modifications to the createNewTransaction method

Here, let's split up the createNewTransaction method into two separate methods, by modifying it as follows: 

  1. Go to the createNewTransaction method in your dev/blockchain.js file. We built this method in Chapter 2, Building a Blockchain in the Creating createNewTransaction method section. For reference, take a look at the following createNewTransaction method: 
Blockchain.prototype.createNewTransaction = function (amount, sender, recipient) {    const newTransaction = {        amount: amount,        sender: sender,        recipient: recipient,    };    this.newTransactions.push(newTransaction);    return.this.getlastBlock() ['index'] + 1;}
  1. Let's make the following highlighted modifications to the method: 
Blockchain.prototype.createNewTransaction ...

Get Learn Blockchain Programming with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.