func (ht *hostTester) initWallet() error {
	key := crypto.GenerateTwofishKey()
	ht.walletKey = key
	_, err := ht.wallet.Encrypt(key)
	if err != nil {
		return err
	}
	err = ht.wallet.Unlock(key)
	if err != nil {
		return err
	}
	return nil
}
/*
initRenting prepares the host tester for uploads and downloads by announcing
the host to the network and performing other preparational tasks.
initRenting takes a while because the renter needs to process the host
announcement, requiring asynchronous network communication between the
renter and host.
func (ht *hostTester) initRenting() error {
if ht.renting {
return nil
}

Because the renting test takes a long time, it will fail if
testing.Short.
if testing.Short() {
return errors.New("cannot call initRenting in short tests")
}

Announce the host.
err := ht.host.Announce()
if err != nil {
return err
}

Mine a block to get the announcement into the blockchain.
_, err = ht.miner.AddBlock()
if err != nil {
return err
}

Wait for the renter to see the host announcement.
for i := 0; i < 50; i++ {
time.Sleep(time.Millisecond * 100)
if len(ht.renter.ActiveHosts()) != 0 {
break
}
}
if len(ht.renter.ActiveHosts()) == 0 {
return errors.New("could not start renting in the host tester")
}
ht.renting = true
return nil
}

initWallet creates a wallet key, initializes the host wallet, unlocks it,
and then stores the key in the host tester.
package host
import (
	"os"
	"path/filepath"
	"testing"
	"github.com/NebulousLabs/Sia/build"
	"github.com/NebulousLabs/Sia/crypto"
	"github.com/NebulousLabs/Sia/modules"
	"github.com/NebulousLabs/Sia/modules/consensus"
	"github.com/NebulousLabs/Sia/modules/gateway"
	"github.com/NebulousLabs/Sia/modules/miner"
	"github.com/NebulousLabs/Sia/modules/transactionpool"
	"github.com/NebulousLabs/Sia/modules/wallet"
	siasync "github.com/NebulousLabs/Sia/sync"
	"github.com/NebulousLabs/Sia/types"
)
type hostTester struct {
	cs      modules.ConsensusSet
	gateway modules.Gateway
	miner   modules.TestMiner
	renting   bool
	tpool     modules.TransactionPool
	wallet    modules.Wallet
	walletKey crypto.TwofishKey
	host *Host
	persistDir string
}