func getTopUpUnspent(t *testing.T, client *AttestClient, config *confpkg.Config, topupHash chainhash.Hash) btcjson.ListUnspentResult {
	success, unspent, errUnspent := client.findTopupUnspent()
	assert.Equal(t, true, success)
	assert.Equal(t, nil, errUnspent)
	assert.Equal(t, config.TopupAddress(), unspent.Address)
	assert.Equal(t, topupHash.String(), unspent.TxID)
	return unspent
}
Verify and get topup unspent transaction
package attestation
import (
	"encoding/hex"
	"errors"
	"math"
	"testing"
	"mainstay/clients"
	confpkg "mainstay/config"
	"mainstay/crypto"
	"mainstay/models"
	testpkg "mainstay/test"
	"github.com/btcsuite/btcd/btcjson"
	"github.com/btcsuite/btcd/chaincfg/chainhash"
	"github.com/btcsuite/btcd/wire"
	"github.com/btcsuite/btcutil"
	"github.com/stretchr/testify/assert"
)
const topupLevel = 3  
const iterNum = 5     
func createTopupUnspent(t *testing.T, config *confpkg.Config) chainhash.Hash {
	topupAddr, topupAddrErr := btcutil.DecodeAddress(config.TopupAddress(), config.MainChainCfg())
	assert.Equal(t, nil, topupAddrErr)
	topupTxHash, topupTxErr := config.MainClient().SendToAddress(topupAddr, 50*Coin)
	assert.Equal(t, nil, topupTxErr)
	return *topupTxHash
}