laconicd-deprecated/tests/integration_tests/test_tracers.py
Ramiro Carlucho 71e51aabf6
chore (deps): Update geth version to v1.10.25 (#1413)
* build(deps): bump github.com/ethereum/go-ethereum

Bumps [github.com/ethereum/go-ethereum](https://github.com/ethereum/go-ethereum) from 1.10.19 to 1.10.25.
- [Release notes](https://github.com/ethereum/go-ethereum/releases)
- [Commits](https://github.com/ethereum/go-ethereum/compare/v1.10.19...v1.10.25)

---
updated-dependencies:
- dependency-name: github.com/ethereum/go-ethereum
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* wip geth update

* fix geth init flag order

* add chainId to getTransaction. fix types comparison. update expected values on tests

* wip add tracer config

* tracers test

* update tests

* update to v1.10.25

* fix linter python

* ignore error

* fix lint

* additional changes from diff

* fix issues

* solve lint issues

* fix tests

* fix flake

* wrap types comparison in integration tests

* fix integration tests

* fix flake

* update changelog

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Freddy Caceres <facs95@gmail.com>
2022-11-16 12:59:12 -05:00

53 lines
1.5 KiB
Python

from web3 import Web3
from .expected_constants import (
EXPECTED_CALLTRACERS,
EXPECTED_CONTRACT_CREATE_TRACER,
EXPECTED_STRUCT_TRACER,
)
from .utils import (
ADDRS,
CONTRACTS,
KEYS,
deploy_contract,
send_transaction,
w3_wait_for_new_blocks,
)
def test_tracers(ethermint_rpc_ws):
w3: Web3 = ethermint_rpc_ws.w3
eth_rpc = w3.provider
gas_price = w3.eth.gas_price
tx = {"to": ADDRS["community"], "value": 100, "gasPrice": gas_price}
tx_hash = send_transaction(w3, tx, KEYS["validator"])["transactionHash"].hex()
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, ""
_, tx = deploy_contract(
w3,
CONTRACTS["TestERC20A"],
)
tx_hash = tx["transactionHash"].hex()
w3_wait_for_new_blocks(w3, 1)
tx_res = eth_rpc.make_request(
"debug_traceTransaction", [tx_hash, {"tracer": "callTracer"}]
)
tx_res["result"]["to"] = EXPECTED_CONTRACT_CREATE_TRACER["to"]
assert tx_res["result"] == EXPECTED_CONTRACT_CREATE_TRACER, ""