Skip to content

Commit 8081978

Browse files
committed
Rename latestBlockHeader to referenceBlock to avoid misconceptions
1 parent 5b76505 commit 8081978

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

services/requester/batch_tx_pool.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func (t *BatchTxPool) processPooledTransactions(ctx context.Context) {
202202

203203
func (t *BatchTxPool) batchSubmitTransactionsForSameAddress(
204204
ctx context.Context,
205-
latestBlockHeader *flow.BlockHeader,
205+
referenceBlockHeader *flow.BlockHeader,
206206
account *flow.Account,
207207
pooledTxs []pooledEvmTx,
208208
) error {
@@ -224,7 +224,7 @@ func (t *BatchTxPool) batchSubmitTransactionsForSameAddress(
224224

225225
script := replaceAddresses(runTxScript, t.config.FlowNetworkID)
226226
flowTx, err := t.buildTransaction(
227-
latestBlockHeader,
227+
referenceBlockHeader,
228228
account,
229229
script,
230230
cadence.NewArray(hexEncodedTxs),

services/requester/single_tx_pool.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func (t *SingleTxPool) Add(
173173
// buildTransaction creates a Cadence transaction from the provided script,
174174
// with the given arguments and signs it with the configured COA account.
175175
func (t *SingleTxPool) buildTransaction(
176-
latestBlockHeader *flow.BlockHeader,
176+
referenceBlockHeader *flow.BlockHeader,
177177
account *flow.Account,
178178
script []byte,
179179
args ...cadence.Value,
@@ -184,7 +184,7 @@ func (t *SingleTxPool) buildTransaction(
184184

185185
flowTx := flow.NewTransaction().
186186
SetScript(script).
187-
SetReferenceBlockID(latestBlockHeader.ID).
187+
SetReferenceBlockID(referenceBlockHeader.ID).
188188
SetComputeLimit(flowGo.DefaultMaxTransactionGasLimit)
189189

190190
for _, arg := range args {
@@ -209,7 +209,7 @@ func (t *SingleTxPool) buildTransaction(
209209
}
210210

211211
// now that the transaction is prepared, store the transaction's metadata
212-
accKey.SetLockMetadata(flowTx.ID(), latestBlockHeader.Height)
212+
accKey.SetLockMetadata(flowTx.ID(), referenceBlockHeader.Height)
213213

214214
t.collector.OperatorBalance(account)
215215

0 commit comments

Comments
 (0)