Show tx success/failure in txdetail

This commit is contained in:
Martin Boehm 2018-12-04 12:20:05 +01:00
parent 9a04c862d6
commit ec1647c864
3 changed files with 7 additions and 5 deletions

View File

@ -5,6 +5,7 @@ import (
"context" "context"
"encoding/hex" "encoding/hex"
"math/big" "math/big"
"strings"
"sync" "sync"
ethcommon "github.com/ethereum/go-ethereum/common" ethcommon "github.com/ethereum/go-ethereum/common"
@ -74,9 +75,9 @@ func erc20GetTransfersFromLog(logs []*rpcLog) ([]Erc20Transfer, error) {
return nil, err return nil, err
} }
r = append(r, Erc20Transfer{ r = append(r, Erc20Transfer{
Contract: l.Address, Contract: strings.ToLower(l.Address),
From: from, From: strings.ToLower(from),
To: to, To: strings.ToLower(to),
Tokens: t, Tokens: t,
}) })
} }

View File

@ -28,7 +28,7 @@
{{- if ne $tx.EthereumSpecific.Status 1 -}} {{- if ne $tx.EthereumSpecific.Status 1 -}}
<td class="data">Pending</td> <td class="data">Pending</td>
{{- else -}} {{- else -}}
<td class="data text-success">Success</td> <td class="data text-success">Success</td>
{{- end -}} {{- end -}}
{{- else -}} {{- else -}}
<td class="data text-danger">Fail</td> <td class="data text-danger">Fail</td>

View File

@ -3,6 +3,7 @@
<div class="row line-bot"> <div class="row line-bot">
<div class="col-xs-7 col-md-8 ellipsis"> <div class="col-xs-7 col-md-8 ellipsis">
<a href="/tx/{{$tx.Txid}}">{{$tx.Txid}}</a> <a href="/tx/{{$tx.Txid}}">{{$tx.Txid}}</a>
{{if eq $tx.EthereumSpecific.Status 1}}<span class="text-success"></span>{{end}}{{if eq $tx.EthereumSpecific.Status 0}}<span class="text-danger"></span>{{end}}
</div> </div>
{{- if $tx.Confirmations -}} {{- if $tx.Confirmations -}}
<div class="col-xs-5 col-md-4 text-muted text-right">mined {{formatUnixTime $tx.Blocktime}}</div> <div class="col-xs-5 col-md-4 text-muted text-right">mined {{formatUnixTime $tx.Blocktime}}</div>
@ -98,7 +99,7 @@
<tbody> <tbody>
<tr> <tr>
<td> <td>
<span class="ellipsis float-left">{{if ne $erc20.To $addr}}<a href="/address/{{$erc20.From}}">{{$erc20.To}}</a>{{else}}{{$erc20.To}}{{end}}</span> <span class="ellipsis float-left">{{if ne $erc20.To $addr}}<a href="/address/{{$erc20.To}}">{{$erc20.To}}</a>{{else}}{{$erc20.To}}{{end}}</span>
</td> </td>
</tr> </tr>
</tbody> </tbody>