Skip to content

Commit 09000c2

Browse files
committed
wip - PR feedback
1 parent f16ced1 commit 09000c2

File tree

4 files changed

+96
-122
lines changed

4 files changed

+96
-122
lines changed

MIGRATION-NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ A collection of random notes pop up during the migration process.
3636
- ABI
3737
- how to construct ABIStruct from string
3838
- Make sure that the python utils also sort resources during resource population
39+
- migration stratefy for EventType.TxnGroupSimulated in utils-ts-debug

src/transactions/common.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { Address, TransactionSigner } from '@algorandfoundation/sdk'
33
import { encodeLease } from '../transaction'
44
import { TransactionSignerAccount } from '../types/account'
55
import { AlgoAmount } from '../types/amount'
6-
import { FeeDelta } from '../types/fee-coverage'
7-
import { genesisIdIsLocalNet } from '../types/network-client'
6+
import { FeeDelta } from './fee-coverage'
87

98
/** Common parameters for defining a transaction. */
109
export type CommonTransactionParams = {
@@ -69,7 +68,7 @@ export const ensureString = (data?: string | Uint8Array) => {
6968
export const buildTransactionHeader = (
7069
commonParams: CommonTransactionParams,
7170
suggestedParams: SuggestedParams,
72-
defaultValidityWindow: number,
71+
defaultValidityWindow: bigint,
7372
) => {
7473
const firstValid = commonParams.firstValidRound ?? suggestedParams.firstValid
7574
const lease = commonParams.lease === undefined ? undefined : encodeLease(commonParams.lease)
@@ -86,9 +85,7 @@ export const buildTransactionHeader = (
8685
firstValid,
8786
lastValid:
8887
commonParams.lastValidRound ??
89-
(commonParams.validityWindow !== undefined
90-
? firstValid + BigInt(commonParams.validityWindow)
91-
: firstValid + BigInt(defaultValidityWindow)),
88+
(commonParams.validityWindow !== undefined ? firstValid + BigInt(commonParams.validityWindow) : firstValid + defaultValidityWindow),
9289
group: undefined,
9390
} satisfies TransactionHeader
9491
}
@@ -124,12 +121,3 @@ export function calculateInnerFeeDelta(
124121
return currentFeeDelta
125122
}, acc)
126123
}
127-
128-
export function getDefaultValidityWindow(genesisId: string): number {
129-
const isLocalNet = genesisIdIsLocalNet(genesisId)
130-
if (isLocalNet) {
131-
return 1000 // LocalNet gets bigger window to avoid dead transactions
132-
} else {
133-
return 10 // Standard default validity window
134-
}
135-
}
File renamed without changes.

0 commit comments

Comments
 (0)