From 8bfcb80ed6e49844fca0911a90aa1618d1f670bc Mon Sep 17 00:00:00 2001 From: Stefan Date: Wed, 12 Jul 2023 22:51:43 +0100 Subject: [PATCH] fix(wallet) fix scan to/from hash when for multi_transactions --- services/wallet/transfer/transaction.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/services/wallet/transfer/transaction.go b/services/wallet/transfer/transaction.go index c2c9ec25b..9deb5df25 100644 --- a/services/wallet/transfer/transaction.go +++ b/services/wallet/transfer/transaction.go @@ -120,15 +120,16 @@ func rowsToMultiTransactions(rows *sql.Rows) ([]*MultiTransaction, error) { for rows.Next() { multiTransaction := &MultiTransaction{} var fromAmountDB, toAmountDB sql.NullString + var fromTxHash, toTxHash sql.RawBytes err := rows.Scan( &multiTransaction.ID, &multiTransaction.FromNetworkID, - &multiTransaction.FromTxHash, + &fromTxHash, &multiTransaction.FromAddress, &multiTransaction.FromAsset, &fromAmountDB, &multiTransaction.ToNetworkID, - &multiTransaction.ToTxHash, + &toTxHash, &multiTransaction.ToAddress, &multiTransaction.ToAsset, &toAmountDB, @@ -136,6 +137,12 @@ func rowsToMultiTransactions(rows *sql.Rows) ([]*MultiTransaction, error) { &multiTransaction.CrossTxID, &multiTransaction.Timestamp, ) + if len(fromTxHash) > 0 { + multiTransaction.FromTxHash = common.BytesToHash(fromTxHash) + } + if len(toTxHash) > 0 { + multiTransaction.ToTxHash = common.BytesToHash(toTxHash) + } if err != nil { return nil, err }