added utils.parseEther and logging from tx info

This commit is contained in:
Pol.Alvarez@BSC 2018-02-27 12:11:59 +01:00
parent 22dc42c25c
commit 71de01fd9d

View File

@ -109,12 +109,12 @@ const getAmount = function (req) {
// Logging functions // Logging functions
const logTransaction = function (txId, from, to, amount, gasPrice) { const logTransaction = function (tx) {
logger.info("[OK] Succesfully funded bounty with transaction " + txId); logger.info("[OK] Succesfully funded bounty with transaction " + tx.hash);
logger.info(" * From: " + from); logger.info(" * From: " + tx.from);
logger.info(" * To: " + to); logger.info(" * To: " + to);
logger.info(" * Amount: " + amount); logger.info(" * Amount: " + amount);
logger.info(" * Gas Price: " + gasPrice); logger.info(" * Gas Price: " + tx.gasPrice);
logger.info("===================================================="); logger.info("====================================================");
} }
@ -141,7 +141,7 @@ const sendTransaction = function (to, amount, gasPrice) {
gasLimit: config.gasLimit, gasLimit: config.gasLimit,
gasPrice: gasPrice, gasPrice: gasPrice,
to: to, to: to,
value: amount, value: ethers.utils.parseEther(amount),
// data: "0x", // data: "0x",
// This ensures the transaction cannot be replayed on different networks // This ensures the transaction cannot be replayed on different networks
chainId: 3 // ropsten chainId: 3 // ropsten