Skip to content

Instantly share code, notes, and snippets.

@mayorcoded
Created October 30, 2018 03:04
Show Gist options
  • Save mayorcoded/7d2f2797870bb733c674fcfc536851d3 to your computer and use it in GitHub Desktop.
Save mayorcoded/7d2f2797870bb733c674fcfc536851d3 to your computer and use it in GitHub Desktop.
let buyFoodItemFromCart = (itemSku, amount) => {foodCart.buyFoodItem(itemSku, {from: buyerAddress, value: amount}).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

let buyFoodItemFromCart = (itemSku, amount) => {
  foodCart.buyFoodItem(itemSku, {from: buyerAddress, value: amount})
  .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