Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_rpc_avalancheproof.py
Show First 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
assert_raises_rpc_error(-8, "The supplied private key does not match the delegation", | assert_raises_rpc_error(-8, "The supplied private key does not match the delegation", | ||||
node.delegateavalancheproof, | node.delegateavalancheproof, | ||||
limited_id_hex, | limited_id_hex, | ||||
bytes_to_wif(privkey.get_bytes()), | bytes_to_wif(privkey.get_bytes()), | ||||
random_pubkey, | random_pubkey, | ||||
delegation, | delegation, | ||||
) | ) | ||||
# Delegation not hex | |||||
assert_raises_rpc_error(-22, "Delegation must be an hexadecimal string.", | |||||
node.delegateavalancheproof, | |||||
limited_id_hex, | |||||
bytes_to_wif(privkey.get_bytes()), | |||||
random_pubkey, | |||||
"f00", | |||||
) | |||||
# Delegation is hex but ill-formed | |||||
assert_raises_rpc_error(-22, "Delegation has invalid format", | |||||
node.delegateavalancheproof, | |||||
limited_id_hex, | |||||
bytes_to_wif(privkey.get_bytes()), | |||||
random_pubkey, | |||||
"dead", | |||||
) | |||||
# Test invalid proofs | # Test invalid proofs | ||||
dust = node.buildavalancheproof( | dust = node.buildavalancheproof( | ||||
proof_sequence, proof_expiration, proof_master, | proof_sequence, proof_expiration, proof_master, | ||||
create_coinbase_stakes(node, [blockhashes[0]], addrkey0.key, amount="0")) | create_coinbase_stakes(node, [blockhashes[0]], addrkey0.key, amount="0")) | ||||
dust_amount = Decimal(f"{PROOF_DUST_THRESHOLD * 0.9999:.4f}") | dust_amount = Decimal(f"{PROOF_DUST_THRESHOLD * 0.9999:.4f}") | ||||
dust2 = node.buildavalancheproof( | dust2 = node.buildavalancheproof( | ||||
proof_sequence, proof_expiration, proof_master, | proof_sequence, proof_expiration, proof_master, | ||||
▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines |