|
|
@ -51,8 +51,8 @@ class TransactionConfigurator { |
|
|
|
self.transaction = transaction |
|
|
|
self.transaction = transaction |
|
|
|
|
|
|
|
|
|
|
|
self.configuration = TransactionConfiguration( |
|
|
|
self.configuration = TransactionConfiguration( |
|
|
|
gasPrice: min(max(transaction.gasPrice ?? GasPriceConfiguration.default, GasPriceConfiguration.min), GasPriceConfiguration.limit), |
|
|
|
gasPrice: min(max(transaction.gasPrice ?? GasPriceConfiguration.default, GasPriceConfiguration.min), GasPriceConfiguration.maxGas), |
|
|
|
gasLimit: transaction.gasLimit ?? GasPriceConfiguration.limit, |
|
|
|
gasLimit: transaction.gasLimit ?? GasPriceConfiguration.maxGas, |
|
|
|
data: transaction.data ?? Data() |
|
|
|
data: transaction.data ?? Data() |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
@ -106,7 +106,7 @@ class TransactionConfigurator { |
|
|
|
estimateGasLimit() |
|
|
|
estimateGasLimit() |
|
|
|
configuration = TransactionConfiguration( |
|
|
|
configuration = TransactionConfiguration( |
|
|
|
gasPrice: calculatedGasPrice, |
|
|
|
gasPrice: calculatedGasPrice, |
|
|
|
gasLimit: GasPriceConfiguration.limit, |
|
|
|
gasLimit: GasPriceConfiguration.maxGas, |
|
|
|
data: transaction.data ?? configuration.data |
|
|
|
data: transaction.data ?? configuration.data |
|
|
|
) |
|
|
|
) |
|
|
|
completion(.success(())) |
|
|
|
completion(.success(())) |
|
|
@ -117,7 +117,7 @@ class TransactionConfigurator { |
|
|
|
let data = Data(hex: res.drop0x) |
|
|
|
let data = Data(hex: res.drop0x) |
|
|
|
self.configuration = TransactionConfiguration( |
|
|
|
self.configuration = TransactionConfiguration( |
|
|
|
gasPrice: self.calculatedGasPrice, |
|
|
|
gasPrice: self.calculatedGasPrice, |
|
|
|
gasLimit: GasPriceConfiguration.limit, |
|
|
|
gasLimit: GasPriceConfiguration.maxGas, |
|
|
|
data: data |
|
|
|
data: data |
|
|
|
) |
|
|
|
) |
|
|
|
completion(.success(())) |
|
|
|
completion(.success(())) |
|
|
@ -137,7 +137,7 @@ class TransactionConfigurator { |
|
|
|
let data = Data(hex: res.drop0x) |
|
|
|
let data = Data(hex: res.drop0x) |
|
|
|
self.configuration = TransactionConfiguration( |
|
|
|
self.configuration = TransactionConfiguration( |
|
|
|
gasPrice: self.calculatedGasPrice, |
|
|
|
gasPrice: self.calculatedGasPrice, |
|
|
|
gasLimit: GasPriceConfiguration.limit, |
|
|
|
gasLimit: GasPriceConfiguration.maxGas, |
|
|
|
data: data |
|
|
|
data: data |
|
|
|
) |
|
|
|
) |
|
|
|
completion(.success(())) |
|
|
|
completion(.success(())) |
|
|
@ -154,7 +154,7 @@ class TransactionConfigurator { |
|
|
|
let data = Data(hex: res.drop0x) |
|
|
|
let data = Data(hex: res.drop0x) |
|
|
|
self.configuration = TransactionConfiguration( |
|
|
|
self.configuration = TransactionConfiguration( |
|
|
|
gasPrice: self.calculatedGasPrice, |
|
|
|
gasPrice: self.calculatedGasPrice, |
|
|
|
gasLimit: GasPriceConfiguration.limit, |
|
|
|
gasLimit: GasPriceConfiguration.maxGas, |
|
|
|
data: data |
|
|
|
data: data |
|
|
|
) |
|
|
|
) |
|
|
|
completion(.success(())) |
|
|
|
completion(.success(())) |
|
|
@ -171,7 +171,7 @@ class TransactionConfigurator { |
|
|
|
let data = Data(hex: res.drop0x) |
|
|
|
let data = Data(hex: res.drop0x) |
|
|
|
self.configuration = TransactionConfiguration( |
|
|
|
self.configuration = TransactionConfiguration( |
|
|
|
gasPrice: self.calculatedGasPrice, |
|
|
|
gasPrice: self.calculatedGasPrice, |
|
|
|
gasLimit: GasPriceConfiguration.limit, |
|
|
|
gasLimit: GasPriceConfiguration.maxGas, |
|
|
|
data: data |
|
|
|
data: data |
|
|
|
) |
|
|
|
) |
|
|
|
completion(.success(())) |
|
|
|
completion(.success(())) |
|
|
|