本文整理汇总了Golang中github.com/btcsuite/btcd/chaincfg/chainhash.Hash.SetBytes方法的典型用法代码示例。如果您正苦于以下问题:Golang Hash.SetBytes方法的具体用法?Golang Hash.SetBytes怎么用?Golang Hash.SetBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/btcsuite/btcd/chaincfg/chainhash.Hash
的用法示例。
在下文中一共展示了Hash.SetBytes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: newDummyCredit
// 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)
}