quorum/core/types/common.go

27 lines
381 B
Go
Raw Normal View History

package types
2015-02-04 15:05:47 -08:00
import "math/big"
type BlockProcessor interface {
2015-02-04 15:05:47 -08:00
Process(*Block) (*big.Int, error)
}
2015-03-16 09:27:23 -07:00
type Bloom [256]byte
func BytesToBloom(b []byte) Bloom {
var bloom Bloom
bloom.SetBytes(b)
return bloom
}
func (b *Bloom) SetBytes(d []byte) {
if len(b) > len(d) {
panic("bloom bytes too big")
}
// reverse loop
for i := len(d) - 1; i >= 0; i-- {
b[i] = b[i]
}
}