Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,15 @@ public async Task DebugGetRawTransaction_WhenTransactionExists_ReturnsTransactio
Assert.That(serialized, Is.EqualTo($"{{\"jsonrpc\":\"2.0\",\"result\":\"{expected}\",\"id\":67}}"));
}

[Test]
public async Task DebugGetRawTransaction_WhenTransactionNotFound_ReturnsNull()
{
_debugBridge.GetTransactionFromHash(Keccak.Zero).ReturnsNull();

string serialized = await SerializedRequest("debug_getRawTransaction", Keccak.Zero);
Assert.That(serialized, Is.EqualTo("{\"jsonrpc\":\"2.0\",\"result\":null,\"id\":67}"));
}

[Test]
public async Task DebugGetRawReceipts_WhenReceiptsExist_ReturnsHexArray()
{
Expand Down Expand Up @@ -484,10 +493,6 @@ private static IEnumerable<TestCaseData> RawMissingCases()
(Action<IDebugBridge>)(b => b.GetBlock(new BlockParameter(Keccak.Zero)).ReturnsNull()),
"debug_getRawBlock", (object)Keccak.Zero)
{ TestName = "RawBlock_ByHash" };
yield return new TestCaseData(
(Action<IDebugBridge>)(b => b.GetTransactionFromHash(Keccak.Zero).ReturnsNull()),
"debug_getRawTransaction", (object)Keccak.Zero)
{ TestName = "RawTransaction" };
}

private static IEnumerable<TestCaseData> RawBlockAccessListErrorCases()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ public ResultWrapper<ArrayPoolList<byte>> debug_getRawTransaction(Hash256 transa
Transaction? transaction = debugBridge.GetTransactionFromHash(transactionHash);
if (transaction is null)
{
return ResultWrapper<ArrayPoolList<byte>>.Fail($"Transaction {transactionHash} was not found", ErrorCodes.ResourceNotFound);
return ResultWrapper<ArrayPoolList<byte>>.Success(null);
}

RlpBehaviors encodingSettings = RlpBehaviors.SkipTypedWrapping | (transaction.IsInMempoolForm() ? RlpBehaviors.InMempoolForm : RlpBehaviors.None);
Expand Down
Loading