OSDN Git Service

update the gas calculation
authorZhiting Lin <zlin035@uottawa.ca>
Tue, 11 Jun 2019 07:35:10 +0000 (15:35 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Tue, 11 Jun 2019 07:35:10 +0000 (15:35 +0800)
src/features/transactions/components/Show.jsx

index 4d5ee20..bdef242 100644 (file)
@@ -27,7 +27,7 @@ class Show extends BaseShow {
     if (item) {
       const confirmation = this.props.highestBlock - item.blockHeight + 1
       const btmInput = item.inputs.reduce((sum, input) => {
-        if (input.type === 'spend' && input.assetId === btmID) {
+        if ((input.type === 'spend' || input.type === 'cross_chain_in') && input.assetId === btmID) {
           sum = BigNumber(input.amount).plus(sum)
         }
         return sum
@@ -36,7 +36,9 @@ class Show extends BaseShow {
       item.confirmations = confirmation
 
       const btmOutput = item.outputs.reduce((sum, output) => {
-        if ((output.type === 'control' || output.type === 'retire')&& output.assetId === btmID) {
+        if ((output.type === 'control' || output.type === 'retire'
+            || output.type === 'vote' ||  output.type === 'cross_chain_out')&&
+          output.assetId === btmID) {
           sum = BigNumber(output.amount).plus(sum)
         }
         return sum