algorandfoundation / algokit-utils-ts

MIT License
19 stars 8 forks source link

if an AlograndClient connects to algod in devmode don't cache params #273

Open joe-p opened 6 months ago

joe-p commented 6 months ago

Problem

By default the AlgorandClient will cache SuggestedParams. Given the short default validity window this can result in transactions being sent outside the lastValid if multiple transactions are sent within a short period of time.

Solution

If the algod the client is connecting to is in devmode don't cache the suggestedParams

Proposal

When the suggestedParams are retrieved for the first time, also check if the network is in devmode

Pros and Cons

This allows us to keep the suggestedParams in the txns themselves the same while fixing the problem for devmode.

Dependencies

N/A

robdmoore commented 6 months ago

Makes sense to me!