Gaëtan Renaudeau 7 years ago
parent
commit
7f1a6d171e
  1. 12
      src/bridge/EthereumJSBridge.js

12
src/bridge/EthereumJSBridge.js

@ -63,14 +63,16 @@ const txToOps = (account: Account) => (tx: Tx): Operation[] => {
const sending = freshAddress === from const sending = freshAddress === from
const receiving = freshAddress === to const receiving = freshAddress === to
const ops = [] const ops = []
const fee = tx.gas_price * tx.gas_used // FIXME problem with our api, precision lost here...
const value = BigNumber(tx.value)
const fee = BigNumber(tx.gas_price * tx.gas_used)
if (sending) { if (sending) {
ops.push({ ops.push({
id: `${account.id}-${tx.hash}-OUT`, id: `${account.id}-${tx.hash}-OUT`,
hash: tx.hash, hash: tx.hash,
type: 'OUT', type: 'OUT',
value: BigNumber(tx.value), // FIXME problem with our api, precision lost here... value: value.plus(fee),
fee: BigNumber(fee), // FIXME problem with our api, precision lost here... fee,
blockHeight: tx.block && tx.block.height, blockHeight: tx.block && tx.block.height,
blockHash: tx.block && tx.block.hash, blockHash: tx.block && tx.block.hash,
accountId: account.id, accountId: account.id,
@ -84,8 +86,8 @@ const txToOps = (account: Account) => (tx: Tx): Operation[] => {
id: `${account.id}-${tx.hash}-IN`, id: `${account.id}-${tx.hash}-IN`,
hash: tx.hash, hash: tx.hash,
type: 'IN', type: 'IN',
value: BigNumber(tx.value), // FIXME problem with our api, precision lost here... value,
fee: BigNumber(fee), // FIXME problem with our api, precision lost here... fee,
blockHeight: tx.block && tx.block.height, blockHeight: tx.block && tx.block.height,
blockHash: tx.block && tx.block.hash, blockHash: tx.block && tx.block.hash,
accountId: account.id, accountId: account.id,

Loading…
Cancel
Save