@ -12,15 +12,17 @@ import (
"time"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/harmony-one/harmony/accounts"
"github.com/harmony-one/harmony/accounts/keystore"
"github.com/harmony-one/harmony/api/client"
"github.com/harmony-one/harmony/api/client"
clientService "github.com/harmony-one/harmony/api/client/service"
clientService "github.com/harmony-one/harmony/api/client/service"
proto_node "github.com/harmony-one/harmony/api/proto/node"
proto_node "github.com/harmony-one/harmony/api/proto/node"
"github.com/harmony-one/harmony/common/denominations"
"github.com/harmony-one/harmony/common/denominations"
"github.com/harmony-one/harmony/core"
"github.com/harmony-one/harmony/core"
"github.com/harmony-one/harmony/core/types"
"github.com/harmony-one/harmony/core/types"
common2 "github.com/harmony-one/harmony/internal/common"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
"github.com/harmony-one/harmony/internal/ctxerror"
"github.com/harmony-one/harmony/internal/ctxerror"
"github.com/harmony-one/harmony/internal/shardchain"
"github.com/harmony-one/harmony/internal/shardchain"
@ -29,9 +31,6 @@ import (
"github.com/harmony-one/harmony/p2p"
"github.com/harmony-one/harmony/p2p"
p2p_host "github.com/harmony-one/harmony/p2p/host"
p2p_host "github.com/harmony-one/harmony/p2p/host"
"github.com/harmony-one/harmony/p2p/p2pimpl"
"github.com/harmony-one/harmony/p2p/p2pimpl"
"github.com/harmony-one/harmony/accounts"
"github.com/harmony-one/harmony/accounts/keystore"
)
)
var (
var (
@ -380,7 +379,7 @@ func processBalancesCommand() {
}
}
}
}
} else {
} else {
address := common . HexToAddress ( * balanceAddressPtr )
address := common2 . ParseAddr ( * balanceAddressPtr )
fmt . Printf ( "Account: %s:\n" , address . Hex ( ) )
fmt . Printf ( "Account: %s:\n" , address . Hex ( ) )
for shardID , balanceNonce := range FetchBalance ( address ) {
for shardID , balanceNonce := range FetchBalance ( address ) {
fmt . Printf ( " Balance in Shard %d: %s, nonce: %v \n" , shardID , convertBalanceIntoReadableFormat ( balanceNonce . balance ) , balanceNonce . nonce )
fmt . Printf ( " Balance in Shard %d: %s, nonce: %v \n" , shardID , convertBalanceIntoReadableFormat ( balanceNonce . balance ) , balanceNonce . nonce )
@ -397,7 +396,7 @@ func processGetFreeToken() {
if * freeTokenAddressPtr == "" {
if * freeTokenAddressPtr == "" {
fmt . Println ( "Error: --address is required" )
fmt . Println ( "Error: --address is required" )
} else {
} else {
address := common . HexToAddress ( * freeTokenAddressPtr )
address := common2 . ParseAddr ( * freeTokenAddressPtr )
GetFreeToken ( address )
GetFreeToken ( address )
}
}
}
}
@ -430,13 +429,13 @@ func processTransferCommand() {
return
return
}
}
receiverAddress := common . HexToAddress ( receiver )
receiverAddress := common2 . ParseAddr ( receiver )
if len ( receiverAddress ) != 20 {
if len ( receiverAddress ) != 20 {
fmt . Println ( "The receiver address is not valid." )
fmt . Println ( "The receiver address is not valid." )
return
return
}
}
senderAddress := common . HexToAddress ( sender )
senderAddress := common2 . ParseAddr ( sender )
if len ( senderAddress ) != 20 {
if len ( senderAddress ) != 20 {
fmt . Println ( "The sender address is not valid." )
fmt . Println ( "The sender address is not valid." )
return
return