Fix balance and add cross-shard txs

pull/1618/head
flicker-harmony 5 years ago
parent af8f5a8d14
commit 2228e22669
  1. 1
      api/service/explorer/service.go
  2. 4
      api/service/explorer/structs.go

@ -695,7 +695,6 @@ func (s *Service) GetExplorerAddress(w http.ResponseWriter, r *http.Request) {
balance, err := s.GetAccountBalance(address)
if err == nil {
balanceAddr = balance
data.Address.Balance = balance
}
}

@ -57,6 +57,8 @@ type Transaction struct {
Value *big.Int `json:"value"`
Bytes string `json:"bytes"`
Data string `json:"data"`
FromShard uint32 `json:"fromShard"`
ToShard uint32 `json:"toShard"`
Type string `json:"type"`
}
@ -126,6 +128,8 @@ func GetTransaction(tx *types.Transaction, addressBlock *types.Block) *Transacti
Value: msg.Value(),
Bytes: strconv.Itoa(int(tx.Size())),
Data: hex.EncodeToString(tx.Data()),
FromShard: tx.ShardID(),
ToShard: tx.ToShardID(),
Type: "",
}
}

Loading…
Cancel
Save