@@ -54,33 +54,17 @@ private func estimateTip(provider: StarknetProviderProtocol, blockId: StarknetBl
5454 let request = RequestBuilder . getBlockWithTxs ( blockId)
5555 let blockWithTxs = try await provider. send ( request: request)
5656
57- let tips : [ BigUInt ] = switch blockWithTxs {
58- case let . processed( processedBlockWithTxs) :
59- processedBlockWithTxs. transactions. compactMap { transactionWrapper in
60- switch transactionWrapper {
61- case let . invokeV3( invokeV3) :
62- invokeV3. tip. value
63- case let . deployAccountV3( deployAccountV3) :
64- deployAccountV3. tip. value
65- case let . declareV3( declareV3) :
66- declareV3. tip. value
67- default :
68- nil
69- }
70- }
57+ let transactions : [ TransactionWrapper ] = switch blockWithTxs {
58+ case let . processed( block) : block. transactions
59+ case let . preConfirmed( block) : block. transactions
60+ }
7161
72- case let . preConfirmed( preConfirmedBlockWithTxs) :
73- preConfirmedBlockWithTxs. transactions. compactMap { transactionWrapper in
74- switch transactionWrapper {
75- case let . invokeV3( invokeV3) :
76- invokeV3. tip. value
77- case let . deployAccountV3( deployAccountV3) :
78- deployAccountV3. tip. value
79- case let . declareV3( declareV3) :
80- declareV3. tip. value
81- default :
82- nil
83- }
62+ let tips = transactions. compactMap { transactionWrapper in
63+ switch transactionWrapper {
64+ case let . invokeV3( invokeV3) : invokeV3. tip. value
65+ case let . deployAccountV3( deployAccountV3) : deployAccountV3. tip. value
66+ case let . declareV3( declareV3) : declareV3. tip. value
67+ default : nil
8468 }
8569 }
8670
0 commit comments