diff --git a/cmd/client/txgen/main.go b/cmd/client/txgen/main.go index 6b3744eed..b707ee864 100644 --- a/cmd/client/txgen/main.go +++ b/cmd/client/txgen/main.go @@ -12,10 +12,10 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/harmony-one/harmony/api/client" proto_node "github.com/harmony-one/harmony/api/proto/node" - "github.com/harmony-one/harmony/cmd/client/txgen/txgen" "github.com/harmony-one/harmony/consensus" "github.com/harmony-one/harmony/core/types" nodeconfig "github.com/harmony-one/harmony/internal/configs/node" + "github.com/harmony-one/harmony/internal/txgen" "github.com/harmony-one/harmony/internal/utils" "github.com/harmony-one/harmony/node" "github.com/harmony-one/harmony/p2p" diff --git a/cmd/client/wallet/main.go b/cmd/client/wallet/main.go index a167913b5..741d69fd0 100644 --- a/cmd/client/wallet/main.go +++ b/cmd/client/wallet/main.go @@ -19,8 +19,8 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" clientService "github.com/harmony-one/harmony/api/client/service" - "github.com/harmony-one/harmony/cmd/client/wallet/lib" "github.com/harmony-one/harmony/core/types" + "github.com/harmony-one/harmony/internal/wallet/wallet" "github.com/harmony-one/harmony/node" ) @@ -172,7 +172,7 @@ func processImportCommnad() { func processBalancesCommand() { balanceCommand.Parse(os.Args[2:]) - walletNode := lib.CreateWalletNode() + walletNode := wallet.CreateWalletNode() if *balanceAddressPtr == "" { for i, address := range ReadAddresses() { @@ -192,7 +192,7 @@ func processBalancesCommand() { func processGetFreeToken() { freeTokenCommand.Parse(os.Args[2:]) - walletNode := lib.CreateWalletNode() + walletNode := wallet.CreateWalletNode() if *freeTokenAddressPtr == "" { fmt.Println("Error: --address is required") @@ -256,7 +256,7 @@ func processTransferCommand() { // Generate transaction senderPriKey := priKeys[senderIndex] senderAddress := addresses[senderIndex] - walletNode := lib.CreateWalletNode() + walletNode := wallet.CreateWalletNode() shardIDToAccountState := FetchBalance(senderAddress, walletNode) state, ok := shardIDToAccountState[uint32(shardID)] @@ -274,7 +274,7 @@ func processTransferCommand() { amountBigInt := big.NewInt(int64(amount * params.GWei)) amountBigInt = amountBigInt.Mul(amountBigInt, big.NewInt(params.GWei)) tx, _ := types.SignTx(types.NewTransaction(state.nonce, receiverAddress, uint32(shardID), amountBigInt, params.TxGas, nil, nil), types.HomesteadSigner{}, senderPriKey) - lib.SubmitTransaction(tx, walletNode, uint32(shardID)) + wallet.SubmitTransaction(tx, walletNode, uint32(shardID)) } func convertBalanceIntoReadableFormat(balance *big.Int) string { @@ -321,7 +321,7 @@ func convertBalanceIntoReadableFormat(balance *big.Int) string { // TODO add support for non beacon chain shards func FetchBalance(address common.Address, walletNode *node.Node) map[uint32]AccountState { result := make(map[uint32]AccountState) - peers := lib.GetPeersFromBeaconChain(walletNode) + peers := wallet.GetPeersFromBeaconChain(walletNode) if len(peers) == 0 { fmt.Printf("[FATAL] Can't find peers\n") return nil @@ -338,7 +338,7 @@ func FetchBalance(address common.Address, walletNode *node.Node) map[uint32]Acco // GetFreeToken requests for token test token on each shard func GetFreeToken(address common.Address, walletNode *node.Node) { - peers := lib.GetPeersFromBeaconChain(walletNode) + peers := wallet.GetPeersFromBeaconChain(walletNode) if len(peers) == 0 { fmt.Printf("[FATAL] Can't find peers\n") return diff --git a/cmd/client/txgen/txgen/account_txs_generator.go b/internal/txgen/account_txs_generator.go similarity index 100% rename from cmd/client/txgen/txgen/account_txs_generator.go rename to internal/txgen/account_txs_generator.go diff --git a/cmd/client/wallet/lib/lib.go b/internal/wallet/wallet/lib.go similarity index 99% rename from cmd/client/wallet/lib/lib.go rename to internal/wallet/wallet/lib.go index 063334d33..9668a93a3 100644 --- a/cmd/client/wallet/lib/lib.go +++ b/internal/wallet/wallet/lib.go @@ -1,4 +1,4 @@ -package lib +package wallet import ( "fmt" diff --git a/cmd/client/wallet/lib/lib_test.go b/internal/wallet/wallet/lib_test.go similarity index 98% rename from cmd/client/wallet/lib/lib_test.go rename to internal/wallet/wallet/lib_test.go index bf9e21a67..c5877532e 100644 --- a/cmd/client/wallet/lib/lib_test.go +++ b/internal/wallet/wallet/lib_test.go @@ -1,4 +1,4 @@ -package lib +package wallet import ( "testing"