// newDummyCredit creates a new credit with the given hash and outpointIdx, // locked to the votingpool address identified by the given // series/index/branch. func newDummyCredit(t *testing.T, pool *Pool, series uint32, index Index, branch Branch, txHash []byte, outpointIdx uint32) credit { var hash chainhash.Hash if err := hash.SetBytes(txHash); err != nil { t.Fatal(err) } // Ensure the address defined by the given series/branch/index is present on // the set of used addresses as that's a requirement of WithdrawalAddress. TstEnsureUsedAddr(t, pool, series, branch, index) addr := TstNewWithdrawalAddress(t, pool, series, branch, index) c := wtxmgr.Credit{ OutPoint: wire.OutPoint{ Hash: hash, Index: outpointIdx, }, } return newCredit(c, *addr) }