Fix tx Id format for wallet

pull/166/head
Rongjian Lan 6 years ago
parent 3e22cbacc5
commit 19e179fa44
  1. 7
      client/wallet/main.go

@ -287,7 +287,7 @@ func SubmitTransaction(tx *types.Transaction, walletNode *node.Node, shardID uin
msg := proto_node.ConstructTransactionListMessageAccount(types.Transactions{tx})
leader := (*walletNode.Client.Leaders)[shardID]
walletNode.SendMessage(leader, msg)
fmt.Printf("Transaction Id for shard %d: %s\n", int(shardID), common.BytesToAddress(tx.Hash().Bytes()).Hex())
fmt.Printf("Transaction Id for shard %d: %s\n", int(shardID), tx.Hash().Hex())
time.Sleep(300 * time.Millisecond)
return nil
}
@ -313,7 +313,10 @@ func GetFreeToken(address common.Address, walletNode *node.Node) {
port, _ := strconv.Atoi(leader.Port)
client := client2.NewClient(leader.IP, strconv.Itoa(port+node.ClientServicePortDiff))
response := client.GetFreeToken(address)
fmt.Printf("Transaction Id requesting free token in shard %d: %s\n", int(shardID), common.BytesToAddress(response.TxId).Hex())
txId := common.Hash{}
txId.SetBytes(response.TxId)
fmt.Printf("Transaction Id requesting free token in shard %d: %s\n", int(shardID), txId.Hex())
}
}

Loading…
Cancel
Save