Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_rpc_avalancheproof.py
Show First 20 Lines • Show All 319 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
def check_rpc_failure(proof, message): | def check_rpc_failure(proof, message): | ||||
assert_raises_rpc_error(-8, "The proof is invalid: " + message, | assert_raises_rpc_error(-8, "The proof is invalid: " + message, | ||||
rpc, proof) | rpc, proof) | ||||
check_rpc_failure(no_stake, "no-stake") | check_rpc_failure(no_stake, "no-stake") | ||||
check_rpc_failure(dust, "amount-below-dust-threshold") | check_rpc_failure(dust, "amount-below-dust-threshold") | ||||
check_rpc_failure(duplicate_stake, "duplicated-stake") | check_rpc_failure(duplicate_stake, "duplicated-stake") | ||||
check_rpc_failure(missing_stake, "utxo-missing-or-spent") | check_rpc_failure(missing_stake, "utxo-missing-or-spent") | ||||
check_rpc_failure(bad_sig, "invalid-signature") | check_rpc_failure(bad_sig, "invalid-stake-signature") | ||||
check_rpc_failure(wrong_order, "wrong-stake-ordering") | check_rpc_failure(wrong_order, "wrong-stake-ordering") | ||||
if self.is_wallet_compiled(): | if self.is_wallet_compiled(): | ||||
check_rpc_failure(too_many_utxos, "too-many-utxos") | check_rpc_failure(too_many_utxos, "too-many-utxos") | ||||
conflicting_utxo = node.buildavalancheproof( | conflicting_utxo = node.buildavalancheproof( | ||||
proof_sequence + 1, proof_expiration, wif_privkey, stakes) | proof_sequence + 1, proof_expiration, wif_privkey, stakes) | ||||
assert_raises_rpc_error(-8, "The proof has conflicting utxo with an existing proof", | assert_raises_rpc_error(-8, "The proof has conflicting utxo with an existing proof", | ||||
node.sendavalancheproof, conflicting_utxo) | node.sendavalancheproof, conflicting_utxo) | ||||
▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines |