@@ -30,7 +30,7 @@ public class ReadTransaction {
30
30
}
31
31
32
32
public func callPromise( transactionOptions: TransactionOptions ? = nil ) -> Promise < [ String : Any ] > {
33
- let assembledTransaction : EthereumTransaction = self . transaction
33
+ var assembledTransaction : EthereumTransaction = self . transaction
34
34
let queue = self . web3. requestDispatcher. queue
35
35
let returnPromise = Promise< [ String: Any] > { seal in
36
36
let mergedOptions = self . transactionOptions. merge ( transactionOptions)
@@ -39,6 +39,9 @@ public class ReadTransaction {
39
39
optionsForCall. to = mergedOptions. to
40
40
optionsForCall. value = mergedOptions. value
41
41
optionsForCall. callOnBlock = mergedOptions. callOnBlock
42
+ if mergedOptions. value != nil {
43
+ assembledTransaction. value = mergedOptions. value!
44
+ }
42
45
let callPromise : Promise < Data > = self . web3. eth. callPromise ( assembledTransaction, transactionOptions: optionsForCall)
43
46
callPromise. done ( on: queue) { ( data: Data ) throws in
44
47
do {
@@ -63,7 +66,7 @@ public class ReadTransaction {
63
66
}
64
67
65
68
public func estimateGasPromise( transactionOptions: TransactionOptions ? = nil ) -> Promise < BigUInt > {
66
- let assembledTransaction : EthereumTransaction = self . transaction
69
+ var assembledTransaction : EthereumTransaction = self . transaction
67
70
let queue = self . web3. requestDispatcher. queue
68
71
let returnPromise = Promise< BigUInt> { seal in
69
72
let mergedOptions = self . transactionOptions. merge ( transactionOptions)
@@ -72,6 +75,9 @@ public class ReadTransaction {
72
75
optionsForGasEstimation. to = mergedOptions. to
73
76
optionsForGasEstimation. value = mergedOptions. value
74
77
optionsForGasEstimation. callOnBlock = mergedOptions. callOnBlock
78
+ if mergedOptions. value != nil {
79
+ assembledTransaction. value = mergedOptions. value!
80
+ }
75
81
let promise = self . web3. eth. estimateGasPromise ( assembledTransaction, transactionOptions: optionsForGasEstimation)
76
82
promise. done ( on: queue) { ( estimate: BigUInt ) in
77
83
seal. fulfill ( estimate)
0 commit comments