コード例 #1
0
def test_validate_commit_incorrect_sig_pool(bls_bft_replicas, pre_prepare_with_bls_pool_ledger):
    key = (0, 0)
    for sender_bls_bft in bls_bft_replicas:
        fake_sig = base58.b58encode(b"somefakesignaturesomefakesignaturesomefakesignature").decode("utf-8")
        commit = create_commit_with_bls_sig(key, fake_sig)
        for verifier_bls_bft in bls_bft_replicas:
            status = verifier_bls_bft.validate_commit(commit,
                                                      sender_bls_bft.node_id,
                                                      pre_prepare_with_bls_pool_ledger)
            assert status == BlsBftReplica.CM_BLS_SIG_WRONG
コード例 #2
0
def test_validate_commit_incorrect_sig(bls_bft_replicas, pre_prepare_with_bls):
    key = (0, 0)
    for sender_bls_bft in bls_bft_replicas:
        fake_sig = base58.b58encode(
            b"somefakesignaturesomefakesignaturesomefakesignature")
        commit = create_commit_with_bls_sig(key, fake_sig)
        for verifier_bls_bft in bls_bft_replicas:
            status = verifier_bls_bft.validate_commit(commit,
                                                      sender_bls_bft.node_id,
                                                      pre_prepare_with_bls)
            assert status == BlsBftReplica.CM_BLS_SIG_WRONG