@@ -56,9 +56,10 @@ public struct CodableTransaction {
56
56
set { envelope. value = newValue }
57
57
}
58
58
59
- // MARK: - Ruins signing and decoding tests if tied to envelop
60
- /// any additional data for the transaction
61
- public var data : Data
59
+ public var data : Data {
60
+ get { return envelope. data }
61
+ set { envelope. data = newValue }
62
+ }
62
63
63
64
// MARK: - Properties transaction type related either sends to a node if exist
64
65
@@ -174,8 +175,6 @@ public struct CodableTransaction {
174
175
public init ? ( rawValue: Data ) {
175
176
guard let env = EnvelopeFactory . createEnvelope ( rawValue: rawValue) else { return nil }
176
177
self . envelope = env
177
- // FIXME: This is duplication and should be fixed.
178
- data = Data ( )
179
178
noncePolicy = . latest
180
179
gasLimitPolicy = . automatic
181
180
gasPricePolicy = . automatic
@@ -233,9 +232,6 @@ extension CodableTransaction: Codable {
233
232
public init ( from decoder: Decoder ) throws {
234
233
guard let env = try EnvelopeFactory . createEnvelope ( from: decoder) else { throw Web3Error . dataError }
235
234
self . envelope = env
236
- // FIXME: This is duplication and should be fixed.
237
- data = Data ( )
238
-
239
235
noncePolicy = . latest
240
236
gasLimitPolicy = . automatic
241
237
gasPricePolicy = . automatic
@@ -420,8 +416,6 @@ extension CodableTransaction {
420
416
chainID: BigUInt = 0 , value: BigUInt = 0 , data: Data = Data ( ) ,
421
417
gasLimit: BigUInt = 0 , maxFeePerGas: BigUInt ? = nil , maxPriorityFeePerGas: BigUInt ? = nil , gasPrice: BigUInt ? = nil ,
422
418
accessList: [ AccessListEntry ] ? = nil , v: BigUInt = 1 , r: BigUInt = 0 , s: BigUInt = 0 ) {
423
- // FIXME: This is duplication and should be fixed.
424
- self . data = data
425
419
self . accessList = accessList
426
420
self . gasLimitPolicy = . automatic
427
421
self . noncePolicy = . pending
0 commit comments