Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

chore (deps): Update geth version to v1.10.25 #1413

Merged
merged 26 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
tracers test
  • Loading branch information
ramacarlucho committed Oct 29, 2022
commit 8f307d8ad990bb0f9d0964a25cf9200d79d21968
18 changes: 18 additions & 0 deletions tests/integration_tests/expected_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,22 @@
"type":"0x0"
},
"id":1
}

EXPECTED_CALLTRACERS = {
"from":"0x57f96e6b86cdefdb3d412547816a82e3e0ebf9d2",
"gas":"0x0",
"gasUsed":"0x0",
"input":"0x",
"output":"0x",
"to":"0x378c50d9264c63f3f92b806d4ee56e9d86ffb3ec",
"type":"CALL",
"value":"0x64"
}

EXPECTED_STRUCT_TRACER = {
"failed":False,
"gas":21000,
"returnValue":"",
"structLogs":[],
}
33 changes: 33 additions & 0 deletions tests/integration_tests/test_tracers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from .expected_constants import (
EXPECTED_CALLTRACERS,
EXPECTED_STRUCT_TRACER
)
from web3 import Web3

from .utils import (
ADDRS,
KEYS,
send_transaction,
)

def send_and_get_hash(w3, tx_value=100):
# Do an ethereum transfer
gas_price = w3.eth.gas_price
tx = {"to": ADDRS["community"], "value": tx_value, "gasPrice": gas_price*10}
return send_transaction(w3, tx, KEYS["validator"])["transactionHash"].hex()



def test_pending_transaction_filter(ethermint_rpc_ws):
w3: Web3 = ethermint_rpc_ws.w3
eth_rpc = w3.provider
tx_hash = send_and_get_hash(w3)

tx_res = eth_rpc.make_request("debug_traceTransaction", [tx_hash])
assert tx_res['result'] == EXPECTED_STRUCT_TRACER, ""

tx_res = eth_rpc.make_request("debug_traceTransaction", [tx_hash, {"tracer":"callTracer"}])
assert tx_res['result'] == EXPECTED_CALLTRACERS, ""

tx_res = eth_rpc.make_request("debug_traceTransaction", [tx_hash, {"tracer":"callTracer", "tracerConfig": "{'onlyTopCall':True}"}])
assert tx_res['result'] == EXPECTED_CALLTRACERS, ""