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: first/last valid on SendTransactionParams #292

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

joe-p
Copy link
Contributor

@joe-p joe-p commented Jun 21, 2024

Proposed Changes

Simply adds first and last valid to SendTransactionParams

@@ -194,6 +194,9 @@ export const sendTransaction = async function (
const { transaction, from, sendParams } = send
const { skipSending, skipWaiting, fee, maxFee, suppressLog, maxRoundsToWaitForConfirmation, atc } = sendParams ?? {}

if (sendParams?.firstValid) transaction.firstRound = sendParams.firstValid
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also add it to sendAtomicTransactionComposer, from memory it's a different code path, but a bit hazy on it.

Also, we should add this to the legacyTransactionBridge in #287

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well we can't really add it to sendAtomicTransactionComposer because it's a transaction-specific field. Setting it on sendAtomicTransactionComposer would basically force us to update ALL the transactions with the specified lv/fv which we might not want.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that makes sense, I think I'm just getting confused about the code paths

Comment on lines 46 to 49
/** The first round this transaction will be valid */
firstValid?: number
/** The last round this transaction will be valid */
lastValid?: number
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we indicate these are optional and by default are populated based on getSuggestedParams?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah good point. Let me know what you think of 623edb0

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good, noting most methods also allow you to pass in suggested params as an override to avoid the algod call, but maybe that detail doesn't matter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants