From 2c336427e5ded6a34524e533e650f408e48ca557 Mon Sep 17 00:00:00 2001 From: Martin Khachatryan <86410695+Martin9204@users.noreply.github.com> Date: Thu, 21 May 2026 20:14:51 +0400 Subject: [PATCH] Fix Tron solverLock MsgValueMismatch revert with native reward token MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Tron TP worker recomputed call_value only from the lock amount when the lock token was native TRX, ignoring the reward. When the reward token was native (regardless of the lock token), msg.value had to include the reward too — otherwise the Train contract reverted with MsgValueMismatch(). The shared EVM TransactionBuilderService already returns the correct native amount (amount + reward when either is native) in PrepareTransactionDto.Amount. Use that value directly instead of recomputing it. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../Workers/TronTransactionProcessorWorker.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/csharp/src/Network.Tron.Grpc/Workers/TronTransactionProcessorWorker.cs b/csharp/src/Network.Tron.Grpc/Workers/TronTransactionProcessorWorker.cs index 8ac6a6ec..39d57253 100644 --- a/csharp/src/Network.Tron.Grpc/Workers/TronTransactionProcessorWorker.cs +++ b/csharp/src/Network.Tron.Grpc/Workers/TronTransactionProcessorWorker.cs @@ -171,8 +171,7 @@ private async Task ProcessRequestAsync(ITronTransactionQueueRepository repo, Tro var trainContract = Network.Contracts.FirstOrDefault(c => c.Type == "Train") ?? throw new InvalidOperationException($"No Train contract configured on {_networkSlug}"); - var callValue = request.Payload is TxPayload.Lock l && IsNativeToken(l.Request.TokenContract) - ? BigInteger.Parse(l.Request.Amount) : BigInteger.Zero; + var callValue = BigInteger.Parse(calldata.Amount ?? "0"); unsignedTx = await tronTxService.BuildHTLCTransactionAsync(new TronBuildHTLCTransactionRequest {