本文整理汇总了Golang中github.com/conseweb/stcd/wire.ShaHash.Bytes方法的典型用法代码示例。如果您正苦于以下问题:Golang ShaHash.Bytes方法的具体用法?Golang ShaHash.Bytes怎么用?Golang ShaHash.Bytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/conseweb/stcd/wire.ShaHash
的用法示例。
在下文中一共展示了ShaHash.Bytes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: assertAddrIndexTipIsUpdated
func assertAddrIndexTipIsUpdated(db database.Db, t *testing.T, newestSha *wire.ShaHash, newestBlockIdx int32) {
// Safe to ignore error, since height will be < 0 in "error" case.
sha, height, _ := db.FetchAddrIndexTip()
if newestBlockIdx != height {
t.Fatalf("Height of address index tip failed to update, "+
"expected %v, got %v", newestBlockIdx, height)
}
if !bytes.Equal(newestSha.Bytes(), sha.Bytes()) {
t.Fatalf("Sha of address index tip failed to update, "+
"expected %v, got %v", newestSha, sha)
}
}
示例2: AddShaHash
// AddShaHash adds the passed wire.ShaHash to the Filter.
//
// This function is safe for concurrent access.
func (bf *Filter) AddShaHash(sha *wire.ShaHash) {
bf.mtx.Lock()
bf.add(sha.Bytes())
bf.mtx.Unlock()
}