From ec1647c864b740f6f768d0fad630e12cd02846d7 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Tue, 4 Dec 2018 12:20:05 +0100 Subject: [PATCH] Show tx success/failure in txdetail --- bchain/coins/eth/erc20.go | 7 ++++--- static/templates/tx.html | 2 +- static/templates/txdetail_ethereumtype.html | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bchain/coins/eth/erc20.go b/bchain/coins/eth/erc20.go index fb10dbea..6f63f666 100644 --- a/bchain/coins/eth/erc20.go +++ b/bchain/coins/eth/erc20.go @@ -5,6 +5,7 @@ import ( "context" "encoding/hex" "math/big" + "strings" "sync" ethcommon "github.com/ethereum/go-ethereum/common" @@ -74,9 +75,9 @@ func erc20GetTransfersFromLog(logs []*rpcLog) ([]Erc20Transfer, error) { return nil, err } r = append(r, Erc20Transfer{ - Contract: l.Address, - From: from, - To: to, + Contract: strings.ToLower(l.Address), + From: strings.ToLower(from), + To: strings.ToLower(to), Tokens: t, }) } diff --git a/static/templates/tx.html b/static/templates/tx.html index cea201d3..41ab7ed0 100644 --- a/static/templates/tx.html +++ b/static/templates/tx.html @@ -28,7 +28,7 @@ {{- if ne $tx.EthereumSpecific.Status 1 -}} Pending {{- else -}} - Success + Success {{- end -}} {{- else -}} Fail diff --git a/static/templates/txdetail_ethereumtype.html b/static/templates/txdetail_ethereumtype.html index a46cde45..203566d4 100644 --- a/static/templates/txdetail_ethereumtype.html +++ b/static/templates/txdetail_ethereumtype.html @@ -3,6 +3,7 @@
{{$tx.Txid}} + {{if eq $tx.EthereumSpecific.Status 1}}{{end}}{{if eq $tx.EthereumSpecific.Status 0}}{{end}}
{{- if $tx.Confirmations -}}
mined {{formatUnixTime $tx.Blocktime}}
@@ -98,7 +99,7 @@ - {{if ne $erc20.To $addr}}{{$erc20.To}}{{else}}{{$erc20.To}}{{end}} + {{if ne $erc20.To $addr}}{{$erc20.To}}{{else}}{{$erc20.To}}{{end}}