move client to api/client

Signed-off-by: Leo Chen <leo@harmony.one>
pull/197/head
Leo Chen 6 years ago
parent dd6c03216b
commit 7b2d36fde7
  1. 0
      api/client/client.go
  2. 2
      api/client/service/client.go
  3. 0
      api/client/service/proto/client.pb.go
  4. 0
      api/client/service/proto/client.proto
  5. 2
      api/client/service/server.go
  6. 2
      cmd/client/txgen/main.go
  7. 8
      cmd/client/wallet/main.go
  8. 4
      node/node.go

@ -4,7 +4,7 @@ import (
"context"
"fmt"
"github.com/ethereum/go-ethereum/common"
proto "github.com/harmony-one/harmony/client/service/proto"
proto "github.com/harmony-one/harmony/api/client/service/proto"
"log"
"time"

@ -9,7 +9,7 @@ import (
"google.golang.org/grpc"
proto "github.com/harmony-one/harmony/client/service/proto"
proto "github.com/harmony-one/harmony/api/client/service/proto"
)
// Server is the Server struct for client service package.

@ -9,8 +9,8 @@ import (
"sync"
"time"
"github.com/harmony-one/harmony/api/client"
proto_node "github.com/harmony-one/harmony/api/proto/node"
"github.com/harmony-one/harmony/client"
"github.com/harmony-one/harmony/cmd/client/txgen/txgen"
"github.com/harmony-one/harmony/consensus"
"github.com/harmony-one/harmony/core/types"

@ -17,9 +17,9 @@ import (
"github.com/ethereum/go-ethereum/common"
crypto2 "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/params"
"github.com/harmony-one/harmony/api/client"
clientService "github.com/harmony-one/harmony/api/client/service"
proto_node "github.com/harmony-one/harmony/api/proto/node"
"github.com/harmony-one/harmony/client"
client2 "github.com/harmony-one/harmony/client/service"
"github.com/harmony-one/harmony/core/types"
libs "github.com/harmony-one/harmony/internal/beaconchain/libs"
"github.com/harmony-one/harmony/internal/beaconchain/rpc"
@ -314,7 +314,7 @@ func FetchBalance(address common.Address, walletNode *node.Node) map[uint32]Acco
result := make(map[uint32]AccountState)
for shardID, leader := range *walletNode.Client.Leaders {
port, _ := strconv.Atoi(leader.Port)
client := client2.NewClient(leader.IP, strconv.Itoa(port+node.ClientServicePortDiff))
client := clientService.NewClient(leader.IP, strconv.Itoa(port+node.ClientServicePortDiff))
response := client.GetBalance(address)
balance := big.NewInt(0)
balance.SetBytes(response.Balance)
@ -328,7 +328,7 @@ func FetchBalance(address common.Address, walletNode *node.Node) map[uint32]Acco
func GetFreeToken(address common.Address, walletNode *node.Node) {
for shardID, leader := range *walletNode.Client.Leaders {
port, _ := strconv.Atoi(leader.Port)
client := client2.NewClient(leader.IP, strconv.Itoa(port+node.ClientServicePortDiff))
client := clientService.NewClient(leader.IP, strconv.Itoa(port+node.ClientServicePortDiff))
response := client.GetFreeToken(address)
txID := common.Hash{}

@ -18,13 +18,13 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rlp"
"github.com/harmony-one/harmony/api/client"
clientService "github.com/harmony-one/harmony/api/client/service"
proto_node "github.com/harmony-one/harmony/api/proto/node"
"github.com/harmony-one/harmony/api/services/explorer"
"github.com/harmony-one/harmony/api/services/syncing"
"github.com/harmony-one/harmony/api/services/syncing/downloader"
downloader_pb "github.com/harmony-one/harmony/api/services/syncing/downloader/proto"
"github.com/harmony-one/harmony/client"
clientService "github.com/harmony-one/harmony/client/service"
bft "github.com/harmony-one/harmony/consensus"
"github.com/harmony-one/harmony/core"
"github.com/harmony-one/harmony/core/types"

Loading…
Cancel
Save