Skip to content

Commit 97a7213

Browse files
authored
fix: honor payment tx id if present (#1790)
Signed-off-by: Rado M <radkomih@gmail.com>
1 parent 9d42265 commit 97a7213

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

sdk/contract_info_query_unit_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ func TestUnitContractInfoQueryMock(t *testing.T) {
113113
}
114114

115115
func TestUnitContractInfoQueryGetTransactionIDMock(t *testing.T) {
116-
t.Skip("Skipping test as it is currently broken with the addition of generating new payment transactions for queries")
117116
t.Parallel()
118117

119118
transactionID := TransactionIDGenerate(AccountID{Account: 123})

sdk/query.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,14 @@ func (q *Query) generatePayments(client *Client, cost Hbar) (*services.Transacti
262262
var tx *services.Transaction
263263
var err error
264264
nodeID := q.nodeAccountIDs._GetCurrent()
265-
txnID := TransactionIDGenerate(client.operator.accountID)
265+
266+
var txnID TransactionID
267+
if !q.paymentTransactionIDs._IsEmpty() {
268+
txnID = q.paymentTransactionIDs._GetCurrent().(TransactionID)
269+
} else {
270+
txnID = TransactionIDGenerate(client.operator.accountID)
271+
}
272+
266273
tx, err = _QueryMakePaymentTransaction(
267274
txnID,
268275
nodeID.(AccountID),

0 commit comments

Comments
 (0)