@@ -60,7 +60,10 @@ internal protocol Execute {
6060 ///
6161 /// A created request is cached per node until any request returns
6262 /// `TransactionExpired`; in which case, the request cache is cleared.
63- func makeRequest( _ client: Client , _ transactionId: TransactionId ? , _ nodeAccountId: AccountId ) throws -> (
63+ func makeRequest(
64+ _ ledgerId: LedgerId ? , _ mirrorNodeNetworks: [ String ] , _ transactionId: TransactionId ? ,
65+ _ nodeAccountId: AccountId
66+ ) throws -> (
6467 GrpcRequest , Context
6568 )
6669
@@ -97,7 +100,8 @@ private struct ExecuteContext {
97100 fileprivate let network : Network
98101 fileprivate let backoffConfig : LegacyExponentialBackoff
99102 fileprivate let maxAttempts : Int
100- fileprivate let client : Client
103+ fileprivate let ledgerId : LedgerId ?
104+ fileprivate let mirrorNodeNetworks : [ String ]
101105 // timeout for a single grpc request.
102106 fileprivate let grpcTimeout : Duration ?
103107}
@@ -153,7 +157,8 @@ internal func executeAny<E: Execute & ValidateChecksums>(
153157 network: client. net,
154158 backoffConfig: backoffBuilder,
155159 maxAttempts: backoff. maxAttempts,
156- client: client,
160+ ledgerId: client. ledgerId,
161+ mirrorNodeNetworks: client. mirrorNetwork,
157162 grpcTimeout: nil
158163 ) ,
159164 executable: executable)
@@ -189,7 +194,8 @@ private func executeAnyInner<E: Execute>(
189194 }
190195
191196 let ( nodeAccountId, channel) = ctx. network. channel ( for: nodeIndex)
192- let ( request, context) = try executable. makeRequest ( ctx. client, transactionId, nodeAccountId)
197+ let ( request, context) = try executable. makeRequest (
198+ ctx. ledgerId, ctx. mirrorNodeNetworks, transactionId, nodeAccountId)
193199 let response : E . GrpcResponse
194200
195201 do {
@@ -313,7 +319,8 @@ private struct NodeIndexesGeneratorMap: AsyncSequence, AsyncIteratorProtocol {
313319 network: ctx. network,
314320 backoffConfig: ctx. backoffConfig,
315321 maxAttempts: ctx. maxAttempts,
316- client: ctx. client,
322+ ledgerId: ctx. ledgerId,
323+ mirrorNodeNetworks: ctx. mirrorNodeNetworks,
317324 grpcTimeout: ctx. grpcTimeout
318325 ) ,
319326 executable: request
0 commit comments