From 79a1c1ea33495a3509f58a2410f91be3e38c58e1 Mon Sep 17 00:00:00 2001 From: tgmichel Date: Wed, 14 Jun 2023 17:32:14 +0200 Subject: [PATCH] `eth_getLogs` return expected error/message for unknown hash (#2350) * pin frontier `49dc9b4` * add ts test * editorconfig --- Cargo.lock | 44 +++++++++---------- .../test-eth-rpc-log-filtering.ts | 9 ++++ 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 130f982eab..3c45d6b2fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2741,7 +2741,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "async-trait", "fc-db", @@ -2758,7 +2758,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2777,7 +2777,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "fc-db", "fc-storage", @@ -2798,7 +2798,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "ethereum", "ethereum-types", @@ -2847,7 +2847,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "ethereum", "ethereum-types", @@ -2860,7 +2860,7 @@ dependencies = [ [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "ethereum", "ethereum-types", @@ -3009,7 +3009,7 @@ dependencies = [ [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "hex", "impl-serde 0.4.0", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "ethereum", "parity-scale-codec", @@ -3039,7 +3039,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "ethereum", "ethereum-types", @@ -3053,7 +3053,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "evm", "frame-support", @@ -3067,7 +3067,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "ethereum", "ethereum-types", @@ -3084,7 +3084,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "frame-support", "parity-scale-codec", @@ -3096,7 +3096,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "parity-scale-codec", "serde", @@ -7121,7 +7121,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "fp-evm", "frame-support", @@ -7363,7 +7363,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "environmental", "ethereum", @@ -7430,7 +7430,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "environmental", "evm", @@ -7539,7 +7539,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-blake2" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "fp-evm", ] @@ -7547,7 +7547,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "fp-evm", "sp-core", @@ -7703,7 +7703,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-dispatch" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "fp-evm", "frame-support", @@ -7750,7 +7750,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "fp-evm", "num", @@ -7953,7 +7953,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "fp-evm", "tiny-keccak", @@ -7962,7 +7962,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#c6f66e4c59c1d1ec8bdfc1a055ed9271d57fb63a" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.40#49dc9b4024ebdb7fcbb7db8ab9dcef953b90f183" dependencies = [ "fp-evm", "ripemd", diff --git a/tests/tests/test-eth-rpc/test-eth-rpc-log-filtering.ts b/tests/tests/test-eth-rpc/test-eth-rpc-log-filtering.ts index 08edcf52bc..a42cb2b45e 100644 --- a/tests/tests/test-eth-rpc/test-eth-rpc-log-filtering.ts +++ b/tests/tests/test-eth-rpc/test-eth-rpc-log-filtering.ts @@ -62,4 +62,13 @@ describeDevMoonbeamAllEthTxTypes("Ethereum RPC - Filtering non-matching logs", ( expect(request.result.length).to.be.eq(0); } }); + it("EthApi::getLogs - should return `unknown block`.", async function () { + let request = await customWeb3Request(context.web3, "eth_getLogs", [ + { + blockHash: "0x1234000000000000000000000000000000000000000000000000000000000000", + }, + ]); + expect(request.error.message).to.be.equal("unknown block"); + expect(request.error.code).to.be.equal(-32000); + }); });