From 1bb13358d581bfc1db35bf45af33601b920ba85b Mon Sep 17 00:00:00 2001 From: Michele Balistreri Date: Wed, 1 Apr 2020 13:50:22 +0300 Subject: [PATCH] set destination field --- scripts/create-gift.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/create-gift.js b/scripts/create-gift.js index c4c9642..df6e4e4 100644 --- a/scripts/create-gift.js +++ b/scripts/create-gift.js @@ -63,7 +63,7 @@ async function deployBucket(sender, factory, token, validityInDays) { let methodCall = GiftBucketFactory.methods.create(token.toLowerCase(), expirationDate); try { - let receipt = await sendMethod(methodCall, sender, null); + let receipt = await sendMethod(methodCall, sender, GiftBucketFactory.options.address); return receipt.events.Created.returnValues.bucket; } catch(err) { console.error(err); @@ -73,19 +73,19 @@ async function deployBucket(sender, factory, token, validityInDays) { async function createGift(sender, bucket, keycard) { GiftBucket.options.address = bucket; - let methodCall = GiftBucket.methods.createGift(keycard.keycard.toLowerCase(), keycard.amount, keycard.code); + let methodCall = GiftBucket.methods.createGift(keycard.keycard, keycard.amount, keycard.code); try { - let receipt = await sendMethod(methodCall, sender, null); - return receipt.events.Created.returnValues.bucket; + await sendMethod(methodCall, sender, GiftBucket.options.address); + return true; } catch(err) { console.error(err); - return null; + return false; } } function processLine(line) { - let c = line.split(",").map((e) => e.trim()); + let c = line.split(",").map((e) => e.toLowerCase().trim()); return {keycard: c[0], amount: parseInt(c[1]), code: c[2]}; }