bloom9_test.go 600 B

12345678910111213141516171819202122232425262728293031
  1. package chain
  2. /*
  3. import (
  4. "testing"
  5. "github.com/ethereum/go-ethereum/state"
  6. )
  7. func TestBloom9(t *testing.T) {
  8. testCase := []byte("testtest")
  9. bin := LogsBloom([]state.Log{
  10. {testCase, [][]byte{[]byte("hellohello")}, nil},
  11. }).Bytes()
  12. res := BloomLookup(bin, testCase)
  13. if !res {
  14. t.Errorf("Bloom lookup failed")
  15. }
  16. }
  17. func TestAddress(t *testing.T) {
  18. block := &Block{}
  19. block.Coinbase = ethutil.Hex2Bytes("22341ae42d6dd7384bc8584e50419ea3ac75b83f")
  20. fmt.Printf("%x\n", crypto.Sha3(block.Coinbase))
  21. bin := CreateBloom(block)
  22. fmt.Printf("bin = %x\n", ethutil.LeftPadBytes(bin, 64))
  23. }
  24. */