예제 #1
0
def test_broadcast_filter():
    r = Ready(0, LockSet(1))
    r.sign('x' * 32)
    df = hdc_service.DuplicatesFilter()
    assert r not in df
    assert df.update(r)
    assert not df.update(r)
    assert not df.update(r)
    assert r in df
예제 #2
0
def test_broadcast_filter():
    r = Ready(0, LockSet(1))
    r.sign('x' * 32)
    df = hdc_service.DuplicatesFilter()
    assert r not in df
    assert df.update(r)
    assert not df.update(r)
    assert not df.update(r)
    assert r in df
예제 #3
0
def test_ready():
    ls = LockSet(num_eligible_votes=len(privkeys))
    s = Ready(0, current_lockset=ls)
    assert s.current_lockset == ls
    s.sign(privkey)
    s0 = Ready(0, current_lockset=ls)
    s0.sign(privkey)
    s1 = Ready(1, current_lockset=ls)
    s1.sign(privkey)

    assert s == s0
    assert s != s1
예제 #4
0
def test_ready():
    ls = LockSet(num_eligible_votes=len(privkeys))
    s = Ready(0, current_lockset=ls)
    assert s.current_lockset == ls
    s.sign(privkey)
    s0 = Ready(0, current_lockset=ls)
    s0.sign(privkey)
    s1 = Ready(1, current_lockset=ls)
    s1.sign(privkey)

    assert s == s0
    assert s != s1