@@ -79,14 +79,23 @@ public struct CodableTransaction {
7979 }
8080
8181 /// the price per gas unit for the tranaction (Legacy and EIP-2930 only)
82- public internal ( set) var gasPrice : BigUInt ?
82+ public internal ( set) var gasPrice : BigUInt ? {
83+ get { return envelope. gasPrice }
84+ set { return envelope. gasPrice = newValue }
85+ }
8386
8487 /// the max base fee per gas unit (EIP-1559 only)
8588 /// this value must be >= baseFee + maxPriorityFeePerGas
86- public internal ( set) var maxFeePerGas : BigUInt ?
89+ public internal ( set) var maxFeePerGas : BigUInt ? {
90+ get { return envelope. maxFeePerGas }
91+ set { return envelope. maxFeePerGas = newValue }
92+ }
8793
8894 /// the maximum tip to pay the miner (EIP-1559 only)
89- public internal ( set) var maxPriorityFeePerGas : BigUInt ?
95+ public internal ( set) var maxPriorityFeePerGas : BigUInt ? {
96+ get { return envelope. maxPriorityFeePerGas }
97+ set { return envelope. maxPriorityFeePerGas = newValue }
98+ }
9099
91100 public var callOnBlock : BlockNumber ?
92101
@@ -317,7 +326,7 @@ extension CodableTransaction {
317326 let oracle = Oracle ( provider)
318327 switch gasPricePolicy {
319328 case . automatic, . withMargin:
320- return await oracle. gasPriceLegacyPercentiles ( ) . max ( ) !
329+ return await oracle. gasPriceLegacyPercentiles ( ) . max ( ) ?? 0
321330 case . manual( let value) :
322331 return value
323332 }
@@ -344,7 +353,7 @@ extension CodableTransaction {
344353 let oracle = Oracle ( provider)
345354 switch maxFeePerGasPolicy {
346355 case . automatic:
347- return await oracle. baseFeePercentiles ( ) . max ( ) !
356+ return await oracle. baseFeePercentiles ( ) . max ( ) ?? 0
348357 case . manual( let value) :
349358 return value
350359 }
@@ -354,7 +363,7 @@ extension CodableTransaction {
354363 let oracle = Oracle ( provider)
355364 switch maxPriorityFeePerGasPolicy {
356365 case . automatic:
357- return await oracle. tipFeePercentiles ( ) . max ( ) !
366+ return await oracle. tipFeePercentiles ( ) . max ( ) ?? 0
358367 case . manual( let value) :
359368 return value
360369 }
@@ -395,9 +404,6 @@ extension CodableTransaction {
395404 accessList: [ AccessListEntry ] ? = nil , v: BigUInt = 1 , r: BigUInt = 0 , s: BigUInt = 0 ) {
396405 // FIXME: This is duplication and should be fixed.
397406 self . data = data
398- self . gasPrice = gasPrice
399- self . maxFeePerGas = maxFeePerGas
400- self . maxPriorityFeePerGas = maxPriorityFeePerGas
401407 self . accessList = accessList
402408 self . gasLimitPolicy = . automatic
403409 self . noncePolicy = . pending
0 commit comments