Skip to content

Instantly share code, notes, and snippets.

@mayorcoded
Created October 28, 2018 22:59
Show Gist options
  • Save mayorcoded/a545e2596475b0b89e14e394854a7a68 to your computer and use it in GitHub Desktop.
Save mayorcoded/a545e2596475b0b89e14e394854a7a68 to your computer and use it in GitHub Desktop.
truffle(develop)> let addFoodItemToCart = (foodName, price) => {foodCart.addFoodItem(foodName, price).then((trxn) => { const details = trxn.logs[0].args; details.sku = details.sku.toNumber(); details.price = details.price.toNumber(); details.state = trxn.logs[0].event; console.log(details);});}
@khandar-william
Copy link

khandar-william commented Nov 6, 2018

let addFoodItemToCart = (foodName, price) => {
  foodCart.addFoodItem(foodName, price)
    .then((trxn) => { 
      const details = trxn.logs[0].args; 
      details.sku = details.sku.toNumber(); 
      details.price = details.price.toNumber(); 
      details.state = trxn.logs[0].event; 
      console.log(details);
    });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment