Skip to content

CHIA-3107 Simplify test_basic_coin_store #19709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AmineKhaldi
Copy link
Contributor

@AmineKhaldi AmineKhaldi commented Jun 12, 2025

Purpose:

Simplify test_basic_coin_store by skipping non transaction blocks where appropriate, leveraging additions_and_removals instead of the combination of get_name_puzzle_conditions and tx_removals_and_additions, and avoiding to recompute reward coins.

Current Behavior:

New Behavior:

Testing Notes:

@AmineKhaldi AmineKhaldi self-assigned this Jun 12, 2025
@AmineKhaldi AmineKhaldi added the Changed Required label for PR that categorizes merge commit message as "Changed" for changelog label Jun 12, 2025
block.get_included_reward_coins(),
tx_additions,
tx_removals,
block.height, block.foliage_transaction_block.timestamp, reward_coins, tx_additions, tx_removals
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a formatting change, right?
I think the existing formatting is preferred. I don't think this is a simplification. Is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm changing this call to avoid recomputing reward_coins.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
block.height, block.foliage_transaction_block.timestamp, reward_coins, tx_additions, tx_removals
block.height,
block.foliage_transaction_block.timestamp,
reward_coins,
tx_additions,
tx_removals,

assert block.foliage_transaction_block is not None
assert block.foliage_transaction_block is not None
await coin_store.new_block(
block.height, block.foliage_transaction_block.timestamp, reward_coins, tx_additions, tx_removals
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a formatting change, right?I think the existing formatting is preferred.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm changing this call to avoid recomputing reward_coins.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, the reward_coins parameter. It's harder to spot when you change formatting at the same time

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
block.height, block.foliage_transaction_block.timestamp, reward_coins, tx_additions, tx_removals
block.height,
block.foliage_transaction_block.timestamp,
reward_coins,
tx_additions,
tx_removals,

@AmineKhaldi AmineKhaldi force-pushed the simplify_test_basic_coin_store branch from 2bab407 to bf31fea Compare June 12, 2025 13:55
@AmineKhaldi AmineKhaldi marked this pull request as ready for review June 12, 2025 16:25
@AmineKhaldi AmineKhaldi requested a review from a team as a code owner June 12, 2025 16:25
@AmineKhaldi AmineKhaldi force-pushed the simplify_test_basic_coin_store branch from bf31fea to 442c81d Compare June 13, 2025 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changed Required label for PR that categorizes merge commit message as "Changed" for changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants