Skip to content

Commit 11cd4a8

Browse files
committed
removed default init implementation in AbstractEnvelope as it is not needed
1 parent 969aaa7 commit 11cd4a8

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

Sources/web3swift/Transaction/AbstractEnvelope.swift

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,20 @@ public protocol AbstractEnvelope: CustomStringConvertible { // possibly add Coda
110110

111111
// pseudo memberwise initializer
112112
// accepts all common parameters (full description with default implementation below)
113+
// Note the `nil` parameters, even though non-optional in the struct, are there to allow
114+
// fallback to pulling the value from `options`. If options also does not have a value, a suitable default is used
115+
// precedence is as follows: direct parameter > options value > default value
116+
/// Default memberwse initializer that all envelopes must support
117+
/// - Parameters:
118+
/// - to: EthereumAddress of destination
119+
/// - nonce: nonce for the transaction
120+
/// - chainID: chainId of the network the transaction belongs to
121+
/// - value: Native value in Wei of the transaction
122+
/// - data: Payload data for the transaction
123+
/// - v: Signature V component
124+
/// - r: Signature R component
125+
/// - s: Signature S component
126+
/// - options: TransactionOptions struct containing any other required parameters
113127
init(to: EthereumAddress, nonce: BigUInt?, chainID: BigUInt?, value: BigUInt?,
114128
data: Data, v: BigUInt, r: BigUInt, s: BigUInt, options: TransactionOptions?)
115129

@@ -149,29 +163,6 @@ public protocol AbstractEnvelope: CustomStringConvertible { // possibly add Coda
149163

150164
public extension AbstractEnvelope {
151165

152-
// MARK: default implementation, should be overridden by each Envelope implementation
153-
// Note the `nil` parameters, even though non-optional in the struct, are there to allow
154-
// fallback to pulling the value from `options`. If options also does not have a value, a suitable default is used
155-
// precedence is as follows: direct parameter > options value > default value
156-
/// Default memberwse initializer that all envelopes must support
157-
/// - Parameters:
158-
/// - to: EthereumAddress of destination
159-
/// - nonce: nonce for the transaction
160-
/// - chainID: chainId of the network the transaction belongs to
161-
/// - value: Native value in Wei of the transaction
162-
/// - data: Payload data for the transaction
163-
/// - v: Signature V component
164-
/// - r: Signature R component
165-
/// - s: Signature S component
166-
/// - options: TransactionOptions struct containing any other required parameters
167-
init(to: EthereumAddress, nonce: BigUInt? = nil,
168-
chainID: BigUInt? = nil, value: BigUInt? = nil, data: Data,
169-
v: BigUInt = 1, r: BigUInt = 0, s: BigUInt = 0,
170-
options: TransactionOptions? = nil) {
171-
self.init(to: to, nonce: nonce, chainID: chainID, value: value,
172-
data: data, v: v, r: r, s: s, options: options)
173-
}
174-
175166
mutating func clearSignatureData() {
176167
self.v = 1
177168
self.r = 0

0 commit comments

Comments
 (0)