Exemple #1
0
def test_update_commit(bls_bft_replicas, fake_pre_prepare_with_bls):
    params = create_commit_params(0, 0)
    params_initial = copy(params)
    for bls_bft_replica in bls_bft_replicas:
        params = bls_bft_replica.update_commit(params,
                                               fake_pre_prepare_with_bls)
        assert params != params_initial
Exemple #2
0
def test_update_commit_with_multiple_sigs(
        bls_bft_replicas, pre_prepare_with_bls,
        create_audit_txn_with_multiple_ledgers):
    params = create_commit_params(0, 0)
    params_initial = copy(params)
    for bls_bft_replica in bls_bft_replicas:
        params_res = bls_bft_replica.update_commit(copy(params),
                                                   pre_prepare_with_bls)
        assert params_res != params_initial
        assert len(params_res) - len(params_initial) == 2
Exemple #3
0
def test_update_commit_without_bls_crypto_signer(bls_bft_replicas,
                                                 fake_pre_prepare_with_bls):
    params = create_commit_params(0, 0)
    params_initial = copy(params)
    for bls_bft_replica in bls_bft_replicas:
        bls_crypto_signer = bls_bft_replica._bls_bft.bls_crypto_signer
        bls_bft_replica._bls_bft.bls_crypto_signer = None
        params = bls_bft_replica.update_commit(params,
                                               fake_pre_prepare_with_bls)
        bls_bft_replica._bls_bft.bls_crypto_signer = bls_crypto_signer
        assert params == params_initial