Skip to content
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

feat: add expiration transaction policy #1583

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

hal3e
Copy link
Contributor

@hal3e hal3e commented Jan 21, 2025

closes: #1577

Release notes

Added the expiration transaction policy. Now the user can limit until which block height the transaction is valid.

Breaking Changes

  • added expiration: Option<u64> field to TxPolicies struct
  • Transaction trait method maturity now returns Option<u64>
  • Transaction trait method with_maturity is removed.

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

@hal3e hal3e added the enhancement New feature or request label Jan 21, 2025
@hal3e hal3e self-assigned this Jan 21, 2025
digorithm
digorithm previously approved these changes Jan 23, 2025
Copy link
Member

@digorithm digorithm left a comment

Choose a reason for hiding this comment

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

Neat -- great tests!

MujkicA
MujkicA previously approved these changes Jan 24, 2025
Copy link
Contributor

@MujkicA MujkicA left a comment

Choose a reason for hiding this comment

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

Left a remark about our general approach to testing.
PR looks good :shipit:

e2e/tests/predicates.rs Show resolved Hide resolved
@hal3e hal3e dismissed stale reviews from MujkicA and digorithm via 967e20b January 27, 2025 09:46
@hal3e hal3e requested review from digorithm and MujkicA January 27, 2025 09:47
.calling_this_will_produce_a_block()
.with_tx_policies(TxPolicies::default().with_maturity(maturity))
};
let wallet = launch_provider_and_get_wallet().await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why move away from setup_program_test?

@@ -1000,6 +1000,7 @@ async fn tx_id_not_changed_after_adding_witnesses() -> Result<()> {
tx.append_witness(witness2.into())?;
let tx_id_after_witnesses = tx.id(chain_id);

provider.produce_blocks(20, None).await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the manual block generation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

leftover from some debugging.

@hal3e hal3e requested a review from segfault-magnet February 3, 2025 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support new policies: Expiration and Owner
5 participants