From fb1e0c9cf0f155253f437af06c7014d8314ce111 Mon Sep 17 00:00:00 2001 From: Satoshi Qazi Muhammed Date: Fri, 10 Jul 2026 09:05:03 -0700 Subject: [PATCH] fix: add explicit : Unit return type to @Test functions using runBlocking JUnit4's BlockJUnit4ClassRunner requires @Test methods to compile with a void return type. 'fun test() = runBlocking { ... }' infers the function's return type from the block's last expression - two of these tests ended on a Mockito verify(...).someMethod(...) call, whose return type leaks through as the inferred type (e.g. String, since TronGridApi.broadcastTransaction returns String) instead of Unit, so the whole test class failed ParentRunner validation before any test could even run. Declaring the return type explicitly as Unit makes Kotlin discard the expression's value (unit-coercion) rather than infer it - added to all three tests for consistency, not just the two that were actually failing. --- .../tron/transaction/RealTronTransactionServiceTest.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/feature-wallet-impl/src/test/java/io/novafoundation/nova/feature_wallet_impl/data/network/tron/transaction/RealTronTransactionServiceTest.kt b/feature-wallet-impl/src/test/java/io/novafoundation/nova/feature_wallet_impl/data/network/tron/transaction/RealTronTransactionServiceTest.kt index 1827ce15..3bfbd1a7 100644 --- a/feature-wallet-impl/src/test/java/io/novafoundation/nova/feature_wallet_impl/data/network/tron/transaction/RealTronTransactionServiceTest.kt +++ b/feature-wallet-impl/src/test/java/io/novafoundation/nova/feature_wallet_impl/data/network/tron/transaction/RealTronTransactionServiceTest.kt @@ -97,7 +97,7 @@ class RealTronTransactionServiceTest { } @Test - fun `transact with Native intent should build, sign with sha256(raw_data), and broadcast a 65-byte r+s+v signature`() = runBlocking { + fun `transact with Native intent should build, sign with sha256(raw_data), and broadcast a 65-byte r+s+v signature`(): Unit = runBlocking { val unsigned = TronUnsignedTransactionResponse( visible = false, txID = expectedTxId, @@ -147,7 +147,7 @@ class RealTronTransactionServiceTest { } @Test - fun `transact should refuse to sign when TronGrid's txID does not match sha256(raw_data)`() = runBlocking { + fun `transact should refuse to sign when TronGrid's txID does not match sha256(raw_data)`(): Unit = runBlocking { val tamperedTxId = "0".repeat(64) // deliberately wrong - does not match sha256(rawDataHex) val unsigned = TronUnsignedTransactionResponse( visible = false, @@ -175,7 +175,7 @@ class RealTronTransactionServiceTest { } @Test - fun `calculateFee for Native intent should charge bandwidth shortfall at the fallback price when TronGrid's own resource_endpoints are unavailable`() = runBlocking { + fun `calculateFee for Native intent should charge bandwidth shortfall at the fallback price when TronGrid's own resource_endpoints are unavailable`(): Unit = runBlocking { val unsigned = TronUnsignedTransactionResponse( visible = false, txID = expectedTxId,