Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_rpc_avalancheproof.py
Show First 20 Lines • Show All 251 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
bad_sig = ("0b000000000000000c0000000000000021030b4c866585dd868a9d62348" | bad_sig = ("0b000000000000000c0000000000000021030b4c866585dd868a9d62348" | ||||
"a9cd008d6a312937048fff31670e7e920cfc7a7440105c5f72f5d6da3085" | "a9cd008d6a312937048fff31670e7e920cfc7a7440105c5f72f5d6da3085" | ||||
"583e75ee79340eb4eff208c89988e7ed0efb30b87298fa30000000000f20" | "583e75ee79340eb4eff208c89988e7ed0efb30b87298fa30000000000f20" | ||||
"52a0100000003000000210227d85ba011276cf25b51df6a188b75e604b3" | "52a0100000003000000210227d85ba011276cf25b51df6a188b75e604b3" | ||||
"8770a462b2d0e9fb2fc839ef5d3faf07f001dd38e9b4a43d07d5d449cc0" | "8770a462b2d0e9fb2fc839ef5d3faf07f001dd38e9b4a43d07d5d449cc0" | ||||
"f7d2888d96b82962b3ce516d1083c0e031773487fc3c4f2e38acd1db974" | "f7d2888d96b82962b3ce516d1083c0e031773487fc3c4f2e38acd1db974" | ||||
"1321b91a79b82d1c2cfd47793261e4ba003cf5") | "1321b91a79b82d1c2cfd47793261e4ba003cf5") | ||||
wrong_order = ("c964aa6fde575e4ce8404581c7be874e21023beefdde700a6bc0203" | |||||
"6335b4df141c8bc67bb05a971f5ac2745fd683797dde30305d427b7" | |||||
"06705a5d4b6a368a231d6db62abacf8c29bc32b61e7f65a0a6976aa" | |||||
"8b86b687bc0260e821e4f0200b9d3bf6d2102449fb5237efe8f647d" | |||||
"32e8b64f06c22d1d40368eaca2a71ffc6a13ecc8bce68052365271b" | |||||
"6c71189f5cd7e3b694b77b579080f0b35bae567b96590ab6aa3019b" | |||||
"018ff9f061f52f1426bdb195d4b6d4dff5114cee90e33dabf0c588e" | |||||
"badf7774418f54247f6390791706af36fac782302479898b5273f9e" | |||||
"51a92cb1fb5af43deeb6c8c269403d30ffcb380300134398c42103e" | |||||
"49f9df52de2dea81cf7838b82521b69f2ea360f1c4eed9e6c89b7d0" | |||||
"f9e645efa08e97ea0c60e1f0a064fbf08989c084707082727e85dcb" | |||||
"9f79bb503f76ee6c8dad42a07ef15c89b3750a5631d604b21fafff0" | |||||
"f4de354ade95c2f28160ae549af0d4ce48c4ca9d0714b1fa5192027" | |||||
"0f8575e0af610f07b4e602a018ecdbb649b64fff614c0026e9fc8e0" | |||||
"030092533d422103aac52f4cfca700e7e9824298e0184755112e32f" | |||||
"359c832f5f6ad2ef62a2c024af812d6d7f2ecc6223a774e19bce1fb" | |||||
"20d94d6b01ea693638f55c74fdaa5358fa9239d03e4caf3d817e8f7" | |||||
"48ccad55a27b9d365db06ad5a0b779ac385f3dc8710") | |||||
self.log.info( | self.log.info( | ||||
"Check the verifyavalancheproof and sendavalancheproof RPCs") | "Check the verifyavalancheproof and sendavalancheproof RPCs") | ||||
if self.is_wallet_compiled(): | if self.is_wallet_compiled(): | ||||
self.log.info( | self.log.info( | ||||
"Check a proof with the maximum number of UTXO is valid") | "Check a proof with the maximum number of UTXO is valid") | ||||
new_blocks = node.generate(AVALANCHE_MAX_PROOF_STAKES // 10 + 1) | new_blocks = node.generate(AVALANCHE_MAX_PROOF_STAKES // 10 + 1) | ||||
# confirm the coinbase UTXOs | # confirm the coinbase UTXOs | ||||
Show All 22 Lines | def run_test(self): | ||||
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-signature") | ||||
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, proof_master, stakes) | proof_sequence + 1, proof_expiration, proof_master, 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 144 Lines • Show Last 20 Lines |