Skip to content

Commit

Permalink
unit test for infinity G1 points
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed May 24, 2024
1 parent 73fb949 commit 01abf1b
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions chia/_tests/core/full_node/test_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,3 +463,35 @@ async def test_message_conditions(
expected = None

await check_conditions(bt, conditions, expected_err=expected)

@pytest.mark.anyio
@pytest.mark.parametrize(
"opcode",
[
ConditionOpcode.AGG_SIG_PARENT,
ConditionOpcode.AGG_SIG_PUZZLE,
ConditionOpcode.AGG_SIG_AMOUNT,
ConditionOpcode.AGG_SIG_PUZZLE_AMOUNT,
ConditionOpcode.AGG_SIG_PARENT_AMOUNT,
ConditionOpcode.AGG_SIG_PARENT_PUZZLE,
ConditionOpcode.AGG_SIG_UNSAFE,
ConditionOpcode.AGG_SIG_ME,
],
)
async def test_agg_sig_infinity(
self, opcode: ConditionOpcode, bt: BlockTools, consensus_mode: ConsensusMode
) -> None:
conditions = Program.to(
assemble(
f"(({opcode.value[0]} "
"0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
' "foobar"))'
)
)

# infinity is disallowed after soft-fork-5 activates
if consensus_mode >= ConsensusMode.SOFT_FORK_5:
expected_error = Err.INVALID_CONDITION
else:
expected_error = None
await check_conditions(bt, conditions, expected_error)

0 comments on commit 01abf1b

Please sign in to comment.