Transaction option is not applied to send translation.
See original GitHub issueThere is a problem that the trasactionOptions cannot be used properly because of merge. In the Web3+ MutatingTransaction class, it is replaced by cleanedOptions. I want to know the reason. 2.6.5 library version. Estimategas for EIP1559 is excellent. However, transaction option is not applied to send translation.
var options = writeTransaction.transactionOptions
options.nonce = .latest
options.callOnBlock = .latest
options.type = .eip1559
options.maxFeePerGas = .manual(maxFee)
options.maxPriorityFeePerGas = .manual(maxTip)
If you run sendTransactionPromise with the above options, maxFeePerGas and maxPriorityFeePerGas are ignored. There seems to be some problem when merge.
public func sendPromise(password: String = "web3swift", transactionOptions: TransactionOptions? = nil) -> Promise<TransactionSendingResult>{
let queue = self.web3.requestDispatcher.queue
return self.assemblePromise(transactionOptions: transactionOptions).then(on: queue) { transaction throws -> Promise<TransactionSendingResult> in
let mergedOptions = self.transactionOptions.merge(transactionOptions)
var cleanedOptions = TransactionOptions ()
cleanedOptions.to = mergedOptions.to
return self.web3.eth.sendTransactionPromise(transaction, transactionOptions: cleanedOptions, password: password)
}
}
maxFeePerGas , maxPriorityFeePerGas, type, nonce all nil. Only from, to exists.
/// create a JSCON RPC Request object for the given transaction
/// - Parameters:
/// - method: RPC request method
/// - transaction: the thansaction to encode/send
/// - trasactionOptions: additional options for the transaction
/// - Returns: a JSCONRPCrequest object
static func createRequest(method: JSONRPCmethod, transaction: EthereumTransaction, transactionOptions: TransactionOptions?) -> JSONRPCrequest? {
let onBlock = transactionOptions?.callOnBlock?.stringValue
var request = JSONRPCrequest ()
request.method = method
let from = transactionOptions?.from
quard var txParams = transaction.encodeAsDictionary(from: from) else { return nil }
if method == .estimateGas || transactionOptions?.gasLimit == nil {
txParams.gas = nil
}
var params = [txParams] as [Encodable]
if method.requiredNumOfParameters == 2&& onBlock != nil {
params.append( onBlock as Encodable )
}
let pars = JSONRPCparams(params: params)
request.params = pars
if !request.isValid { return nil }
return request
}
Maybe there is a problem with this method, too.
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
Working with Translation Files - Business Central
How to work with translations, multilanguage, and XLIFF files in Business Central.
Read more >ISO 20022: In-flow Translation - Swift
This approach aims to facilitate the integration in the receiver's application environment in cases where not all applications can (yet) support the ISO...
Read more >Fix issues when you send, receive, or transfer money
Use this info to fix common issues in Google Pay when you: Send or receive money. Add or transfer out money. “Transaction cannot...
Read more >Working with Override Translation Rules - Oracle Help Center
When you create translation rules, you select the translation method and rate account to use for the translation. The translation rule overrides the...
Read more >A glossary of terms used in payments and settlement systems
The Committee on Payment and Settlement Systems (CPSS) is publishing this comprehensive glossary of payment system terminology as a reference document for ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Kristenlike1234 Something that I didn’t take into account right away is that
TransactionOptions
is a struct and since struct in Swift is a value type this action will create absolutely different variable:Modifying
options
won’t change anything inwriteTransaction.transactionOptions
.What you should do instead is change
transactionOptions
directly:If you prefer the way you do it with a new
options
variable then pass it intosend
orsendPromise
functions like this:@Kristenlike1234 Try passing back your options into
send
orsendPromise
and ping me with the result, please. If that won’t help we should look further. For now, I’ll switch to a different task.