mirror of
https://github.com/trezor/blockbook.git
synced 2026-02-20 00:51:39 +01:00
chore(blockbook): rename type to standard
This commit is contained in:
11
api/types.go
11
api/types.go
@@ -361,9 +361,10 @@ type Address struct {
|
||||
TotalBaseValue float64 `json:"totalBaseValue,omitempty"` // value including tokens in base currency
|
||||
TotalSecondaryValue float64 `json:"totalSecondaryValue,omitempty"` // value including tokens in secondary currency
|
||||
ContractInfo *bchain.ContractInfo `json:"contractInfo,omitempty"`
|
||||
Erc20Contract *bchain.ContractInfo `json:"erc20Contract,omitempty"` // deprecated
|
||||
AddressAliases AddressAliasesMap `json:"addressAliases,omitempty"`
|
||||
StakingPools []StakingPool `json:"stakingPools,omitempty"`
|
||||
// Deprecated: replaced by ContractInfo
|
||||
Erc20Contract *bchain.ContractInfo `json:"erc20Contract,omitempty"`
|
||||
AddressAliases AddressAliasesMap `json:"addressAliases,omitempty"`
|
||||
StakingPools []StakingPool `json:"stakingPools,omitempty"`
|
||||
// helpers for explorer
|
||||
Filter string `json:"-"`
|
||||
XPubAddresses map[string]struct{} `json:"-"`
|
||||
@@ -590,6 +591,6 @@ type Eip1559Fees struct {
|
||||
LatestPriorityFeeRange []*Amount `json:"latestPriorityFeeRange,omitempty"`
|
||||
HistoricalPriorityFeeRange []*Amount `json:"historicalPriorityFeeRange,omitempty"`
|
||||
HistoricalBaseFeeRange []*Amount `json:"historicalBaseFeeRange,omitempty"`
|
||||
PriorityFeeTrend string `json:"priorityFeeTrend,omitempty"`
|
||||
BaseFeeTrend string `json:"baseFeeTrend,omitempty"`
|
||||
PriorityFeeTrend string `json:"priorityFeeTrend,omitempty" ts_type:"'up' | 'down'"`
|
||||
BaseFeeTrend string `json:"baseFeeTrend,omitempty" ts_type:"'up' | 'down'"`
|
||||
}
|
||||
|
||||
@@ -176,10 +176,10 @@ func (w *Worker) getAddressAliases(addresses map[string]struct{}) AddressAliases
|
||||
if err != nil || addrDesc == nil {
|
||||
continue
|
||||
}
|
||||
ci, err := w.db.GetContractInfo(addrDesc, bchain.UnknownTokenType)
|
||||
ci, err := w.db.GetContractInfo(addrDesc, bchain.UnknownTokenStandard)
|
||||
if err == nil && ci != nil {
|
||||
if ci.Type == bchain.UnhandledTokenType {
|
||||
ci, _, err = w.getContractDescriptorInfo(addrDesc, bchain.UnknownTokenType)
|
||||
if ci.Standard == bchain.UnhandledTokenStandard {
|
||||
ci, _, err = w.getContractDescriptorInfo(addrDesc, bchain.UnknownTokenStandard)
|
||||
}
|
||||
if err == nil && ci != nil && ci.Name != "" {
|
||||
aliases[a] = AddressAlias{Type: "Contract", Alias: ci.Name}
|
||||
@@ -647,7 +647,7 @@ func (w *Worker) getContractDescriptorInfo(cd bchain.AddressDescriptor, typeFrom
|
||||
glog.Errorf("GetContractInfo from chain error %v, contract %v", err, cd)
|
||||
}
|
||||
if contractInfo == nil {
|
||||
contractInfo = &bchain.ContractInfo{Standard: bchain.UnknownTokenType, Decimals: w.chainParser.AmountDecimals()}
|
||||
contractInfo = &bchain.ContractInfo{Standard: bchain.UnknownTokenStandard, Decimals: w.chainParser.AmountDecimals()}
|
||||
addresses, _, _ := w.chainParser.GetAddressesFromAddrDesc(cd)
|
||||
if len(addresses) > 0 {
|
||||
contractInfo.Contract = addresses[0]
|
||||
@@ -655,14 +655,15 @@ func (w *Worker) getContractDescriptorInfo(cd bchain.AddressDescriptor, typeFrom
|
||||
|
||||
validContract = false
|
||||
} else {
|
||||
if typeFromContext != bchain.UnknownTokenType && contractInfo.Standard == bchain.UnknownTokenType {
|
||||
if typeFromContext != bchain.UnknownTokenStandard && contractInfo.Standard == bchain.UnknownTokenStandard {
|
||||
contractInfo.Standard = typeFromContext
|
||||
contractInfo.Type = typeFromContext
|
||||
}
|
||||
if err = w.db.StoreContractInfo(contractInfo); err != nil {
|
||||
glog.Errorf("StoreContractInfo error %v, contract %v", err, cd)
|
||||
}
|
||||
}
|
||||
} else if (contractInfo.Standard == bchain.UnhandledTokenType || len(contractInfo.Name) > 0 && contractInfo.Name[0] == 0) || (len(contractInfo.Symbol) > 0 && contractInfo.Symbol[0] == 0) {
|
||||
} else if (contractInfo.Standard == bchain.UnhandledTokenStandard || len(contractInfo.Name) > 0 && contractInfo.Name[0] == 0) || (len(contractInfo.Symbol) > 0 && contractInfo.Symbol[0] == 0) {
|
||||
// fix contract name/symbol that was parsed as a string consisting of zeroes
|
||||
blockchainContractInfo, err := w.chain.GetContractInfo(cd)
|
||||
if err != nil {
|
||||
@@ -681,9 +682,10 @@ func (w *Worker) getContractDescriptorInfo(cd bchain.AddressDescriptor, typeFrom
|
||||
if blockchainContractInfo != nil {
|
||||
contractInfo.Decimals = blockchainContractInfo.Decimals
|
||||
}
|
||||
if contractInfo.Standard == bchain.UnhandledTokenType {
|
||||
if contractInfo.Standard == bchain.UnhandledTokenStandard {
|
||||
glog.Infof("Contract %v %v [%s] handled", cd, typeFromContext, contractInfo.Name)
|
||||
contractInfo.Standard = typeFromContext
|
||||
contractInfo.Type = typeFromContext
|
||||
}
|
||||
if err = w.db.StoreContractInfo(contractInfo); err != nil {
|
||||
glog.Errorf("StoreContractInfo error %v, contract %v", err, cd)
|
||||
@@ -700,12 +702,12 @@ func (w *Worker) getEthereumTokensTransfers(transfers bchain.TokenTransfers, add
|
||||
contractCache := make(contractInfoCache)
|
||||
for i := range transfers {
|
||||
t := transfers[i]
|
||||
typeName := bchain.EthereumTokenStandardMap[t.Standard]
|
||||
standard := bchain.EthereumTokenStandardMap[t.Standard]
|
||||
var contractInfo *bchain.ContractInfo
|
||||
if info, ok := contractCache[t.Contract]; ok {
|
||||
contractInfo = info
|
||||
} else {
|
||||
info, _, err := w.GetContractInfo(t.Contract, typeName)
|
||||
info, _, err := w.GetContractInfo(t.Contract, standard)
|
||||
if err != nil {
|
||||
glog.Errorf("getContractInfo error %v, contract %v", err, t.Contract)
|
||||
continue
|
||||
@@ -727,7 +729,8 @@ func (w *Worker) getEthereumTokensTransfers(transfers bchain.TokenTransfers, add
|
||||
aggregateAddress(addresses, t.From)
|
||||
aggregateAddress(addresses, t.To)
|
||||
tokens[i] = TokenTransfer{
|
||||
Type: typeName,
|
||||
Type: standard,
|
||||
Standard: standard,
|
||||
Contract: t.Contract,
|
||||
From: t.From,
|
||||
To: t.To,
|
||||
@@ -755,7 +758,7 @@ func (w *Worker) GetEthereumTokenURI(contract string, id string) (string, *bchai
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
ci, _, err := w.getContractDescriptorInfo(cd, bchain.UnknownTokenType)
|
||||
ci, _, err := w.getContractDescriptorInfo(cd, bchain.UnknownTokenStandard)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
@@ -957,8 +960,8 @@ func computePaging(count, page, itemsOnPage int) (Paging, int, int, int) {
|
||||
}
|
||||
|
||||
func (w *Worker) getEthereumContractBalance(addrDesc bchain.AddressDescriptor, index int, c *db.AddrContract, details AccountDetails, ticker *common.CurrencyRatesTicker, secondaryCoin string) (*Token, error) {
|
||||
typeName := bchain.EthereumTokenStandardMap[c.Standard]
|
||||
ci, validContract, err := w.getContractDescriptorInfo(c.Contract, typeName)
|
||||
standard := bchain.EthereumTokenStandardMap[c.Standard]
|
||||
ci, validContract, err := w.getContractDescriptorInfo(c.Contract, standard)
|
||||
if err != nil {
|
||||
return nil, errors.Annotatef(err, "getEthereumContractBalance %v", c.Contract)
|
||||
}
|
||||
@@ -966,14 +969,15 @@ func (w *Worker) getEthereumContractBalance(addrDesc bchain.AddressDescriptor, i
|
||||
Contract: ci.Contract,
|
||||
Name: ci.Name,
|
||||
Symbol: ci.Symbol,
|
||||
Type: typeName,
|
||||
Type: standard,
|
||||
Standard: standard,
|
||||
Transfers: int(c.Txs),
|
||||
Decimals: ci.Decimals,
|
||||
ContractIndex: strconv.Itoa(index),
|
||||
}
|
||||
// return contract balances/values only at or above AccountDetailsTokenBalances
|
||||
if details >= AccountDetailsTokenBalances && validContract {
|
||||
if c.Type == bchain.FungibleToken {
|
||||
if c.Standard == bchain.FungibleToken {
|
||||
// get Erc20 Contract Balance from blockchain, balance obtained from adding and subtracting transfers is not correct
|
||||
b, err := w.chain.EthereumTypeGetErc20ContractBalance(addrDesc, c.Contract)
|
||||
if err != nil {
|
||||
@@ -1022,7 +1026,7 @@ func (w *Worker) getEthereumContractBalance(addrDesc bchain.AddressDescriptor, i
|
||||
// a fallback method in case internal transactions are not processed and there is no indexed info about contract balance for an address
|
||||
func (w *Worker) getEthereumContractBalanceFromBlockchain(addrDesc, contract bchain.AddressDescriptor, details AccountDetails) (*Token, error) {
|
||||
var b *big.Int
|
||||
ci, validContract, err := w.getContractDescriptorInfo(contract, bchain.UnknownTokenType)
|
||||
ci, validContract, err := w.getContractDescriptorInfo(contract, bchain.UnknownTokenStandard)
|
||||
if err != nil {
|
||||
return nil, errors.Annotatef(err, "GetContractInfo %v", contract)
|
||||
}
|
||||
@@ -1037,7 +1041,8 @@ func (w *Worker) getEthereumContractBalanceFromBlockchain(addrDesc, contract bch
|
||||
b = nil
|
||||
}
|
||||
return &Token{
|
||||
Type: ci.Type,
|
||||
Type: ci.Standard,
|
||||
Standard: ci.Standard,
|
||||
BalanceSat: (*Amount)(b),
|
||||
Contract: ci.Contract,
|
||||
Name: ci.Name,
|
||||
@@ -1142,12 +1147,12 @@ func (w *Worker) getEthereumTypeAddressBalances(addrDesc bchain.AddressDescripto
|
||||
d.tokens = d.tokens[:j]
|
||||
sort.Sort(d.tokens)
|
||||
}
|
||||
d.contractInfo, err = w.db.GetContractInfo(addrDesc, bchain.UnknownTokenType)
|
||||
d.contractInfo, err = w.db.GetContractInfo(addrDesc, bchain.UnknownTokenStandard)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if d.contractInfo != nil && d.contractInfo.Type == bchain.UnhandledTokenType {
|
||||
d.contractInfo, _, err = w.getContractDescriptorInfo(addrDesc, bchain.UnknownTokenType)
|
||||
if d.contractInfo != nil && d.contractInfo.Standard == bchain.UnhandledTokenStandard {
|
||||
d.contractInfo, _, err = w.getContractDescriptorInfo(addrDesc, bchain.UnknownTokenStandard)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
@@ -1683,7 +1688,7 @@ func (w *Worker) GetBalanceHistory(address string, fromTimestamp, toTimestamp in
|
||||
}
|
||||
// do not get balance history for contracts
|
||||
if w.chainType == bchain.ChainEthereumType {
|
||||
ci, err := w.db.GetContractInfo(addrDesc, bchain.UnknownTokenType)
|
||||
ci, err := w.db.GetContractInfo(addrDesc, bchain.UnknownTokenStandard)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -268,8 +268,8 @@ func (w *Worker) tokenFromXpubAddress(data *xpubData, ad *xpubAddress, changeInd
|
||||
}
|
||||
return Token{
|
||||
// Deprecated: Use Standard instead.
|
||||
Type: bchain.XPUBAddressTokenType,
|
||||
Standard: bchain.XPUBAddressTokenType,
|
||||
Type: bchain.XPUBAddressStandard,
|
||||
Standard: bchain.XPUBAddressStandard,
|
||||
Name: address,
|
||||
Decimals: w.chainParser.AmountDecimals(),
|
||||
BalanceSat: (*Amount)(balance),
|
||||
|
||||
@@ -51,16 +51,16 @@ func processTransferEvent(l *bchain.RpcLog) (transfer *bchain.TokenTransfer, err
|
||||
}
|
||||
}()
|
||||
tl := len(l.Topics)
|
||||
var ttt bchain.TokenType
|
||||
var standard bchain.TokenStandard
|
||||
var value big.Int
|
||||
if tl == 3 {
|
||||
ttt = bchain.FungibleToken
|
||||
standard = bchain.FungibleToken
|
||||
_, ok := value.SetString(l.Data, 0)
|
||||
if !ok {
|
||||
return nil, errors.New("ERC20 log Data is not a number")
|
||||
}
|
||||
} else if tl == 4 {
|
||||
ttt = bchain.NonFungibleToken
|
||||
standard = bchain.NonFungibleToken
|
||||
_, ok := value.SetString(l.Topics[3], 0)
|
||||
if !ok {
|
||||
return nil, errors.New("ERC721 log Topics[3] is not a number")
|
||||
@@ -78,7 +78,7 @@ func processTransferEvent(l *bchain.RpcLog) (transfer *bchain.TokenTransfer, err
|
||||
return nil, err
|
||||
}
|
||||
return &bchain.TokenTransfer{
|
||||
Type: ttt,
|
||||
Standard: standard,
|
||||
Contract: EIP55AddressFromAddress(l.Address),
|
||||
From: EIP55AddressFromAddress(from),
|
||||
To: EIP55AddressFromAddress(to),
|
||||
@@ -119,7 +119,7 @@ func processERC1155TransferSingleEvent(l *bchain.RpcLog) (transfer *bchain.Token
|
||||
return nil, errors.New("ERC1155 log Data value is not a number")
|
||||
}
|
||||
return &bchain.TokenTransfer{
|
||||
Type: bchain.MultiToken,
|
||||
Standard: bchain.MultiToken,
|
||||
Contract: EIP55AddressFromAddress(l.Address),
|
||||
From: EIP55AddressFromAddress(from),
|
||||
To: EIP55AddressFromAddress(to),
|
||||
@@ -190,7 +190,7 @@ func processERC1155TransferBatchEvent(l *bchain.RpcLog) (transfer *bchain.TokenT
|
||||
idValues[i] = bchain.MultiTokenValue{Id: id, Value: value}
|
||||
}
|
||||
return &bchain.TokenTransfer{
|
||||
Type: bchain.MultiToken,
|
||||
Standard: bchain.MultiToken,
|
||||
Contract: EIP55AddressFromAddress(l.Address),
|
||||
From: EIP55AddressFromAddress(from),
|
||||
To: EIP55AddressFromAddress(to),
|
||||
@@ -239,7 +239,7 @@ func contractGetTransfersFromTx(tx *bchain.RpcTransaction) (bchain.TokenTransfer
|
||||
return nil, errors.New("Data is not a number")
|
||||
}
|
||||
r = append(r, &bchain.TokenTransfer{
|
||||
Type: bchain.FungibleToken,
|
||||
Standard: bchain.FungibleToken,
|
||||
Contract: EIP55AddressFromAddress(tx.To),
|
||||
From: EIP55AddressFromAddress(tx.From),
|
||||
To: EIP55AddressFromAddress(to),
|
||||
@@ -263,7 +263,7 @@ func contractGetTransfersFromTx(tx *bchain.RpcTransaction) (bchain.TokenTransfer
|
||||
return nil, errors.New("Data is not a number")
|
||||
}
|
||||
r = append(r, &bchain.TokenTransfer{
|
||||
Type: bchain.NonFungibleToken,
|
||||
Standard: bchain.NonFungibleToken,
|
||||
Contract: EIP55AddressFromAddress(tx.To),
|
||||
From: EIP55AddressFromAddress(from),
|
||||
To: EIP55AddressFromAddress(to),
|
||||
|
||||
@@ -133,7 +133,7 @@ func Test_contractGetTransfersFromLog(t *testing.T) {
|
||||
},
|
||||
want: bchain.TokenTransfers{
|
||||
{
|
||||
Type: bchain.NonFungibleToken,
|
||||
Standard: bchain.NonFungibleToken,
|
||||
Contract: "0x5689b918D34C038901870105A6C7fc24744D31eB",
|
||||
From: "0x0a206d4d5ff79cb5069def7fe3598421cff09391",
|
||||
To: "0x6a016d7eec560549ffa0fbdb7f15c2b27302087f",
|
||||
@@ -171,7 +171,7 @@ func Test_contractGetTransfersFromLog(t *testing.T) {
|
||||
},
|
||||
want: bchain.TokenTransfers{
|
||||
{
|
||||
Type: bchain.MultiToken,
|
||||
Standard: bchain.MultiToken,
|
||||
Contract: "0x6Fd712E3A5B556654044608F9129040A4839E36c",
|
||||
From: "0xa3950b823cb063dd9afc0d27f35008b805b3ed53",
|
||||
To: "0x4392faf3bb96b5694ecc6ef64726f61cdd4bb0ec",
|
||||
@@ -195,7 +195,7 @@ func Test_contractGetTransfersFromLog(t *testing.T) {
|
||||
},
|
||||
want: bchain.TokenTransfers{
|
||||
{
|
||||
Type: bchain.MultiToken,
|
||||
Standard: bchain.MultiToken,
|
||||
Contract: "0x6c42c26a081c2f509f8bb68fb7ac3062311ccfb7",
|
||||
From: "0x0000000000000000000000000000000000000000",
|
||||
To: "0x5dc6288b35e0807a3d6feb89b3a2ff4ab773168e",
|
||||
@@ -247,7 +247,7 @@ func Test_contractGetTransfersFromTx(t *testing.T) {
|
||||
args: (b1.Txs[1].CoinSpecificData.(bchain.EthereumSpecificData)).Tx,
|
||||
want: bchain.TokenTransfers{
|
||||
{
|
||||
Type: bchain.FungibleToken,
|
||||
Standard: bchain.FungibleToken,
|
||||
Contract: "0x4af4114f73d1c1c903ac9e0361b379d1291808a2",
|
||||
From: "0x20cd153de35d469ba46127a0c8f18626b59a256a",
|
||||
To: "0x555ee11fbddc0e49a9bab358a8941ad95ffdb48f",
|
||||
@@ -260,7 +260,7 @@ func Test_contractGetTransfersFromTx(t *testing.T) {
|
||||
args: (b2.Txs[2].CoinSpecificData.(bchain.EthereumSpecificData)).Tx,
|
||||
want: bchain.TokenTransfers{
|
||||
{
|
||||
Type: bchain.NonFungibleToken,
|
||||
Standard: bchain.NonFungibleToken,
|
||||
Contract: "0xcda9fc258358ecaa88845f19af595e908bb7efe9",
|
||||
From: "0x837e3f699d85a4b0b99894567e9233dfb1dcb081",
|
||||
To: "0x7b62eb7fe80350dc7ec945c0b73242cb9877fb1b",
|
||||
|
||||
@@ -643,7 +643,8 @@ func (b *EthereumRPC) getCreationContractInfo(contract string, height uint32) *b
|
||||
Contract: contract,
|
||||
}
|
||||
// }
|
||||
ci.Standard = bchain.UnhandledTokenType
|
||||
ci.Standard = bchain.UnhandledTokenStandard
|
||||
ci.Type = bchain.UnhandledTokenStandard
|
||||
ci.CreatedInBlock = height
|
||||
return ci
|
||||
}
|
||||
|
||||
@@ -134,11 +134,11 @@ type TokenStandardName string
|
||||
|
||||
// Token types
|
||||
const (
|
||||
UnknownTokenType TokenStandardName = ""
|
||||
UnhandledTokenType TokenStandardName = "-"
|
||||
UnknownTokenStandard TokenStandardName = ""
|
||||
UnhandledTokenStandard TokenStandardName = "-"
|
||||
|
||||
// XPUBAddressTokenType is address derived from xpub
|
||||
XPUBAddressTokenType TokenStandardName = "XPUBAddress"
|
||||
// XPUBAddressStandard is address derived from xpub
|
||||
XPUBAddressStandard TokenStandardName = "XPUBAddress"
|
||||
)
|
||||
|
||||
// TokenTransfers is array of TokenTransfer
|
||||
@@ -147,7 +147,7 @@ type TokenTransfers []*TokenTransfer
|
||||
func (a TokenTransfers) Len() int { return len(a) }
|
||||
func (a TokenTransfers) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
func (a TokenTransfers) Less(i, j int) bool {
|
||||
return a[i].Type < a[j].Type
|
||||
return a[i].Standard < a[j].Standard
|
||||
}
|
||||
|
||||
// Block is block header and list of transactions
|
||||
|
||||
@@ -88,8 +88,6 @@ type MultiTokenValue struct {
|
||||
|
||||
// TokenTransfer contains a single token transfer
|
||||
type TokenTransfer struct {
|
||||
// Deprecated: Use Standard instead.
|
||||
Type TokenStandard
|
||||
Standard TokenStandard
|
||||
Contract string
|
||||
From string
|
||||
|
||||
@@ -108,8 +108,6 @@ func (s *MultiTokenValues) upsert(m bchain.MultiTokenValue, index int32, aggrega
|
||||
|
||||
// AddrContract is Contract address with number of transactions done by given address
|
||||
type AddrContract struct {
|
||||
// Deprecated: Use Standard instead.
|
||||
Type bchain.TokenStandard
|
||||
Standard bchain.TokenStandard
|
||||
Contract bchain.AddressDescriptor
|
||||
Txs uint
|
||||
@@ -138,12 +136,12 @@ func packAddrContracts(acs *AddrContracts) []byte {
|
||||
buf = append(buf, varBuf[:l]...)
|
||||
for _, ac := range acs.Contracts {
|
||||
buf = append(buf, ac.Contract...)
|
||||
l = packVaruint(uint(ac.Type)+ac.Txs<<2, varBuf)
|
||||
l = packVaruint(uint(ac.Standard)+ac.Txs<<2, varBuf)
|
||||
buf = append(buf, varBuf[:l]...)
|
||||
if ac.Type == bchain.FungibleToken {
|
||||
if ac.Standard == bchain.FungibleToken {
|
||||
l = packBigint(&ac.Value, varBuf)
|
||||
buf = append(buf, varBuf[:l]...)
|
||||
} else if ac.Type == bchain.NonFungibleToken {
|
||||
} else if ac.Standard == bchain.NonFungibleToken {
|
||||
l = packVaruint(uint(len(ac.Ids)), varBuf)
|
||||
buf = append(buf, varBuf[:l]...)
|
||||
for i := range ac.Ids {
|
||||
@@ -182,7 +180,7 @@ func unpackAddrContracts(buf []byte, addrDesc bchain.AddressDescriptor) (*AddrCo
|
||||
ttt := bchain.TokenStandard(txs & 3)
|
||||
txs >>= 2
|
||||
ac := AddrContract{
|
||||
Type: ttt,
|
||||
Standard: ttt,
|
||||
Contract: contract,
|
||||
Txs: txs,
|
||||
}
|
||||
@@ -318,9 +316,9 @@ func addToContract(c *AddrContract, contractIndex int, index int32, contract bch
|
||||
s.Add(s, v)
|
||||
}
|
||||
}
|
||||
if transfer.Type == bchain.FungibleToken {
|
||||
if transfer.Standard == bchain.FungibleToken {
|
||||
aggregate(&c.Value, &transfer.Value)
|
||||
} else if transfer.Type == bchain.NonFungibleToken {
|
||||
} else if transfer.Standard == bchain.NonFungibleToken {
|
||||
if index < 0 {
|
||||
c.Ids.remove(transfer.Value)
|
||||
} else {
|
||||
@@ -371,7 +369,7 @@ func (d *RocksDB) addToAddressesAndContractsEthereumType(addrDesc bchain.Address
|
||||
contractIndex = len(ac.Contracts)
|
||||
ac.Contracts = append(ac.Contracts, AddrContract{
|
||||
Contract: contract,
|
||||
Type: transfer.Type,
|
||||
Standard: transfer.Standard,
|
||||
})
|
||||
}
|
||||
c := &ac.Contracts[contractIndex]
|
||||
@@ -568,7 +566,7 @@ func (d *RocksDB) processContractTransfers(blockTx *ethBlockTx, tx *bchain.Tx, a
|
||||
return err
|
||||
}
|
||||
bc := &blockTx.contracts[i]
|
||||
bc.transferType = t.Type
|
||||
bc.transferType = t.Standard
|
||||
bc.from = from
|
||||
bc.to = to
|
||||
bc.contract = contract
|
||||
@@ -849,7 +847,7 @@ var cachedContractsMux sync.Mutex
|
||||
func packContractInfo(contractInfo *bchain.ContractInfo) []byte {
|
||||
buf := packString(contractInfo.Name)
|
||||
buf = append(buf, packString(contractInfo.Symbol)...)
|
||||
buf = append(buf, packString(string(contractInfo.Type))...)
|
||||
buf = append(buf, packString(string(contractInfo.Standard))...)
|
||||
varBuf := make([]byte, vlq.MaxLen64)
|
||||
l := packVaruint(uint(contractInfo.Decimals), varBuf)
|
||||
buf = append(buf, varBuf[:l]...)
|
||||
@@ -871,6 +869,7 @@ func unpackContractInfo(buf []byte) (*bchain.ContractInfo, error) {
|
||||
buf = buf[l:]
|
||||
s, l = unpackString(buf)
|
||||
contractInfo.Standard = bchain.TokenStandardName(s)
|
||||
contractInfo.Type = bchain.TokenStandardName(s)
|
||||
buf = buf[l:]
|
||||
ui, l = unpackVaruint(buf)
|
||||
contractInfo.Decimals = int(ui)
|
||||
@@ -916,6 +915,7 @@ func (d *RocksDB) GetContractInfo(contract bchain.AddressDescriptor, typeFromCon
|
||||
// if the type is specified and stored contractInfo has unknown type, set and store it
|
||||
if typeFromContext != bchain.UnknownTokenStandard && contractInfo.Standard == bchain.UnknownTokenStandard {
|
||||
contractInfo.Standard = typeFromContext
|
||||
contractInfo.Type = typeFromContext
|
||||
err = d.db.PutCF(d.wo, d.cfh[cfContracts], contract, packContractInfo(contractInfo))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1259,7 +1259,7 @@ func (d *RocksDB) disconnectAddress(btxID []byte, internal bool, addrDesc bchain
|
||||
index = transferTo
|
||||
}
|
||||
addToContract(addrContract, contractIndex, index, btxContract.contract, &bchain.TokenTransfer{
|
||||
Type: btxContract.transferType,
|
||||
Standard: btxContract.transferType,
|
||||
Value: btxContract.value,
|
||||
MultiTokenValues: btxContract.idValues,
|
||||
}, false)
|
||||
|
||||
@@ -756,13 +756,13 @@ func Test_packUnpackAddrContracts(t *testing.T) {
|
||||
InternalTxs: 8873,
|
||||
Contracts: []AddrContract{
|
||||
{
|
||||
Type: bchain.FungibleToken,
|
||||
Standard: bchain.FungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract0d, parser),
|
||||
Txs: 8,
|
||||
Value: *big.NewInt(793201132),
|
||||
},
|
||||
{
|
||||
Type: bchain.NonFungibleToken,
|
||||
Standard: bchain.NonFungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
|
||||
Txs: 41235,
|
||||
Ids: Ids{
|
||||
@@ -774,7 +774,7 @@ func Test_packUnpackAddrContracts(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: bchain.MultiToken,
|
||||
Standard: bchain.MultiToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract4a, parser),
|
||||
Txs: 64,
|
||||
MultiTokenValues: MultiTokenValues{
|
||||
@@ -830,8 +830,8 @@ func Test_addToContracts(t *testing.T) {
|
||||
index: 1,
|
||||
contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
|
||||
transfer: &bchain.TokenTransfer{
|
||||
Type: bchain.FungibleToken,
|
||||
Value: *big.NewInt(123456),
|
||||
Standard: bchain.FungibleToken,
|
||||
Value: *big.NewInt(123456),
|
||||
},
|
||||
addTxCount: true,
|
||||
},
|
||||
@@ -839,7 +839,7 @@ func Test_addToContracts(t *testing.T) {
|
||||
wantAddrContracts: &AddrContracts{
|
||||
Contracts: []AddrContract{
|
||||
{
|
||||
Type: bchain.FungibleToken,
|
||||
Standard: bchain.FungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
|
||||
Txs: 1,
|
||||
Value: *big.NewInt(123456),
|
||||
@@ -853,8 +853,8 @@ func Test_addToContracts(t *testing.T) {
|
||||
index: ^1,
|
||||
contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
|
||||
transfer: &bchain.TokenTransfer{
|
||||
Type: bchain.FungibleToken,
|
||||
Value: *big.NewInt(23456),
|
||||
Standard: bchain.FungibleToken,
|
||||
Value: *big.NewInt(23456),
|
||||
},
|
||||
addTxCount: true,
|
||||
},
|
||||
@@ -862,7 +862,7 @@ func Test_addToContracts(t *testing.T) {
|
||||
wantAddrContracts: &AddrContracts{
|
||||
Contracts: []AddrContract{
|
||||
{
|
||||
Type: bchain.FungibleToken,
|
||||
Standard: bchain.FungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
|
||||
Value: *big.NewInt(100000),
|
||||
Txs: 2,
|
||||
@@ -876,8 +876,8 @@ func Test_addToContracts(t *testing.T) {
|
||||
index: 1,
|
||||
contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
|
||||
transfer: &bchain.TokenTransfer{
|
||||
Type: bchain.NonFungibleToken,
|
||||
Value: *big.NewInt(1),
|
||||
Standard: bchain.NonFungibleToken,
|
||||
Value: *big.NewInt(1),
|
||||
},
|
||||
addTxCount: true,
|
||||
},
|
||||
@@ -885,13 +885,13 @@ func Test_addToContracts(t *testing.T) {
|
||||
wantAddrContracts: &AddrContracts{
|
||||
Contracts: []AddrContract{
|
||||
{
|
||||
Type: bchain.FungibleToken,
|
||||
Standard: bchain.FungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
|
||||
Value: *big.NewInt(100000),
|
||||
Txs: 2,
|
||||
},
|
||||
{
|
||||
Type: bchain.NonFungibleToken,
|
||||
Standard: bchain.NonFungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
|
||||
Txs: 1,
|
||||
Ids: Ids{*big.NewInt(1)},
|
||||
@@ -905,8 +905,8 @@ func Test_addToContracts(t *testing.T) {
|
||||
index: 1,
|
||||
contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
|
||||
transfer: &bchain.TokenTransfer{
|
||||
Type: bchain.NonFungibleToken,
|
||||
Value: *big.NewInt(2),
|
||||
Standard: bchain.NonFungibleToken,
|
||||
Value: *big.NewInt(2),
|
||||
},
|
||||
addTxCount: true,
|
||||
},
|
||||
@@ -914,13 +914,13 @@ func Test_addToContracts(t *testing.T) {
|
||||
wantAddrContracts: &AddrContracts{
|
||||
Contracts: []AddrContract{
|
||||
{
|
||||
Type: bchain.FungibleToken,
|
||||
Standard: bchain.FungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
|
||||
Value: *big.NewInt(100000),
|
||||
Txs: 2,
|
||||
},
|
||||
{
|
||||
Type: bchain.NonFungibleToken,
|
||||
Standard: bchain.NonFungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
|
||||
Txs: 2,
|
||||
Ids: Ids{*big.NewInt(1), *big.NewInt(2)},
|
||||
@@ -934,8 +934,8 @@ func Test_addToContracts(t *testing.T) {
|
||||
index: ^1,
|
||||
contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
|
||||
transfer: &bchain.TokenTransfer{
|
||||
Type: bchain.NonFungibleToken,
|
||||
Value: *big.NewInt(1),
|
||||
Standard: bchain.NonFungibleToken,
|
||||
Value: *big.NewInt(1),
|
||||
},
|
||||
addTxCount: false,
|
||||
},
|
||||
@@ -943,13 +943,13 @@ func Test_addToContracts(t *testing.T) {
|
||||
wantAddrContracts: &AddrContracts{
|
||||
Contracts: []AddrContract{
|
||||
{
|
||||
Type: bchain.FungibleToken,
|
||||
Standard: bchain.FungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
|
||||
Value: *big.NewInt(100000),
|
||||
Txs: 2,
|
||||
},
|
||||
{
|
||||
Type: bchain.NonFungibleToken,
|
||||
Standard: bchain.NonFungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
|
||||
Txs: 2,
|
||||
Ids: Ids{*big.NewInt(2)},
|
||||
@@ -963,7 +963,7 @@ func Test_addToContracts(t *testing.T) {
|
||||
index: 1,
|
||||
contract: addressToAddrDesc(dbtestdata.EthAddrContractCd, parser),
|
||||
transfer: &bchain.TokenTransfer{
|
||||
Type: bchain.MultiToken,
|
||||
Standard: bchain.MultiToken,
|
||||
MultiTokenValues: []bchain.MultiTokenValue{
|
||||
{
|
||||
Id: *big.NewInt(11),
|
||||
@@ -977,19 +977,19 @@ func Test_addToContracts(t *testing.T) {
|
||||
wantAddrContracts: &AddrContracts{
|
||||
Contracts: []AddrContract{
|
||||
{
|
||||
Type: bchain.FungibleToken,
|
||||
Standard: bchain.FungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
|
||||
Value: *big.NewInt(100000),
|
||||
Txs: 2,
|
||||
},
|
||||
{
|
||||
Type: bchain.NonFungibleToken,
|
||||
Standard: bchain.NonFungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
|
||||
Txs: 2,
|
||||
Ids: Ids{*big.NewInt(2)},
|
||||
},
|
||||
{
|
||||
Type: bchain.MultiToken,
|
||||
Standard: bchain.MultiToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContractCd, parser),
|
||||
Txs: 1,
|
||||
MultiTokenValues: MultiTokenValues{
|
||||
@@ -1008,7 +1008,7 @@ func Test_addToContracts(t *testing.T) {
|
||||
index: 1,
|
||||
contract: addressToAddrDesc(dbtestdata.EthAddrContractCd, parser),
|
||||
transfer: &bchain.TokenTransfer{
|
||||
Type: bchain.MultiToken,
|
||||
Standard: bchain.MultiToken,
|
||||
MultiTokenValues: []bchain.MultiTokenValue{
|
||||
{
|
||||
Id: *big.NewInt(11),
|
||||
@@ -1026,19 +1026,19 @@ func Test_addToContracts(t *testing.T) {
|
||||
wantAddrContracts: &AddrContracts{
|
||||
Contracts: []AddrContract{
|
||||
{
|
||||
Type: bchain.FungibleToken,
|
||||
Standard: bchain.FungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
|
||||
Value: *big.NewInt(100000),
|
||||
Txs: 2,
|
||||
},
|
||||
{
|
||||
Type: bchain.NonFungibleToken,
|
||||
Standard: bchain.NonFungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
|
||||
Txs: 2,
|
||||
Ids: Ids{*big.NewInt(2)},
|
||||
},
|
||||
{
|
||||
Type: bchain.MultiToken,
|
||||
Standard: bchain.MultiToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContractCd, parser),
|
||||
Txs: 2,
|
||||
MultiTokenValues: MultiTokenValues{
|
||||
@@ -1061,7 +1061,7 @@ func Test_addToContracts(t *testing.T) {
|
||||
index: ^1,
|
||||
contract: addressToAddrDesc(dbtestdata.EthAddrContractCd, parser),
|
||||
transfer: &bchain.TokenTransfer{
|
||||
Type: bchain.MultiToken,
|
||||
Standard: bchain.MultiToken,
|
||||
MultiTokenValues: []bchain.MultiTokenValue{
|
||||
{
|
||||
Id: *big.NewInt(11),
|
||||
@@ -1079,19 +1079,19 @@ func Test_addToContracts(t *testing.T) {
|
||||
wantAddrContracts: &AddrContracts{
|
||||
Contracts: []AddrContract{
|
||||
{
|
||||
Type: bchain.FungibleToken,
|
||||
Standard: bchain.FungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract47, parser),
|
||||
Value: *big.NewInt(100000),
|
||||
Txs: 2,
|
||||
},
|
||||
{
|
||||
Type: bchain.NonFungibleToken,
|
||||
Standard: bchain.NonFungibleToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContract6f, parser),
|
||||
Txs: 2,
|
||||
Ids: Ids{*big.NewInt(2)},
|
||||
},
|
||||
{
|
||||
Type: bchain.MultiToken,
|
||||
Standard: bchain.MultiToken,
|
||||
Contract: addressToAddrDesc(dbtestdata.EthAddrContractCd, parser),
|
||||
Txs: 3,
|
||||
MultiTokenValues: MultiTokenValues{
|
||||
@@ -1112,7 +1112,7 @@ func Test_addToContracts(t *testing.T) {
|
||||
contractIndex = len(addrContracts.Contracts)
|
||||
addrContracts.Contracts = append(addrContracts.Contracts, AddrContract{
|
||||
Contract: tt.args.contract,
|
||||
Type: tt.args.transfer.Type,
|
||||
Standard: tt.args.transfer.Standard,
|
||||
})
|
||||
}
|
||||
if got := addToContract(&addrContracts.Contracts[contractIndex], contractIndex, tt.args.index, tt.args.contract, tt.args.transfer, tt.args.addTxCount); got != tt.wantIndex {
|
||||
@@ -1269,7 +1269,8 @@ func Test_packUnpackContractInfo(t *testing.T) {
|
||||
{
|
||||
name: "unknown",
|
||||
contractInfo: bchain.ContractInfo{
|
||||
Type: bchain.UnknownTokenType,
|
||||
Type: bchain.UnknownTokenStandard,
|
||||
Standard: bchain.UnknownTokenStandard,
|
||||
Name: "Test contract",
|
||||
Symbol: "TCT",
|
||||
Decimals: 18,
|
||||
@@ -1280,7 +1281,8 @@ func Test_packUnpackContractInfo(t *testing.T) {
|
||||
{
|
||||
name: "ERC20",
|
||||
contractInfo: bchain.ContractInfo{
|
||||
Type: bchain.ERC20TokenType,
|
||||
Type: bchain.ERC20TokenStandard,
|
||||
Standard: bchain.ERC20TokenStandard,
|
||||
Name: "GreenContract🟢",
|
||||
Symbol: "🟢",
|
||||
Decimals: 0,
|
||||
|
||||
@@ -242,7 +242,7 @@ func (s *InternalServer) apiContractInfo(r *http.Request, apiVersion int) (inter
|
||||
return nil, api.NewAPIError("Missing contract address", true)
|
||||
}
|
||||
|
||||
contractInfo, valid, err := s.api.GetContractInfo(contractAddress, bchain.UnknownTokenType)
|
||||
contractInfo, valid, err := s.api.GetContractInfo(contractAddress, bchain.UnknownTokenStandard)
|
||||
if err != nil {
|
||||
return nil, api.NewAPIError(err.Error(), true)
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -51,10 +51,10 @@
|
||||
<td>{{$addr.Nonce}}</td>
|
||||
</tr>
|
||||
{{if $addr.ContractInfo}}
|
||||
{{if $addr.ContractInfo.Type}}
|
||||
{{if $addr.ContractInfo.Standard}}
|
||||
<tr>
|
||||
<td style="width: 25%;">Contract type</td>
|
||||
<td>{{$addr.ContractInfo.Type}}</td>
|
||||
<td style="width: 25%;">Standard</td>
|
||||
<td>{{$addr.ContractInfo.Standard}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{if $addr.ContractInfo.CreatedInBlock}}
|
||||
@@ -131,7 +131,7 @@
|
||||
<th class="text-end" style="width: 10%;"><span class="d-none d-md-block">Transfers</span><span class="d-block d-md-none">#</span></th>
|
||||
</tr>
|
||||
{{range $t := $addr.Tokens}}
|
||||
{{if eq $t.Type $.FungibleTokenName}}
|
||||
{{if eq $t.Standard $.FungibleTokenName}}
|
||||
<tr>
|
||||
<td class="ellipsis"><a href="/address/{{$t.Contract}}">{{if $t.Name}}<span class="copyable" cc="{{$t.Contract}}" alias-type="Contract">{{$t.Name}}</span>{{else}}<span class="copyable">{{$t.Contract}}</span>{{end}}</a></td>
|
||||
<td>{{formattedAmountSpan $t.BalanceSat $t.Decimals $t.Symbol $data "copyable"}}</td>
|
||||
@@ -167,7 +167,7 @@
|
||||
<th class="text-end" style="width: 10%;"><span class="d-none d-md-block">Transfers</span><span class="d-block d-md-none">#</span></th>
|
||||
</tr>
|
||||
{{range $t := $addr.Tokens}}
|
||||
{{if eq $t.Type $.NonFungibleTokenName}}
|
||||
{{if eq $t.Standard $.NonFungibleTokenName}}
|
||||
<tr>
|
||||
<td class="ellipsis"><a href="/address/{{$t.Contract}}">{{if $t.Name}}<span class="copyable" cc="{{$t.Contract}}" alias-type="Contract">{{$t.Name}}</span>{{else}}<span class="copyable">{{$t.Contract}}</span>{{end}}</a></td>
|
||||
<td>
|
||||
@@ -204,7 +204,7 @@
|
||||
<th class="text-end" style="width: 10%;"><span class="d-none d-md-block">Transfers</span><span class="d-block d-md-none">#</span></th>
|
||||
</tr>
|
||||
{{range $t := $addr.Tokens}}
|
||||
{{if eq $t.Type $.MultiTokenName}}
|
||||
{{if eq $t.Standard $.MultiTokenName}}
|
||||
<tr>
|
||||
<td class="ellipsis"><a href="/address/{{$t.Contract}}">{{if $t.Name}}<span class="copyable" cc="{{$t.Contract}}" alias-type="Contract">{{$t.Name}}</span>{{else}}<span class="copyable">{{$t.Contract}}</span>{{end}}</a></td>
|
||||
<td>
|
||||
@@ -288,17 +288,17 @@
|
||||
<option {{if eq $addr.Filter "0"}}selected{{end}} value="0">Non-contract</option>
|
||||
<option {{if eq $addr.Filter "1"}}selected{{end}} value="1">Internal</option>
|
||||
{{range $t := $addr.Tokens}}
|
||||
{{if eq $t.Type $.FungibleTokenName}}
|
||||
{{if eq $t.Standard $.FungibleTokenName}}
|
||||
<option {{if eq $addr.Filter $t.ContractIndex}}selected{{end}} value="{{$t.ContractIndex}}">{{if $t.Name}}{{$t.Name}}{{else}}{{$t.Contract}}{{end}} ({{$.FungibleTokenName}})</option>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{range $t := $addr.Tokens}}
|
||||
{{if eq $t.Type $.NonFungibleTokenName}}
|
||||
{{if eq $t.Standard $.NonFungibleTokenName}}
|
||||
<option {{if eq $addr.Filter $t.ContractIndex}}selected{{end}} value="{{$t.ContractIndex}}">{{if $t.Name}}{{$t.Name}}{{else}}{{$t.Contract}}{{end}} ({{$.NonFungibleTokenName}})</option>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{range $t := $addr.Tokens}}
|
||||
{{if eq $t.Type $.MultiTokenName}}
|
||||
{{if eq $t.Standard $.MultiTokenName}}
|
||||
<option {{if eq $addr.Filter $t.ContractIndex}}selected{{end}} value="{{$t.ContractIndex}}">{{if $t.Name}}{{$t.Name}}{{else}}{{$t.Contract}}{{end}} ({{$.MultiTokenName}})</option>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
<td><a href="/address/{{$data.ContractInfo.Contract}}"><span class="copyable">{{$data.ContractInfo.Contract}}</span></a><br>{{$data.ContractInfo.Name}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Contract type</td>
|
||||
<td>{{$data.ContractInfo.Type}}</td>
|
||||
<td>Standard</td>
|
||||
<td>{{$data.ContractInfo.Standard}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
{{.FungibleTokenName}} Token Transfers
|
||||
</div>
|
||||
{{range $tt := $tx.TokenTransfers}}
|
||||
{{if eq $tt.Type $.FungibleTokenName}}
|
||||
{{if eq $tt.Standard $.FungibleTokenName}}
|
||||
<div class="row body">
|
||||
<div class="col-md-4">
|
||||
<div class="row tx-addr">
|
||||
@@ -128,7 +128,7 @@
|
||||
{{.NonFungibleTokenName}} Token Transfers
|
||||
</div>
|
||||
{{range $tt := $tx.TokenTransfers}}
|
||||
{{if eq $tt.Type $.NonFungibleTokenName}}
|
||||
{{if eq $tt.Standard $.NonFungibleTokenName}}
|
||||
<div class="row body">
|
||||
<div class="col-md-4">
|
||||
<div class="row tx-addr">
|
||||
@@ -156,7 +156,7 @@
|
||||
{{.MultiTokenName}} Token Transfers
|
||||
</div>
|
||||
{{range $tt := $tx.TokenTransfers}}
|
||||
{{if eq $tt.Type $.MultiTokenName}}
|
||||
{{if eq $tt.Standard $.MultiTokenName}}
|
||||
<div class="row body">
|
||||
<div class="col-md-4">
|
||||
<div class="row tx-addr">
|
||||
|
||||
@@ -132,7 +132,7 @@ var Block1SpecificData = &bchain.EthereumBlockSpecificData{
|
||||
Contracts: []bchain.ContractInfo{
|
||||
{
|
||||
Contract: EthAddrContract4a,
|
||||
Type: bchain.ERC20TokenType,
|
||||
Standard: bchain.ERC20TokenStandard,
|
||||
Name: "Contract 74",
|
||||
Symbol: "S74",
|
||||
Decimals: 12,
|
||||
|
||||
@@ -120,7 +120,7 @@ func (c *fakeBlockChainEthereumType) EthereumTypeGetNonce(addrDesc bchain.Addres
|
||||
func (c *fakeBlockChainEthereumType) GetContractInfo(contractDesc bchain.AddressDescriptor) (*bchain.ContractInfo, error) {
|
||||
addresses, _, _ := c.Parser.GetAddressesFromAddrDesc(contractDesc)
|
||||
return &bchain.ContractInfo{
|
||||
Type: bchain.ERC20TokenType,
|
||||
Standard: bchain.ERC20TokenStandard,
|
||||
Contract: addresses[0],
|
||||
Name: "Contract " + strconv.Itoa(int(contractDesc[0])),
|
||||
Symbol: "S" + strconv.Itoa(int(contractDesc[0])),
|
||||
|
||||
Reference in New Issue
Block a user