diff --git a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs index 34664070484..674b70af952 100644 --- a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs +++ b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs @@ -363,6 +363,18 @@ public async Task Eth_get_storage_at_default_block() Assert.That(serialized, Is.EqualTo("{\"jsonrpc\":\"2.0\",\"result\":\"0x0000000000000000000000000000000000000000000000000000000000abcdef\",\"id\":67}")); } + [Test] + public async Task Eth_get_storage_at_trie_exception() + { + using Context ctx = await Context.Create(); + ctx.Test.StateDb.Clear(); + BlockParameter? blockParameter = null; + BlockHeader? header = ctx.Test.BlockFinder.FindHeader(blockParameter); + string serialized = await ctx.Test.TestEthRpc("eth_getStorageAt", TestItem.AddressA.Bytes.ToHexString(true), "0x1"); + var expected = $"{{\"jsonrpc\":\"2.0\",\"error\":{{\"code\":-32002,\"message\":\"No state available for block {header?.Number} ({header?.Hash})\"}},\"id\":67}}"; + Assert.That(serialized, Is.EqualTo(expected)); + } + [Test] public async Task Eth_get_block_number() {