Skip to content

Commit f57dfc0

Browse files
authored
[CHIA-2911] fix test_db_graftroot after chia_rs update (#19668)
fix `test_db_graftroot` after chia_rs update
1 parent f3ba638 commit f57dfc0

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

chia/_tests/wallet/db_wallet/test_db_graftroot.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,22 +125,21 @@ def filter_none(values: list[bytes32]) -> list[bytes32]:
125125
await sim.rewind(same_height)
126126

127127
# try with a bad merkle root announcement
128+
fake_puzzle_bad_announcement = ACS.curry(
129+
fake_struct, ACS.curry(ACS_PH, (bytes32.zeros, None), None, None)
130+
)
131+
await sim.farm_block(fake_puzzle_bad_announcement.get_tree_hash())
132+
fake_coin_bad_announcement: Coin = (
133+
await sim_client.get_coin_records_by_puzzle_hash(fake_puzzle_bad_announcement.get_tree_hash())
134+
)[0].coin
128135
new_fake_spend = make_spend(
129-
fake_coin,
130-
ACS.curry(fake_struct, ACS.curry(ACS_PH, (bytes32.zeros, None), None, None)),
136+
fake_coin_bad_announcement,
137+
fake_puzzle_bad_announcement,
131138
Program.to([[[62, "$"]]]),
132139
)
133140
new_final_bundle = WalletSpendBundle([new_fake_spend, graftroot_spend], G2Element())
134141
result = await sim_client.push_tx(new_final_bundle)
135-
136-
# TODO: This test probably needs to be updated
137-
# The original version of this test made sure we return the
138-
# following error. Now that puzzle reveal validation was moved
139-
# into chia_rs, this failure will be detected before running
140-
# the puzzle. This test probably needs to be updated
141-
# assert result == (MempoolInclusionStatus.FAILED, Err.ASSERT_ANNOUNCE_CONSUMED_FAILED)
142-
143-
assert result == (MempoolInclusionStatus.FAILED, Err.WRONG_PUZZLE_HASH)
142+
assert result == (MempoolInclusionStatus.FAILED, Err.ASSERT_ANNOUNCE_CONSUMED_FAILED)
144143
else:
145144
assert result == (MempoolInclusionStatus.FAILED, Err.GENERATOR_RUNTIME_ERROR)
146145
with pytest.raises(ValueError, match="clvm raise"):

0 commit comments

Comments
 (0)