From 547376cfc98ec06cd9ad2fa11f391e8031400a4c Mon Sep 17 00:00:00 2001 From: FitzLu Date: Fri, 27 Nov 2020 10:20:19 +0800 Subject: [PATCH] remove struct Erc20ContractInfo --- bchain/types.go | 8 -------- server/public.go | 8 +++----- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/bchain/types.go b/bchain/types.go index 35fda96b..f1ea46ec 100644 --- a/bchain/types.go +++ b/bchain/types.go @@ -217,14 +217,6 @@ type Erc20Contract struct { Decimals int `json:"decimals"` } -type Erc20ContractInfo struct { - Contract string `json:"contract"` - Name string `json:"name"` - Symbol string `json:"symbol"` - Decimals int `json:"decimals"` - Icon string `json:"icon"` -} - // Erc20Transfer contains a single ERC20 token transfer type Erc20Transfer struct { Contract string diff --git a/server/public.go b/server/public.go index f64946f7..3f99b01c 100644 --- a/server/public.go +++ b/server/public.go @@ -1007,15 +1007,14 @@ func (s *PublicServer) apiTokenList(r *http.Request, apiVersion int) (interface{ return nil, api.NewAPIError("fail to fetch token list", true) } - erc20Infos := make([]*bchain.Erc20ContractInfo, 0) + erc20Infos := make([]*bchain.Erc20Contract, 0) for _, t := range tokens { if len(t.Contract) > 0 { - info := &bchain.Erc20ContractInfo{ + info := &bchain.Erc20Contract{ Contract: t.Contract, Name: t.Name, Symbol: t.Symbol, Decimals: t.Decimals, - Icon: "", } erc20Infos = append(erc20Infos, info) @@ -1049,12 +1048,11 @@ func (s *PublicServer) apiTokenInfo(r *http.Request, apiVersion int) (interface{ return nil, api.NewAPIError("fail to fetch token info", true) } - erc20Info := &bchain.Erc20ContractInfo{ + erc20Info := &bchain.Erc20Contract{ Contract: info.Contract, Name: info.Name, Symbol: info.Symbol, Decimals: info.Decimals, - Icon: "", } return erc20Info, nil